Learning With D

bearophile bearophileHUGS at lycos.com
Mon May 23 16:59:56 PDT 2011


Daniel Gibson:

> OTOH python teaches to indent your code properly which enhances
> readability, so maybe it's a good thing to learn right from the beginning.
> I've had students producing working code (Java and SQL) that was totally
> unreadable because it wasn't indented properly.

Some students are precise, they puts all the full stops and commas in their comments, and format code well. Other students seem unable to understand the need for a proper code formatting. But both kinds of students must learn some programming and do some practice at it. The teacher has to ask for a good code formatting, but I have seen it's better to avoid an escalation of the frustration of the less precise programmers, otherwise they may lose interest in programming and sometimes even switch courses :-) They already hate the interpreter/compiler for all those stupid error messages it gives them...


> Exactly. So why teach it in a differently first and then tell "well, now
> you're using a proper language and now you have to start caring about
> case"?

Delphi is a proper language (better than C, by the way). The first language you use doesn't need to be the same language you use 8 months later. Ignoring cases first, and later asking for a more strict programming style is not bad, it's exactly what lot of students used to do learning Pascal the first year and C the second :-)


> This just asks for subtle bugs because of spelling mistakes..
> 
> class Bar {
>   int p;
>   void setFoo(int P) { this.p = p; }
> }
> 
> and stuff like that.

Have you programmed in Delphi/ObjectPascal for some weeks or more? Case-related bugs are not common. I am not talking about removing case sensitivity from C/Java, I am talking about a language wholly designed taking into account it is case insensitive.


> It may not be essential. Neither is correct spelling; so the language
> could be fuzzy about detecting keywords so "to { ... } wihle(...);"
> could be accepted as well :-P

People that don't know how to switch on a computer know that in their natural language the word "the" means the same thing if you write it lowercase in the middle of the phrase, or if you write it capitalized as "The" at the beginning of a phrase. But even programming newbies (unless they have dyslexia, and some new programmers _do_ have strong dyslexia, and the teacher must find a ways to teach them too something) are able to see that "hte" is a word different from "the". So this argument of yours is not good enough.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list