Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just spent the last two weeks learning the Ruby language (but I come from other programming languages).

I'd argue that learning .each vs. normal looping has numerous benefits. First, this is the way most people loop most things in Ruby. More importantly, however, teaching .each enabled me to be more openminded towards learning "yield" and blocks.

In a way, without having learned about .each first, and coming into Ruby with my preconceptions (or no conceptions), I would have been confused. I would have been writing Ruby as if I were writing Python or C, without really understanding the benefits of writing Ruby as Ruby ought to be written.



Learning a new language requires that you adapt your way of thinking. Idioms are a way to familiarize with the spirit of a language.

Starting to teach languages avoiding what makes the language so special is counter productive. As soon as your students know a basic way to program, they won't be inclined to learn the "good way".


I'm not sure how else to say this, but taking things out of context still does not make them wrong. This is about teaching the concept of programming. If you're learning a particular language, yes, use the idioms. If you're teaching someone how to code, teach concepts that cross languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: