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

despite mentioning algorithms (once), the links in that section are related to language-specific tweaks. so the article seems to assume that the reader is already a competent programmer (or, worse, doesn't understand that language-specific tweaks are much less important than basics).

for example, about 6 months ago i rewrote someone's C code into python. this was numerical code for processing astronomy observations and comparing them with numerical models. i reduced the running time from about 24 hours to 15 minutes. that wasn't because python is faster than C (it's not), or because i used python specific idioms (i did, but they made no real difference). it's because i replaced O(n^2) algorithms with linear ones.

the lesson being: language is not important.



Now if you re-write the C code to use O(n) instead of O(n^2) algorithms, you will reduce the runtime even further as compared to the Python runtime. Of course the time cost savings may not be as important or dramatic any more, since the Python version sounds good enough (at least for the data set in question).

Runtimes of languages still matter. Same algorithm implementation may run significantly slower in some languages than others (and this is not necessarily the language issue but interpreter/compiler issue).




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

Search: