8 ms·
How to Pick a Language
- gsmaverick 18y agoPHP?
- kaens 18y agoPick PHP if you're very concerned with being able to find a quick, cheap online host for your web-app and you don't want to bother with learning another language (or with learning how to deploy web-apps in other languages, which really isn't very hard).
- GeoJawDguJin 18y agoYou don't really learn PHP so much as catch it. Like a disease.
- thomasmallen 18y agoPick PHP if you want to use Wordpress, phpBB, Drupal, and a wealth of other great open-source web apps. P.S. Final post; great community here!
- kirubakaran 18y agoWhat do you mean final post???
- jon_dahl 18y agoI think he doesn't like all the upvotes for the snarky anti-PHP comment: You don't really learn PHP so much as catch it. Like a disease. At the risk of being modded down, the comment has some merit. PHP programmers usually gravitate to PHP without having much experience with related, but supposedly better, languages like Ruby, Python, Lua, etc. But PHP programmers who really dig into programming often leave for other languages. The Ruby and Python communities are full of ex-PHPers. But how many people from the Python or Ruby communities leave for PHP? This isn't to say that PHP has no merit. It was my first web programming language. But maybe its merits don't stack up well against other languages, which is the subject of the original article.
- thomasmallen 18y agoI know I signed that as my final post, but I feel the need to assure you that I wouldn't be offended by something so silly. Sometimes you just get bored with a place and feel like moving on :^) I think I'll spend less time on sites like these and more playing this fine Buffet clarinet I picked up on Saturday. It's been a while, but my embouchure's returning already.
- jon_dahl 18y agoMy misunderstanding. Enjoy the clarinet!
- jballanc 18y agoIn fairness, why not just learn Perl? Then go back to PHP if it fits the problem space...
- bprater 18y agoAgreed, Perl is much more of a real, complete language. If you know Perl, you can pick up PHP basics in an hour.
- deleted 18y ago[deleted]
- jimbokun 18y agoI don't know PHP, so didn't comment on it. Would it get its own category, or fit into one of the ones I gave?
- Nwallins 18y agoThe "scripting" category with Perl, Python, and Ruby.
- maxwell 18y agoI'd put PHP in a category with JavaScript, since they resemble p/py/r but were designed for web programming rather than scripting.
- catch23 18y agoI guess that sort of works... but php is still serverside. Anyone doing web dev must learn javascript, but not necessarily php. Javascript would probably be competing with actionscript or any other client-side plugin stuff.
- russell 18y agoProbably a new category, templating languages, along with things like jsp, struts, etc. Python, Ruby, Perl are really general purpose languages.
- kaens 18y agoPhp is, in my opinion, a "templating" language (yes, I know it's not just a templating language). Closer to "scripting" than the other categories.
- acangiano 18y agoIt's opinionated, but this article serves as a good FAQ for people who might be asking what language should they learn.
- gaius 18y agoWell, no because there is one factor that dwarfs all others: what are my friends or the people in my field using? If everyone you know (personally or professionally) is using language X then there will be collective experience you can tap, documentation, mailing lists and howtos, lots of code already written, etc. It doesn't matter if you have a "better" language if there's no-one you can talk to or whose code you can reuse. Remember, a programming language is not a technology. It's a community. Choose the community you want to join, then use what they use.
- axod 18y ago"Remember, a programming language is not a technology. It's a community. Choose the community you want to join, then use what they use." I can't disagree with this enough. Why do you need to talk to people? Why do you need to reuse other peoples code? Perhaps for some people, the community matters, but I don't think that's common. Obviously you need to have decent language documentation, but that's not a community, it's just the specs.
- brianr 18y agoWhy do you need to reuse other peoples code? So I guess you like implementing all your libraries yourself?
- axod 18y agoLibraries are separate from community IMO, Sure, if there's a well made library out there that does exactly what I need I'll use it, but it's not the main factor.
- gaius 18y agoMaybe you are at the point now that you can implement any application in any language without ever running into problems, writing every library routine you ever need from scratch, porting the compiler/runtime to a new platform if you need to, and you also have complete mastery over your application area, say aeronautical engineering or bioinformatics, able to solve any problem in code without ever speaking to another living soul. If so, my hat is off to you my friend. But that's not me, after 15 years as a professional and two degrees, and I'll wager that's not anyone else reading this either. In my experience, the community around a language trumps all other factors for getting stuff done.
- jballanc 18y agoNice and thorough. I only have two qualms: 1. Reading through the Matz book on Ruby (http://oreilly.com/catalog/9780596516178/index.html http://oreilly.com/catalog/9780596516178/index.html), there's a very good explanation as to why Ruby/Python/Perl are "scripting" languages as opposed to "programming" languages: no main! That is, whichever file is fed to the interpreter is run (with some exceptions) in order. So these are, and probably always will be, scripting languages. 2. The author vastly underestimates the importance of Javascript...
- jimbokun 18y agoInteresting way to define "scripting" languages. I didn't mean to underestimate JavaScript, which is why I gave it its own section. Perhaps I was too brief? Implication that its only useful in the browser?
- alecco 18y agoLove it or hate it, Javascript: * Is the language having the most important performance gains lately. * Growing support from both corporate (Yahoo, Apple, Google) and free software (Mozilla) camps. * Gains market with HTML 5 (just the canvas element alone makes a huge difference for JS based software.) * Better frameworks for both UI and client-server software. It's funny how things turn.
- catch23 18y agoYeah, it's strange how only 2 years ago or so, both ruby and javascript scored rock bottom on Alioth Shootout, with javascript scoring 4 times slower than ruby, and ruby 3 times slower than python. Two years later and there's 7 interpreters for ruby and 4 for javascript.
- silentbicycle 18y agoThere's something to be said for trying to make an expressive language and worrying about how to make it efficient later. Only working with stuff you know you can do efficiently can lead to getting stuck in local maxima.
- twopoint718 18y agoI get the "what language should I learn" question pretty often. I think I'll point the asker to this article. Thanks for a very broad and easy-to-digest overview.
- kleevr 18y agoMaybe this should be a separate 'Ask HN', but... Previously over the last 6 years I've coded in PERL, PHP, JAVA, and C#. I'm currently 'retraining' myself over to Python for scripting and web programming (django). I plan to stick with Java and C# for the time (our shop is about 50/50 split over SOA boundaries). And I want to keep fresh in these as my bread winner languages until I get out on my own. (Not to mention with the advent of Jython/IronPython, and Clojure it might not be bad to really dig some heels into the JVM/CLR idea.) BUT, after I finishing working through AIAMA in Python. I want to get to work on picking up a lisp dialect and work through SICP. So I was curious, what would be a better angle of attack: Scheme, CL, or Clojure. I'm drawn to the idea of Scheme as it's been painted as a simple language to explore 'deep CS' concepts. But, Clojure sticks with the JVM/CLR strategry. Would I be missing out if I didn't start with CL? (it sounds like the Latin of programming languages) Are Lisp dialects (at least those mentioned above) more similar than different; or, How difficult is it to switch dialects? Is Clojure specifically a bad choice for working through SICP?
- GeoJawDguJin 18y agoClojure is what you'll want to be using if you ever start doing "real programming" in a useful, expressive Lisp. Don't start with it, though. In the following order: 1) Learn Scheme and get through SICP. Wind up with enough of an appreciation of Scheme that you could write real programs in it, given enough patience. 2) Attempt to learn Common Lisp. 3) Become frustrated and give up on Common Lisp. 4) Learn Clojure instead, and become overjoyed at the real work you can get done. I'm mostly joking about steps 2 and 3. They're based on my own experience with CL (and Elisp) and might not apply to you. Going from Scheme to Clojure will be a bit of a shock, though, because the former is absolutely as sparse as possible with lexical punctuation, and the latter is totally littered with it (particularly stuff that's borrowed from Perl and Ruby). If you've written enough Perl, though, you might not care. By the way: Scheme is Latin, and CL is Ancient Greek. ;)
- akkartik 18y agoPick ruby if: you want to program on the web. I prefer python as a language, but rails has two things no other web-framework has, IMHO - A culture of TDD (http://news.ycombinator.com/item?id=445627 http://news.ycombinator.com/item?id=445627), and the easiest way to do simple AJAX out of the box with rjs (http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html http://api.rubyonrails.org/classes/ActionView/Helpers/Protot...) Just not worrying about string escaping is huge.
- mshafrir 18y agoThe first link points to a comment about being productive while riding Caltrain...
- akkartik 18y agoHmm, I should just restate my point rather than try to repurpose it from elsewhere. TDD has enabled me to work in far smaller chunks than before. The ripples of this one fact are transformational, and so I place more emphasis on unit-test support than most aspects of a language/tool. http://www.reddit.com/r/programming/comments/6sktz/a/c04r6i5 http://www.reddit.com/r/programming/comments/6sktz/a/c04r6i5 There.
- anamax 18y agoIsn't that what Train Driven Development means?
- time_management 18y agoML deserves mention here. It's not quite a functional strait-jacket, and was a source of many Haskell ideas, e.g. pattern matching. Oddly enough, I tend to think of Ocaml as a "functional C". You can do low-level imperative stuff with it, if you wish, but you usually end up abstracting the unimportant details out and going functional quickly.
- niels 18y agoML was the first language I ever learned. I didn't appreciate how cool it was back then though. The pattern matching concept makes for some really elegant code. It replaces a lot of control structure code.
- tremendo 18y agoA well reasoned and presented series of arguments in pro (mostly) of many language options. However it is a bit confusing to me who the intended audience is. The decision criteria--choose this language if...--seem a little beyond what a novice or would-be programmer can answer with certainty ("Pick Perl if: ...your mind fits the mind of Perl."). For someone looking to expand his/her programming repertoire, perhaps a goal-oriented approach would also be useful? (systems, Web, mobile, desktop programming, etc.) And a seasoned hacker probably won't be in need of this help. I enjoyed reading it, but then, I'm not at the moment trying to decide what language to pick.
- zmimon 18y agoA pretty nice survey and well balanced post - nice! My only gripe - it missed out on my favorite - Groovy - which is my favorite because it combines the best features of most of the others.
- gaius 18y agoThere's some enthusiasm for Groovy here, tho' we've not (yet) done any production work with it. I guess my main fear is that it's a dead-end like Cold Fusion, I don't feel it really has a critical mass behind it. What sort of work are people doing with it?
- zmimon 18y agoThere's a lot happening with it ... I think it's main advantage is that it completely seamlessly integrates with java and inherits it's basic syntax from there, so anyone familiar with java or with existing stuff in java (and that's a lot of people) can get a flying start. Groovy on Grails is where the main action is - it's basically a rails clone, but built on a standard java stack so if you need it you can always peel back the covers and access it. I too initially thought of it as a dead end - why choose a language that only runs on the JVM when you can choose a language that runs natively as well? But once I started using it I really liked it, and the integration with java is really superb (much more seamless than Jython, JRuby etc.). So it kind of stuck. (I use Django as well, but not as much).
- henning 18y agoHere's an alternative set of instructions for comparison: 1. Write down all the garbage-collected languages you've heard of (from Java to Erlang to whatever) on index cards, one language a card 2. Pin all of them up on a nearby wall 3. Throw a few darts at the cards blindfolded and look at what languages the darts landed on or near 4. Pick one of those and write assloads of maintainable, bug-free code in it.
- l0stman 18y agoHow about Smalltalk?
- bayareaguy 18y agoPick Arc if: You want a 100 year language and you’re willing to wait that long. I know it was a cheap shot but I couldn't help but laugh when I got to that point in the article. The relative lack of activity on http://arclanguage.org/forum http://arclanguage.org/forum makes me think the best reason to choose Arc at this point is to run news.arc.
- giles_bowkett 18y agoI'm doing a presentation today where I say that Arc is a failure and I always feel guilty about that. But the thing is, I think the real reason for the fail is in the book "Art and Fear." If you focus on quality, you end up with inferior quality compared to people who focus on quantity. You have a much better chance of creating a 100-year language if you create a 100 languages in a year. Remember, Lisp is at least a 50-year language, and Lisp was originally created as a joke or a teaching example or something. The great bearded wonder, the one that Lisp guys make shirts of, Schultz or McCarthy or whatever his name was, only wrote up the spec to make a point, some kind of math thing iirc, and somebody egged him on and they ended up implementing it. But it wasn't that he just had this magic ability to build a great language. He made a thousand other snarky points in his life, and this one just happened to be so well phrased, mathematically, that it trumps all other languages, in the opinion of many people. That's not a one-time stroke of luck in the language design department; it's the results of decades honing his craft as a master of snark.
- zupatol 18y agoIf you focus on quality, you end up with inferior quality compared to people who focus on quantity That sounds a bit simple. What about that other great bearded wonder, Leonardo? He only made about 30 paintings. http://en.wikipedia.org/wiki/List_of_paintings_by_Leonardo_da_Vinci http://en.wikipedia.org/wiki/List_of_paintings_by_Leonardo_d...
- orionlogic 18y agoi wonder why no one mentions Processing as a learning programming language. Its fun and quite capable of doing interesting things. more info at http://processing.org http://processing.org
- robotron 18y agoProcessing (and Wiring) have a pretty specific purpose which extends beyond the focus of the article. Plus it's essentially Javascript.
- twopoint718 18y agoMaybe another good "Ask HN" topic would be: "How would I 'bridge the gap' from programming computers to programming other physical devices?" Wiring certainly looks like a cool language that goes in that direction.
- miked 18y ago>> It is a functional straightjacket like Haskell and Erlang (no side-effects), appealing to functional programmers. Not so. Clojure has three different mechanisms for judicious use of side-effects, including Software Transactional Memory. But yes, side-effects must be quite explicit.
- zenocon 18y agoThe article is pretty light. I don't think it necessarily does any harm, but I think the article kind of misses the mark if you are someone that is really faced with this issue. I would argue that picking the language also depends very much on the domain/platform/target you are writing software for. Is it a web application? Is it a desktop GUI app? Is it an RIA -- for web or desktop? Is it a scientific application that needs great math libraries? What are the performance characteristics? Does it need cross-platform support? Is it a distributed business enterprise system? Is it an embedded system? Is it a library? Do you want the library to be able to be used by many different platforms and languages? Does it have to integrate with other systems and what languages are those written in? What about 5 years down the road -- how do you think it will evolve? Most likely -- answering the question on what the domain/platform/target will be will trim you to a very short-list of options. For example, if you are programming for an embedded system, you may have to use C because that's the only language you'll find compiler support for. Maybe there will be a C++ compiler -- but whether or not you choose it can depend on a lot of factors such as whether your team is comfortable with C++/OO...whether you even want to utilize OO...whether you can afford the additional memory/complexity associated with the features of C++...etc.
- nihilocrat 18y agoHate to be another person to chime in with "What about language X?", but I feel Lua fits decently well in the Javascript category. I would say these are true "scripting" languages, because they are intentionally built for scripting the behavior of an application, and they both have very minimal implementations that support the prototype model for objects.
- sireat 18y agoFun and relatively comprehensive list, but where is Prolog? Admittedly it is not often practical, but when it is, it make some problem-domains so much easier to grasp.
- scott_s 18y agoHave you ever used Prolog for a practical problem? (This is a sincere question.)