Learning With D

Daniel Gibson metalcaedes at gmail.com
Mon May 23 16:10:24 PDT 2011


Am 23.05.2011 21:53, schrieb bearophile:
> Daniel Gibson:
> 
>>> - I appreciate Python significant indentation a lot, but I've seen it cause problems to some students.
>>
>> What kind of problems? (related to tabs vs spaces?)
> 
> Tabs Vs spaces is not a big problem once you have told students to set up all their editors to never emit a tab :-) So this is not the real problem.
> Different people have very different brains, some people find easy certain things and other people find easy other things. A good teacher must adapt himself/herself/hirself to the brain of the different students. Significant indentation has some good advantages, it reduces noise, it makes the semantics of the code the same of what you see, etc. But some programming newbies just aren't precise enough, they lose control and count of indentations, etc. For them spaces are nothing, they don't even see them, so for them braces are probably better, despite the increase in noise.
> 

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.

> 
>>> - Dynamic typing is handy, but it makes it a bit harder to learn the discipline of types.
>>
>> Yeah, I personally don't like dynamic typing at all.
> 
> We are discussing about a language used as first programming language. What's good for an programmer that is programming since two years is sometimes not the best for a newbie and vice versa too. Finding a good balance for newbies between Pascal/Java-style boring and stupid static typing, full type inference as in ML, and full dynamic typing as in Python, is not easy.
> 
> 
>> I strongly disagree. The first language they learn should *not* be
>> agnostic to case, so they learn that case matters (because it does in
>> most languages).
> 
> Most languages are strict in their case. So sooner or later a programmer must learn to tell apart cases of keywords and variables. 

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

> But the case of keywords is _not_ essential to learn the basics of programming. There are so many things to learn in the beginning. And Pascal has being used to successfully teach generations of programmers. So while I respect your point of view, I think this is something different teachers are allowed to disagree on :-)
> 

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

Also: What are "the basics or programming"? Isn't expressing what you
want in a precise way part of it? And caring about case is part of being
precise IMHO.

> Bye,
> bearophile

Cheers,
- Daniel


More information about the Digitalmars-d-announce mailing list