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:08:50 -0700 Organization: None to speak of Lines: 50 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="U2FsdGVkX19iV6wsE+8kaModh/mIySqu" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:JIktT8mEawzzQBOLRe/m+FjH0pQ= sha1:YEgtnMDZDM6gGKWIjbqSIMQye1U= Xref: csiph.com comp.lang.c:94754 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. Pointers are so pervasive in C, that you can't completely avoid them for very long. You can probably avoid mentioning them initially, especially if you concentrate on programs that do integer arithmetic. > ¹) Scott Meyers writes in an Item of "Effective Modern C++": > > »It's been said that the truth shall set you free, but > under the right circumstances, a well-chosen lie can be > equally liberating. This Item is such a lie. Because > we're dealing with software, however, let's eschew the > word "lie" and instead say that this Item comprises an > "abstraction."« I'd like to see the context for that. -- 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"