Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Sort char array Date: Thu, 17 Oct 2019 06:08:19 -0700 Organization: A noiseless patient Spider Lines: 46 Message-ID: <86pniv4j0c.fsf@linuxsc.com> References: <20191007131948.c9f28d44bcd105e7a153069a@g{oogle}mail.com> <2xFmF.867378$yH4.431562@fx18.am4> <20191007174244.385138503569a8bc6d4eec9d@g{oogle}mail.com> <20191008022725.36fbd95aa45ba185290e5e11@gmail.com> <1q_mF.841756$Zy3.585129@fx33.am4> <20191009020207.b533aa1c6d95f44eb314ffc1@gmail.com> <5alnF.1041354$WI2.353384@fx34.am4> <87tv8ggaxh.fsf@bsb.me.uk> <87mue8fx7b.fsf@bsb.me.uk> <86a7a3721w.fsf@linuxsc.com> <596f5e01-aa2a-4f30-adfa-9d17a206ea63@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="f160be45e7b63fa8f4ae90cda1d207ba"; logging-data="1846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+q8WY+OqOxZY7g9bwb/Bp/c9RYRN4k62g=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:p4XAlr58o+m8hhE3b/UkVDhP9jI= sha1:KgcoPq2vkc2kv5CjsnStvqJUSK0= Xref: csiph.com comp.lang.c:147017 Malcolm McLean writes: > On Monday, 14 October 2019 16:57:25 UTC+1, Tim Rentsch wrote: > >> The Dijkstra observation is about the two views of programming. >> In the old view, the purpose of our programs is to instruct our >> machines. In the new view, the purpose of machines is to execute >> our programs. This change of viewpoint is a profound shift. >> >> The Morris observation is captured by the title of his seminal >> paper, "Types are not sets" (here is a link for people who have >> not seen the paper: >> >> http://www.cs.fsu.edu/~langley/COP4020/2016-Summer/p120-morris.pdf >> >> ). >> >> The difference in viewpoints we are seeing here can be understood >> by the observations of Dijkstra and Morris. The people who think >> C has too many types are those who have not yet made the shifts >> described by Dijkstra and Morris. They think of "type" as being >> synonymous with representation, and at least in this area their >> thinking is mostly at the level of assembly language. Speaking >> for myself, there are times in programming when I do deliberately >> take the perspective of what's going on at the assembly language >> level, but mostly I don't, because it gets in the way of seeing >> what is going on at a higher level. Since the most important >> parts of program understanding involve seeing what is going on at >> higher levels of abstraction, the vast majority of the time I >> avoid thinking at the assembly language level, because doing so >> hurts more than it helps. >> >> These observations may help us understand the comments of people >> who think C's type model is somehow bad or wrong. > > [...] > > However at the lower level, you can't ignore the fact that the > computer memory and registers are made of bits, accessed in > chunks which are usually multiples of octets. [..examples from > computer graphics..] Don't be an idiot. Of course _some_ parts of programming must be closely concerned with representation. My point was about programmers who _routinely_ think in terms of representation, and rarely in terms of anything else.