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

One thing: what works for PHP isn't necessarily a good approach to learning another language, such as Python.

PHP's global space and the feel of "batteries included" is sharply contrasted to Python's typing and object oriented feel. Having people write PHP in Python would not only be counter-productive, the people being brought up on that style wouldn't get much out of python.

The trim example specifically: line = "foo\n" new = line.rstrip("\n")

vs. if we were to directly to transliterate from php, it would be string.rstrip(line,"\n")

(which is quite a different style)

This approach also under-emphasizes using language specific tools (e.g. interactive python, pydoc).



Typically the learning curve on a new language goes something like this.

1. Knows old language

2. Learns the syntax of new language

3. Writes old language style in new language

4. Through continued practice and learning in the new language, starts to pick up the idioms and styles of the new language.

5. Becomes fluent and well versed in the idioms, styles, advantages, and flaws of the new language. Can contrast old language with new language well and use the style most appropriate to the problem.

6. rinse and repeat

Not everyone progresses all the way through the process when they pick up a language. In fact I'd argue that some people never even pick up the idiomatic way of doing something in a language even if that is their only language.

I think you could think of this like an english-spanish dictionary. It's not going to teach you the idiomatic way of speaking, but it will give you the correct word to use. Which I would suggest is a milestone on the path to idiomatic speaking.

* edit for formatting


Sorry, but it's Python that uses the "batteries included" phrase.

http://www.python.org/about http://www.google.com/search?q=python+"batteries+included"




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

Search: