From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!1.eu.feeder.erje.net!news.mb-net.net!open-news-network.org!aioe.org!.POSTED!not-for-mail From: Bill White Newsgroups: comp.lang.ada Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it? Date: Fri, 22 May 2015 15:04:34 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> NNTP-Posting-Host: ORj2M9RkYdkdAHLct7ij1w.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:193253 Date: 2015-05-22T15:04:34+00:00 List-Id: On 2015-05-22, J-P. Rosen wrote: > Le 22/05/2015 13:29, kalvin.news@gmail.com a ?crit : >> Even C could be made more robust, if simple type checking is >> performed at compile time. For example, >> >> typedef int apples; >> >> typedef int oranges; >> >> apples a = 5; oranges o = a; >> >> should generate type check error as the types are definitely >> different types. Also, assigning enums to ints and ints to enums >> should be considered illegal. >> > I don't agree. C is a low level language, and good at that. C isn't good at anything except to serve as a bad example! > Its types are those of the machine: bytes and addresses Rather, C's types are those of C's virtual machine- C's view of the hardware. And that makes C unsuitable for systems programming and not very portable without defining your own types. Just because something is widely used doesn't mean it's suitable. There are other factors like price, availability, etc. Cheap (free) won long ago. > If you need strong typing, use a strongly typed language. But don't > blame C for not being strongly typed, it was simply not part of the > requirements. Agreed. But then the only requirements C ever really had were for ease of implementation.