3 ms·
I second project Euler, but for a different use case. It is a great tool to learn the lower level workings of a computer language. Work through the first 100 or
by Johnny_Brahms 10y ago
I second project Euler, but for a different use case. It is a great tool to learn the lower level workings of a computer language. Work through the first 100 or so exercises in a new programming language, and you have got a good understanding of how to write efficient code. Most of the problems are solvable in less than 1s in most languages with the non-naive brute Force approach. I remember doing it in a functional style using scheme. At about problem 50 I had a good understanding for how to write in a way that avoided excess allocations/collections.
Ah the frustration when someone was generating primes with a worse approach than I had, and my code was 2 or more times slower.