Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C Programming Tutorial on Youtube Date: Tue, 11 Oct 2016 18:55:06 -0700 Organization: None to speak of Lines: 46 Message-ID: References: <8be0cdbe-c2f4-42ec-b6a7-e9a154981718@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="dda83c6a599b9ea966ac051ddb4678f6"; logging-data="20580"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NeckkBTu4Z4SiitznJ6MJ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:4g3E876NM86SNO7ildab+8wABeQ= sha1:RTKMtY+AUyys8hfauPU5XDJ3Nlc= Xref: csiph.com comp.lang.c:94757 Malcolm McLean writes: > On Wednesday, October 12, 2016 at 2:08:24 AM UTC+1, Keith Thompson wrote: >> ram@zedat.fu-berlin.de (Stefan Ram) writes: >> > Richard Heathfield writes: >> >>There we will have to differ, then. Complete beginners should not be >> >>told lies by their teachers. >> > >> > Complete beginners should not be told about pointers at all! >> > >> > I sometimes use l^Hsimplifications, when their benefit seems >> > to be larger than the damage they cause. >> > >> > I explain early that the type of a string literal is >> > »char*«, but I explain the »*« as follows: >> > >> > In »char*«, the »*« indicates a repetition of a >> > character (»char«), that is a sequence of characters. >> > >> > This may even verge on being correct, just a little bit >> > "abstract"¹. >> > >> > Addresses are then only treated much later in my course. >> >> I can understand the value of simplifications when teaching beginners. >> >> This, in my humble opinion, goes beyond that, in a very bad way. It >> instills tempting but false ideas that could be difficult to untangle >> when the student is ready to learn more. "*" does denote repetition in >> some contexts (regular exressions), but not in any that are relevent >> here. It reinforces the pervasive fallacy that arrays are really just >> pointers. It is, in my opinion, deliberately misleading. >> > int buff[1024]; > > buff is a constant pointer to a buffer (which C mis-terms an "array") > which contains enough space for 1024 integers. Except there's a little > syntactical quirk. But that can be ignored for now. If you're trying to demonstrate the idea of being deliberate misleading, well done. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"