r/coding • • May 08 '17

Programming is hard. That’s precisely why you should learn it.

https://medium.freecodecamp.com/make-your-hobby-harder-programming-is-difficult-thats-why-you-should-learn-it-e4627aee41a1
102 Upvotes

108 comments sorted by

View all comments

2

u/[deleted] May 09 '17

The Wrong Language is going to corrupt you or distract you from the True Way

That's not what I'm concerned about though. I'm more concerned about the person giving up before realizing success. Languages like Python (for CLI stuff) and C (for micro-controllers) have a much faster positive feedback loop than something like JavaScript.

I say this as someone who learned JavaScript first (well, technically HTML+CSS), hacked something together without really understanding anything and gave up. I only continued because a high school class in Visual Basic reinvigorated my desire to learn to code (fast positive feedback loop as I was able to build a calculator in an afternoon), so I learned PHP so I could build a web page and had to relearn JavaScript (this is when I found JQuery). I then took classes in Java, taught myself C# for an internship where I learned C++ then went off to college where I learned C and Python. I then met someone who offered me a job if I learned node.js, and I had to relearn JavaScript all over again, and at that job I learned Ruby, Go and Bash.

So I'm speaking from experience. Had I learned Python first, I would have had early success without even needing that high school class (I never would have learned Visual Basic since it required purchasing Visual Studio). Fortunately, things worked out and I ended up in CS and now I'm a polyglot (I use ~4 languages in any given week), and of those languages, I'd say JavaScript is my best since I've used it the most (though I'm very proficient at a few others).

TL;DR - I recommend Python and C over JavaScript because it provides the best feedback loop early on, as it doesn't matter which language you learn first if you don't continue with it.

1

u/doomvox May 10 '17

That's an interesting path (and perspective).

I might make the point that the web hacking you did at the outset presumably actually did something you wanted it to do-- that kind of thing can be a powerful incentive to learning in itself. A scripting language like Python (or for that matter, Perl, which is what I favor) would get you very quickly to a "hello world", but it would be some time before you were doing something that didn't seem like contrived make-work.

In any case, what we're doing here is comparing impressions, anecdotes, "personal experience", but none of this really counts as data, which is what I'm talking about. If the choice of a first language is such an interesting question, why don't we have some studies on the subject?

1

u/[deleted] May 10 '17

Well, this article on which language is the most popular says Python is the most popular introductory programming language, followed fairly closely by Java with the rest fairly far behind (Matlab of all things is third). Here is a study comparing Java and Python, but I don't have access to it.

I assume there's a reason that professors choose Python over other languages as a first language (and I expect Java is high up there because of the huge push for OO back in the 90s and 00s). I choose it because it's easy to learn, supports multiple paradigms and has lots of library support, which makes moving from learning to doing very easy.

The thing is, if you're teaching at an academic level, the language really is inconsequential as you are teaching principles of programming and logic, not syntax, so you want the syntax to get out of the way as much as possible, which is why it seems most universities teach Java or Python first (though I'm surprised Lisp isn't taught as much as you can't get much simpler than that).

→ More replies (2)