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

With all my love for Project Euler, I absolutely hate it when people mention it in relation to useful programming skills. PE is about math more than it's about programming. The programming constructs you need for it are very basic and won't teach you much about the language. They won't teach you how that language works for large modular applications. They won't teach you what useful libraries the language has for networking, GUIs, parsing and so on. They won't teach you how to package applications written in the language for distribution. They won't teach you how the language interoperates with other languages (especially C).

Phew, sorry for the flame. Had to get it off my chest. PE is sometimes a knee-jerk reaction to programming queries, and this is wrong IMHO.



While all that is true, I can't think of any quick toy example that covers all of that. I find that plowing through the first 25 or so PE problems is a great way to get the hang of the basic syntax and style of a language. Once you've gotten the hang of the basic style and syntax you can move on to bigger and more 'real' problems. But starting by trying to build a GUI, call a C library and package your program for distribution before you learn how to create, reverse and iterate of an array seems rather backwards.


You learn the syntax by reading a tutorial/introductory book for a language. This is the first step. After solving 3-4 PE problems you begin to realize you're just reusing the same few constructs over and over again, without learning much new about the language.


How do you ensure that you learn the style specific to a certain language and not just literally translate from a language you already know?

E.g. in Java, you would probably solve problem 1 with a for loop, while you could use a generator expression in Python.


Another reason why reading a tutorial or two (or better, five) is essential as the first step. Just jumping to coding programming exercises won't help much in learning how to write idiomatic code for the language.


I'm not suggesting that coding up solutions to PE problems should be done instead of reading tutorials. I mean how are you going to write code if you have no idea how the language works. However I personally find that I learn very little from simply reading a book about a language, I have to write code in it at the same time to help internalize the concepts I'm reading about. And for that I find PE to be a good first step after hello world.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: