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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Teaching C/C++ from Ada perspective? Date: Mon, 2 Jul 2018 22:27:31 +0200 Organization: A noiseless patient Spider Message-ID: References: <856189aa-fa00-4960-929e-174f352310ad@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 2 Jul 2018 20:27:32 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="3c49b6cea03230a7d49f184d3ed1814e"; logging-data="18327"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18M7u5Ho2C0NSO3RHel392xxfa1ubbIRu4=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:Hdsb73raN/OBT+hIObB8oC05tnY= In-Reply-To: Content-Language: de-DE Xref: reader02.eternal-september.org comp.lang.ada:53521 Date: 2018-07-02T22:27:31+02:00 List-Id: On 02.07.18 19:10, kouaoua16@gmail.com wrote: > The course is too start with Algorithms first and then end with programming. Hypothetically, there is no algorithm that isn't a programm. It's just the programming language that might appear to be a little vague. So, the above sentence might perhaps be changed so as to end in "end with making the programs formal". I once learned a programming language the has 4 instructions. The lessons got on using just 3 for quite a while. It thus offered a very clear and simple way of imagining and understanding the workings of a technical machine that is built to compute functions. Simple foundations are good for teaching, I'd say. Just think of the opposite. For V a variable, actually a natural number, V <- V + 1 ; increment V <- V - 1 ; decrement, saturated at 0 IF V /= 0 GOTO L ; L a label Thus, very little "structure", no composite types, no characters. And just one output variable, Y, plus input variables. An exercise or exposition: an algorithm called "copy", from an input variable to the output variable, is manageable and instructive. You learn how to program that thing! Surprisingly, the result will appear similar to C++'s algorithm "copy", to some extent, which is based on STL iterators thus using a seemingly much more complex programming language. For sure, the latter is more general and computes different functions, but the "steps" of the algorithm, in number and kind have some overlap I do not think that C can be taught in one half semester. -- "HOTDOGS ARE NOT BOOKMARKS" Springfield Elementary teaching staff