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

Nobody uses C. Most use C++. There are a few Java people. I made it to on-site semifinals in Clojure once. Reid Barton, who is at least 1000x smarter than me, made it to world finals in Haskell.

Modern C++ is about as easy to use as Python or Ruby for algorithmic problems and has many fewer gotchas and hidden time sucks. Python tends to spend a lot of time on implicit data type conversion that C++ saves and the data structures in Python are deeply suboptimal so that many algorithms won't run in their theoretical asymptotic time. Ruby is even worse. Python and Ruby's numerical efficiency and consistency is not suitable for fast, precise, predictable computation.

Take a look at some of the solutions on go-hero and you can see the style of C++ that is used; there aren't any ugly class hierarchies and deep template metaprogramming there. Modern C++ is very simple and efficient with C++ versions of all the nice tools and gadgets that make Python and Ruby fun.

"Another interesting thing is that Python is only really popular in US"

I think Python is popular only in the USA in real life, too. Living overseas you learn that the rest of the world is very, very far behind in programming tools compared to Boston and SF.



I think another reason is that for the competition-kind code there is very little difference between languages, so the drawbacks of C++ just don't matter. For example, the lack of garbage collection is not a problem, as the program works in the "allocate-compute-free" workflow. And with C++ you have far more room before you would have to think about performance than with more high-level languages. That is, maybe counterintuitively for someone, programming on C++ may be easier when performance matters.


As someone who did a bit a C++ at University and switched to Python, your comment makes me want to learn modern C++. Do you have any suggestion on where to start?


> ... makes me want to learn modern C++. Do you have any suggestion on where to start?

i have always found bjarne-stroustrup's books to be quite useful. his latest one (Programming: Principles and Practice Using C++) seems to cover c++11/c++14 as well. might be worth checking out ? another author i really like is andrew-koenig, you can probably look at, Accelerated C++, from him. it is a bit dated, but still pretty good overall.


This year I plan to use Scala for the GCJ, but for numerical problems I won't hesitate to go back to Python: Numpy is just too convenient for that. In previous editions I've used Numpy (and once even a Scipy solver) and it made my life easier (and efficient, consistent, fast, precise and predictable, while we're at it).


Do you have any links to Reid Barton's 2010 Google code jam code? I briefly looked and couldn't find it. I'm guessing someone more familiar with code jam would know right where it was or if it existed.





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

Search: