Learning With D

Daniel Gibson metalcaedes at gmail.com
Mon May 23 17:37:31 PDT 2011


Am 24.05.2011 01:59, schrieb bearophile:
> 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...
> 

How do you do "less precise programming"? Just change your code until
the compiler stops emitting error messages and until the output of your
program looks "about right" for some sample input?
IMHO the sooner they learn to be precise the better - randomly changing
code until it compiles is no programming but a sign that the
"programmer" hasn't got a clue what he's doing.

Furthermore I'm not sure whether setting correct parentheses is easier
than correct indenting for these kind of students (or will they just add
parentheses until the compiler shuts up)?

(WTF am I really defending a scripting language?)

> 
>> 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). 

Maybe, doesn't change the fact that most other languages are case
sensitive. And as a Linux user (with case sensitive file systems) I
think people should get used to case sensitivity.

> 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 :-)
> 

And learning Pascal in the first and C in the second year is good?

> 
>> 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.
> 

I've "learned" Delphi in school (didn't learn that much in retrospect, I
wasn't taught about records, classes, pointers, ... but we always
clicked a nice GUI..) but didn't even know it was 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.
> 

Even programming newbies can easily learn that "The" != "the".

> Bye,
> bearophile



More information about the Digitalmars-d-announce mailing list