3 ms·
Python 3. 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 ec
by DanielStraight 11y ago
Python 3.
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/ 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.
- reesdreesd 11y agoThank you for the detailed reply! A number of comments here favor Python for ease of entry and utility. Do I understand correctly that Java is important, but with a much steeper learning curve?
- DanielStraight 11y agoJava is widespread. Whether it's important or not depends on the project. It's not so much that Java has a steep learning curve, it's that Java has the Java way of doing things (namely, object-oriented programming taken to the extreme) and you are required to do things that way. It's less flexible than Python in the way you can write your code. You have to have a firm grasp of object-oriented programming to do anything in Java. There's a lot of theory you have to learn just to get started, which in Python can just be brushed aside until you're ready to tackle it. 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).
- gamechangr 11y agoYeah, that is right (though some will have a hard time agreeing because your definition isn't very conclusive/complete) 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.