Ask HN: If I learn one programming language, what should it be?
I want to dedicate a few months to learning a programming language (part time) in order to achieve the following two goals:
1) Be better prepared, as a founder, to understand engineers. 2) Add a "hard" skill I can use to earn money on the side (e.g., while bootstrapping).
To clarify, I'm not a founder yet, but that may change soon. I have very basic knowledge of programming: a semester of C++ (15 years ago) and some dabbling in AppleScript, shell scripts, and html/php/css.
Of course, I realize that I won't master anything with only a few months of study. Nevertheless, I'd like to do what I can to improve my chops in the time I have.
If you were in my shoes, what language would you invest in? Can you recommend any resources to help me learn it (e.g., books, online resources)?
I'd really appreciate advice from the HN community.
47 comments
[ 3.5 ms ] story [ 106 ms ] threadI've heard people say good things about this book:
http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor...
But I've never read it myself.
JavaScript really is the way to go to get your feet wet just because it'll give you the experience to build a wide range of platforms such as: Mobile (Cordova, Appcelerator, React Native), Desktop (AngularJS, RequireJS, Dojo, jQuery, Vanilla JavaScript/ECMAScript 6), and Server Side (NodeJS - basically you don't need to learn a front end and back end language).
But still, you should definitely learn one of the more traditional languages at some point in time, especially if you're doing this for a living.
And I would recommend just figuring out something you want to build and just build it. Focus on building and everything will start coming together. You should definitely study, but studying alone will not get you anywhere unless you apply it. And if you're planning on doing this for a living, nothing beats being able to show potential employers your previous projects.
As for your plan, that's definitely enough time. You will definitely get somewhere with it!
It has a HUGE amount of libraries available and the standard library (SE and EE) cover a lot of ground.
It is fairly simple to learn. It is cross-platform. It is suitable for server-side programming. It has an extensive standard library and an active ecosystem for additional libraries. It has IPython. It uses, and therefore helps you learn, but does not force object-oriented programming. It has enough functional programming to let you explore that concept. It is widespread and easy to find support for. It has numerous tutorials taking a wide variety of approaches, you can easily find something that works for you. It has more active projects on GitHub than any language but JavaScript or Java (http://githut.info/).
Why not Python 2? Python 3 is better out of the box (comes with pip, has better standard libraries) and more consistent. As a new programmer, you won't need anything that's limited to Python 2.
Why not JavaScript? It's too strange. Most of what you learn in Python is fairly applicable across languages. JavaScript has a strange object model, doesn't distinguish int/float, has odd rules for scoping (var/no var, hoisting), has too many ways to do the same things (function / var f = function, new Object() / {} / Object.create), has a confusing concept of 'this'. Learning JavaScript will not help other mainstream languages click the way Python will.
Why not Ruby? Ruby and Python are, from a new programmers' perspective, completely equivalent, but Python seems to be winning the popularity contest, so you'll likely find more libraries, more tutorials, more help, etc. Ruby also tends to be more web-focused and thus less general-purpose (by the numbers, not by any technical limitation).
Why not C/C++? They are simply too low level for someone who isn't interested in programming full-time.
Why not Java? Java is improving but is historically bloated and incredibly verbose. You have deal with compilation and probably need an IDE. You absolutely must use object-oriented programming. Support for functional programming is either effectively non-existent or simply not as smooth depending on which version of Java you're using. Too much overhead (in terms of what you have to understand and deal with) for small, simple programs.
Why not Go or Rust? Too new to have thorough support. Uncertain future.
Why not Haskell / Clojure / Erlang / Factor / etc / etc / etc? Too esoteric for a new programmer.
Why not Objective-C or Swift? Too limited in scope.
Why not C#? Actually, if you're on Windows, this is a pretty good choice, but it's not fully cross-platform (yet) and doesn't have the variety of choices for server-side programming that Python does. It also doesn't have as extensive a set of open source libraries.
Do I understand correctly that Java is important, but with a much steeper learning curve?
And with Java, you're probably going to need a heavyweight IDE instead of just being able to use a plain text editor or a REPL or other interactive environment (which Java doesn't have).
Job wise: if you only had one language (and did not have history as a programmer) I think it would be easiest to find employment using Javascript. The need is huge and growing all the time.
Python or Ruby are pretty easy to learn and can be used for a number of different ways.
If you had plenty of time (read money) then Java would be the best choice. Java easily has ten times the amount of jobs available, so you can imply that it's more useful if you want to accept that metric.
At best, stopping at your first language will give you a false sense of competence that will lead you into making poor decisions.
By all means, learn a first programming language. But, which you choose doesn't much matter, because you'll need to learn a second and a third before you start to understand what it's all about.
If you can work with frameworks, write loops, classes, know inheritance, side-effects, polymorphism etc but don't know functional programming, then you're still a programmer in my eyes.
It's a scale imo, everything is relative.
Knowing how to use a hammer doesn't make you an engineer. Knowing calculus doesn't make you a mathematician. Knowing how to make a fist doesn't mean you know karate. Knowing C doesn't make you a programmer. Instead, to be any of these things in any meaningful way, you need mastery of a whole constellation of related tools and techniques and ways of thinking, as well as the practice and experience to make them work together.
You can do a lot of things with a hammer, just as you can do a lot of things with any given programming language -- both are very useful general-purpose tools. A programmer should understand the hammers of the programming world (C), the flathead screwdrivers of the programming world (python), the phillips head screwdrivers of the programming world (SQL), the power jigsaws of the programming world (prolog), the needlenose vice-grips of the programming world (awk), and even some of the nylon jeweler's mallets of the programming world (erlang, haskell, befunge) in the same way that you would expect even a relatively mediocre mechanic to recognize and understand the use of all these tools.
A language is a single tool. Concepts are concepts, and you can apply concepts with inappropriate tools just fine (you can write object-oriented code in c or functional code in java the same way you can remove a bolt with vice grips or hammer in a nail with the handle of a chainsaw).
The problem with Python - and non-statically-typed languages in general - is that function signatures don't need to be defined upfront, which leaves it up to the programmer to figure out the inner workings of the functions. This is a huge pain point when working with other people's code.
Python 3 introduced function annotations, which is great. But again, the problem here is that function annotations are opt-in. It's still up to the developer to add the annotations.
I know I'm going to get some crap for this, but for big prod systems I prefer C++.
If web, you might go after JavaScript and some back end language (you already have some PHP background), plus HTML and CSS. Build a simple Web site.
If mobile, pick your poison. Many mobile startups start with iOS. Now is a great time to learn iOS since Swift lowers the barrier to entry significantly. If you're going after the larger Android ecosystem, then Java. Android also has the advantage that you can develop on other OS'es like Windows.
I would also recommend getting a great book and working though the examples. Then supplement with what you can find on the Web.
Good luck learning and with your startup!
Java is a strongly-typed "classical" object-oriented language with C-like syntax. These characteristics make it an ideal foundation upon which to build your knowledge of programming.
Many of the newer and more popular languages deviate from the "classical" way of doing things. For example, many are loosely typed. Some use a simpler syntax without semicolons or curly braces. Others have a non-traditional OO model, or a hybrid OO / functional model.
You will likely encounter problems if you skip over the "classical" style languages and head straight for something like Ruby or JavaScript. For example, when you start to get into the more advanced parts of JavaScript, all of the books and tutorials explain things by contrasting with Java or C#. Therefore, if you don't have that classical knowledge, the comparisons will be meaningless.
If you start with a loosely typed language, you won't understand why your JavaScript developers are debating using TypeScript, or why your Ruby devs are debating switching to Java or Scala to build the app to scale. If you start with Ruby or Python you will never be comfortable with languages that use curly braces and semicolons.
I started out by learning PHP. It was a mistake. If I could go back in time I would have learned Java first. When I started to learn object-oriented programming it was tough because I had to unlearn the procedural way of thinking which was very common amongst PHP developers at the time. When I wanted to learn Android development I was confused by the use of types in method signatures. I had to go and learn Java-101 before I could do anything more than write a layout file.
I hope this helps...
Inch by inch...
I'd recommend Python or Javascript without knowing more.
Python is useful in a variety of applications, both web and desktop, multi-platform, low barrier to entry but will get you a long way.
Javascript can be all you need on the web (though my stacks all have another language involved).
Python is great for the web as well, but you'll need javascript, too. It's pretty inescapable.
Be careful, you may start to suffer from the Dunning-Kruger effect[0]. You would only begin to understand what engineers are doing after a substantial experience with programming real world applications. However, your limited experience may make you over-confident in your abilities.
[0]: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
You've probably got more honed skills to contribute actively, and you won't have opportunity to make especially useful contributions programming in anything that's widespread. So you can dable in something popular to be able to read it better, explore something esoteric to have something novel in your toolkit, or just pursue something that's personally practical like the systems scripting and web stuff you've already been toying with.
Don't overthink it. Just find the one that gets you excited and spend whatever time on it you'd like.
Is you can have 2 langs then pick lisp.