Hacker News new | ask | show | jobs
by robotcookies 3565 days ago
Personally, I think the best way to learn to code for someone who has talent for it is project Euler (projecteuler.net). No dependencies, no IDEs, no graphics and no gimmicks. Very short, clear, discrete problems that can be solved using any language.

If you really need shooting, explosions and fancy graphics to keep you motivated then I don't think programming as a career is for you. Most programming jobs aren't going to give you much of that. And frankly, I think all the wizz-bang graphics just interferes with your learning and getting good at visualizing in your own head what the code is doing.

5 comments

The problem with Euler is it is very heavy on math. Math and programming aren't the same things. (although certain programming paths do rely heavily on math)

Its better to do something. ANYTHING. Euler? Hackerrank.com (or other similar websites? exercism.io? "Crack the Coding Interview" (or any other similar book)? codereview.stackexchange.com? codegolf.se?

Or any of the other dozens of ideas here http://programmers.stackexchange.com/a/764/2536

The key is DOING. Repetition. Solving problems and overcoming obstacles. Repeatedly. Till you get better. Then do it again. Repeat yourself.

Did I mention repetition? repeatedly?

How do you learn to piano? Guitar? fix cars? Years and years of practice. Programming is no different.

> The key is DOING.

Yes, especially doing things that are useful to you. This can be something very small. Many years ago, I needed to list filenames in a folder. (I had no idea of the command line). I knew some basic Python and I figured out how to do this.

Or I wrote a flashcard quiz test game to prepare for my history test in school (Javascript and HTML).

Or I wrote a small program to find rar or zip files on my computer that have also been extracted and now take up approx. double the space on the disk (the extracted version and the archive are both there).

Or some animations in Javascript to understand things we learned in physics class (harmonic oscillation and similar things). Small projects like that.

Or a program with GUI where I plotted some function we learned in math class about, with sliders to control some parameters of the function and see how the plot changes instantly.

I liked it so much that I enrolled in university to study computer science and I really liked the uni courses too, because I already understood how programming things is helpful in everyday life, it wasn't a dry abstract thing that you build for its own sake.

"Yes, especially doing things that are useful to you."

I'd also expand that to say things that lead you in the direction you want to go.

Game development? Healthcare software? Big business? Small business? Big Data and report writing? Database management?

Once you get past the basics there is a plethora of tools and sites... its important to try and veer towards something that meets those goals.

Euler and Math is good - math crosses all boundaries. But Fibonacci isn't as important to UI or Game programming (depending on the game types, of course)

I like how Project Euler is perceived very differently by people of varying backgrounds: programmers always say it's heavy on math, math folks tend to say it's mostly about programming!
Well, I see a lot of problems that are made trivial when you understand certain parts of math.

You can definitely "brute force" a portion of the problems... but some problems just get simple when you can see certain math parts.

I honestly wouldn't say its more math or programming - it's deeply both. More as you get past the first few problems.

My point was more that there are, these days, a good collection of more directed practice tools that don't rely on knowing or learning math.

HackerRank for example is one that has many languages and many problems that don't rely on "math". I like it and it's ilk because you can learn/practice basics without having to know the Pythagoras theorem or Fibonacci's sequence.

I think Euler has a special place in these kinds of conversations because it's one of the leading sites that did this kind of thing. That's why people are always like "Oh, you want Euler". It's what programmers immediately think of with these kinds of questions.

Project Euler (IMO) depends too much on math skills that many novice programmers (and experienced ones) lack. http://www.hacker.org is one that I introduced to a few friends that got more positive results with them. And I also encourage people to go to https://www.rosettacode.org and try their hand at adding solutions for the languages they're interested in.
For me it was PythonChallenge.com

It's not as math heavy and quite engaging.

> If you really need shooting, explosions and fancy graphics to keep you motivated then I don't think programming as a career is for you.

It can come later. For example when I started out programming, I first build websites and then found out that Javascript exists and without having the slightest idea what I was doing, I built things based on examples, like animations etc. It gave me a foundation and interest in programming other stuff, like generating things for modding games in Python, deciphering the format where games store strings and writing a program to translate them to my native language and similar hobby projects.

If you have your own goal and interest in it, it's much much easier to reach an advanced level than by learning in a linear fashion with boring artificial tasks.

Later on I took proper university courses as well, but I think it helped me a lot in staying motivated that I already associated programming with fun because of the prior experience of playing around (without too much understanding).

Except the Project Euler problems are mostly pretty boring, if you're not excited by math. I've worked through it a little bit, and it reminds me a lot of Math Team competitions in high school: the problems are a cinch if you know the formula or the rule that applies, otherwise it's a tedious slog.
My buddy runs a project Euler meetup based in Chicago for anyone who is interested. The attendees range from beginning programmers to math PhD's on a regular basis.

https://www.meetup.com/Project-Euler-Sprint/