14 ms·
The Best Programming Language (or How to Stop Worrying and Love the Code)
- amirmc 13y agoFor OCaml, there are many more companies using it than just JaneStreet. Facebook and Bloomberg being some of the well known ones. http://ocaml.org/learn/companies.html http://ocaml.org/learn/companies.html
- rwmj 13y agoRed Hat .. somewhat kicking and screaming, but we've shipped the OCaml compiler, libraries and programs written in OCaml since RHEL 6 (note that Red Hat does not support the OCaml compiler, although there are customers that use it). Edit: The chances are if you used a program that started with virt- on any Linux distro, then 50/50 OCaml was involved in the making of that program. It was either written in OCaml or used OCaml to generate large amounts of C boilerplate. OCaml binaries look a lot like C binaries, so it's hard to tell from the binary. And it turns out that functional languages with pattern matching on data are extremely good for generating all that C boilerplate, like crap you need to write for FFIs or dealing with remote parameter marshalling.
- pjmlp 13y agoIncluding Microsoft, which many aren't aware of.
- amirmc 13y agoThey're also a member of the OCaml Consortium, too http://ocaml.org/community/support.html#TheCamlConsortiumatInria http://ocaml.org/community/support.html#TheCamlConsortiumatI...
- bromagosa 13y ago«The first true object-oriented language. But it seems to me Smalltalk is pretty much a forgotten language.» Why do so many people kill Smalltalk so fast? I could give so many URLs to illustrate how Smalltalk has a stable and growing community, with so many open projects and people making a living out of it, teaching it in universities and using it for research, but I think these two links sum it all up: http://forum.world.st/ http://forum.world.st/ http://smalltalkjobs.wordpress.com/ http://smalltalkjobs.wordpress.com/
- girvo 13y agoFrom my research, it's growing too, which I find awesome. I'm a fan of Pharo and Seaside :)
- overgard 13y ago> Why do so many people kill Smalltalk so fast? Because it doesn't have curly braces. Entirely unfair, but it seems like if you want to sneak in an innovative language it needs to be a wolf in sheep's clothes. (IE: it need to vaguely resemble C)
- Kurtz79 13y agoI could make an argument for the exact opposite. If a new language has curly braces is instantly reviled and deemed as "not innovative" by part of the community.
- AnimalMuppet 13y agoI think both are true, because "the community" is not one thing. It's a bunch of people, each with their own viewpoint. And a bunch of people have strongly-held views (in both directions) on curly braces.
- mcv 13y agoThat's one of the big reasons why javascript is so horrible. It is a really nice and innovative language, but it had to be dressed up to resemble C (or Java really).
- Dewie 13y agoSince curly braces are a pain for me to write (on my keyboard), I strongly embrace languages who don't make them part of the important syntax.
- blobfish 13y agoWouldn't it be better to buy a new keyboard and expand the range of languages you can type in comfortably?
- greenonion 13y agoRegarding the Go vs. D argument and Google beeing behind Go, Facebook seems to be using D http://www.drdobbs.com/mobile/facebook-adopts-d-language/240162694 http://www.drdobbs.com/mobile/facebook-adopts-d-language/240...
- dagw 13y agoIt seems that every week I seen a new "Facebook is using XYZ" article. Is there a language Facebook isn't using at this point?
- rizalp 13y agoAssembly Probably?
- voidlogic 13y agoSure, but that doesn't mean both organization are equally committed to each language. Google has an entire team that works on Go full time and all their work is donated to golang.org which is opensource. Its not clear that Facebook is more than just a D user at this point. I also have a seeking suspicion that Facebook never considered using Go because of Go's close Google ties, maybe if they didn't feel Google was a competitor they would have went with Go over D- we will never know.
- axaxs 13y agoAs I understand it, they didn't 'go with D over Go' so to speak. They employ a fanatic of the language who wrote a piece in D, presumably with approval, and used it. There's nothing wrong with any of that, and I hope it works well for them. But I wouldn't say it was exactly chosen in advance for its merits, other than having an awesome programmer in the language, which can be one of the biggest reasons at times.
- klibertp 13y ago> First of all, a disclaimer: unless you’ve developed in 30+ languages, and suffered the code of others in all (or most) of them, you can’t really be objective. So yes, I’m biased. Like most of the people writing about this topic. Actually, I believe that this topic becomes absurd as soon as you are well-versed in many languages. I fully agree with this sentiment and I wish more people either already had 30+ languages experience or at least realized that most of what they say now will sound stupid to them once they got this experience.
- V-2 13y agoI love how F# is among the "unreasonable languages". Why? Because it's "Microsoft trying to be cool", "many of us have learned to keep away from Microsoft the hard way" and "we have enough company-sponsored languages already". That's it.
- V-2 13y agoBased on the code snippet, I'm not surprised he thinks C# is "verbose" with "lots of boilerplate" and "resembles Java", because the snippet is written as if it WAS Java, or at least written 10 years ago. Compare his GetFrequencies implementation with idiomatic, LINQ version: http://pastie.org/8834650 http://pastie.org/8834650
- ansimionescu 13y agoThis. I am as anti-Microsoft as the next guy, but C# is one of the few "insanely great" things they have. edit: I'm not just blowing hot air, I've actually wrote C# code that went into production.
- bananas 13y agoI'm someone who has put lots of C# into production and whilst you're right, caution has to be used when using LINQ. There are several humungous hand grenades that will go off in production unless you really 100% understand how it works (memory ballooning, infinite sequences, total misunderstanding of log complexity, leaky abstractions and difficulty of debugging).
- hvidgaard 13y agoLINQ is a tool, and a great one. But just as you need to understand malloc when writing C, you need to understand the basics of LINQ to use it in production. The main problems I've come across are all failure to understand delayed evaluation. Maybe I'm not using it in a complex way, but as soon as it start to feel too complex, LINQ is not the way to go. I agree that it can be difficult to debug - that's why it should be kept simple. Personally, I love that LINQ enables me to think of my data in terms of sets and operations on them, rather how to execute the operations on the data.
- V-2 13y agoIt should be used with caution and not abused, you're right of course. But when I use LINQ's GroupBy, SelectMany etc. I know they've been tested millions of times before. The same cannot be said about somebody's "hand-made" algorithm, accomplishing the same result with foreach loops, breaks etc. like you would in good ol' Java. So it's not just a matter of being imperative, long-winded or ugly. You can also break LINQ expressions down into a series of simplier ones: deferred evaluation is a bliss here! Or - thanks to the way it works, extension methods, anonymous methods etc. - simplify it by creating your own LINQ-like functionality, such as - say - Batch (not part of the standard Linq library)
- stinos 13y agoSome nice angles in the article, but now I feel obliged to defend C++ (and actually C# and F# too, but I'll let that to others as I'm sure it will turn up in the HN comments) since the author seems to make no real points to support his view of it as a monster. First of all, it's not because x [1] and y and a bunch of others say that "a == true", you can safely use it as a fact or a way to support your view (those logical fallacies are called Bandwagon Fallacy/Appeal to Authority). Second: I don't know where those code samples come from, but that is not exactly how you write good C++, as it is called in the paragraph. And a paragraph lower there is mention of the dreaded C/C++ - a thing that does not exist, never has, and never will. Some might say that adds to the author's points (as in, it's so hard he doesn't know how to write it properly), but you might as well say: sorry, but if you don't know how to write it properly then you do not really have the bagage needed to start criticizing it let alone calling it a monster. [1] esecially when x is called Linus and he's in one of his rage moments where every single being that does not think alike is violently insulted and reduced to the dirt of the earth, with or without arguments making sense :]
- GhotiFish 13y agoWell isn't that a cute dilemma. You're either an idiot, which means you won't understand it and shouldn't criticize, or you're not an idiot and your lack of understanding is an effective criticism. Reminds me of Haskell. Personally, I'm of the view that the planet is populated by humans, and you have to work with them, and C++'s arcane tome of a standard is perhaps a hostile environment for such creatures.
- vapourismo 13y agoMay I have fries with that?
- GhotiFish 13y agoI'm sure that comment meant something. I have no idea what.
- coldtea 13y ago
- santialbo 13y agoIf by "F" the author means F#, he has no idea of what he's talking about. The language is open source with an Apache license.
- isxek 13y agoYup, it was F#.
- michaelfeathers 13y agoProgress is when languages move from the unreasonable list to the reasonable list. I was happy to see Haskell there. I don't think it would've been 5 years ago.
- emersonrsantos 13y agoNo love for mumps? GREPTHIS() NEW SET,NEW,THEN,IF,KILL,QUIT SET IF="KILL",SET="11",KILL="l1",QUIT="RETURN",THEN="KILL" IF IF=THEN DO THEN QUIT:$QUIT QUIT QUIT ; (quit) THEN IF IF,SET&KILL SET SET=SET+KILL QUIT
- platinumdragon 13y agoWow, amazing article! Thanks!
- isxek 13y agoNo mention of Lua? I guess the author hasn't tried it yet, either. (I haven't, but I was curious about his opinion on the language.)
- Tomis02 13y agoAfter years in the C++ swamp, programming Lua feels like being a world-class sprinter. Sure, there are places where it could be less verbose (the 'function' keyword, if-then-end), but overall it's liberating to have so much power with so little typing. Ok, it's a visceral (not technical) impression, but there's plenty of places to read about Lua online. I highly recommend giving it a try.
- jbeja 13y agoThe whole post i was expecting a mention of it.
- declan 13y agoAgreed. It's not as terse as something like Python, but it's pretty speedy and generally a pleasure to program in. (I'd get headaches if I had to look at Objective C blocks all day.) On the other hand, the availability of pure Lua libraries and even the official documentation aren't as complete as they could be.
- mcv 13y agoNo Groovy? If you want to address which is the best JVM language, you've got to at least mention Groovy. Its advantages include being trivial to learn for the vast hordes of Java developers, while making programming a lot more fun in a Ruby-like way. When to use it? When you want the JVM, and productivity is a bigger concern than performance.
- vorg 13y ago> If you want to address which is the best JVM language, you've got to at least mention Groovy You could make that argument for all of the many ecosystems mentioned in the article, e.g. because for Unix/Linux scripting only bash is mentioned, you could have opined "If you want to address which is the best Unix shell, you've got to at least mention zsh". Groovy's just a dialect of Ruby anyway, except being specific for one platform and having a different syntax. All the functionality underneath the syntax is based off Ruby, and even its two applications with any traction are based off Ruby versions. The MOP was put in in 2005 specifically for Grails, which started off as a launder of Rails.
- mcv 13y agoGrails is a bit more than simply Rails for Groovy. There are a few things that Grails does very differently, partly due to it being built on top of Spring and Hibernate. Also, Groovy+Grails is far more enterprise-ready than Ruby on Rails. Something as basic as proper unicode support is still very recent in Ruby, for example. Also, multithreading comes as naturally to Grails as it comes to Java, but not to Ruby on Rails. They are absolutely very similar, but there are important differences that go a lot deeper than just the different syntax.
- vorg 13y ago> There are a few things that Grails does very differently, partly due to it being built on top of Spring and Hibernate. Back in 2005 Grails didn't add much to Groovy, Spring, or Hibernate. It was just a thin wrapper around software products from other companies (e.g. SpringSource, JBoss) so the training consultant behind it all could muscle in on the training and consultancy markets for their products. In 2006 Grails was renamed and promoted as _Groovy on Grails_ to sound like _Ruby on Rails_. He started a company, G2One Inc, in 2007 and quickly shopped it around among the various companies whose products he bundled, successfully fooling SpringSource into buying it 12 mths later.
- MisterMashable 13y agoHave you ever seem a simple Prolog program solving the 'four coloring problem'? Try programming that in anything else. Prolog or something similar like Lisp with pattern matching is the tool of choice for speech recognition programs. Why these tools get dismissed in a world of tablet devices using Siri or Google is beyond me.
- kkoch986 13y agoI think prolog gets a bad rap because people don't spend the time to learn how it really works and how awesome it really is. More than matching which you can get in most functional languages, non-determinism from prolog makes solving all kinds of problems (four coloring included) elegant and simple. If prolog had more of a community behind it, I think it would move up that list pretty quickly.
- dmunoz 13y agoI'm not sure I agree with this line of reasoning. The computation model of Prolog is fairly simple, relies on few primitive, and could be reimplemented in many language without much hassle. The abstract interpreter fits on a 1/4 page. With unification and backtracking, you're into nondeterministic programming. It's great for some problem, and I agree it should perhaps be more regarded than it is, but it can be emulated inside other languages to solve such problems. You also have to be quite careful when using non-determinism. That being said, my main point is that I think the "simple Prolog program solving" X is misleading. Of course a solution to a problem that requires exactly the model of computation the language provides is going to be simple in that language. But that model of computation isn't exclusive to that language, and I don't feel the implementation of the model in other languages suffer.
- asima123 13y agoGreat article
- CmonDev 13y agoPlease check your facts before posting to avoid being a clueless moron: C# is not just a static language it supports dynamic typing, C# is not just an object-oriented language it's a functional language as well. The post is downright offensive to C# developers. EDIT: ok, I figured it out - it's a troll post to stir the HN community a bit. Lot's of other good languages get undeserved bashing.
- mikegioia 13y agoFor PHP he comes out of the gate saying "Don’t just assume PHP is horrible."! Apparently the ONLY redeeming quality of PHP is the vast number of developers who know PHP?
- UK-AL 13y agoC# is better than your standard dynamic typing you see with ruby, and python. It has type inference(static, but you don't have to declare types), straight out of functional languages.
- vinceguidry 13y agoC# is most definitely not a functional language. It has a few functional constructs, and it's possible to (painfully) code in a superficially functional style, but a "functional language" it isn't.
- codygman 13y agoI disagree that just providing functional constructs makes a language a "functional language". How mutable state, purity, and recursion are handled have quite a bit of say in whether a language is functional.
- michaelochurch 13y agoI'd use Clojure over Common Lisp any day of the week, but I'd never call CL a "dinosaur language". It's still getting a lot of use, and it's still a better language than what 90% of programmers have to use in their day jobs. I like one point he made about Clojure's real killer strength: it works for exploratory code and in production. You don't have to use one language for data analysis (e.g. R) and another one for your production servers (e.g. Java) which means that the data-science/production-engineer impedance mismatch need not be as severe. Here's a presentation I gave on that aspect of Clojure (note the Venn diagram): https://docs.google.com/presentation/d/15-7qFy6URdE7Owi2LitkQI_OHBu1AFWPUwHxgBc-O4E/edit#slide=id.g17bb5960b_10315 https://docs.google.com/presentation/d/15-7qFy6URdE7Owi2Litk... On Haskell, he says: "This language truly feels as a more advanced thinking tool than the others in this list. It has libraries for almost any need and it has a hard-core community." You know, a few years ago I looked into Haskell and thought, "this language is amazing" but wrote it off because (a) it didn't seem to have the libraries for "practical" corporate programming (CRUD apps) and (b) the political fight to get to use Clojure at your job is at least theoretically winnable due to the JVM; for Haskell, it's not winnable until you are the architect or boss man. I like static typing a lot (I used Ocaml at Jane Street for a year and a half) so Haskell always seemed appealing, if not practical for "most kinds of work". I'll probably stick with Clojure and Scala, because I'm not yet at that point in my career where I can use/do whatever the fuck I want, but I'm inspired to look into Haskell more. A few people recommended I check Haskell out again. The community has made major strides (or, to put it more directly, it's kicking ass). I spoke to @cartazio about it the last time I was up in New York and he made a really convincing case for Haskell being ready to tackle the hardest of the hard problems (e.g. machine learning problems where performance and high-level code are both needed).
- agentultra 13y ago> I'd never call CL a "dinosaur language". It's a dead horse and people can't help but beat on it as they pass by. I wouldn't call it a dinosaur language either. The specification of Lisp that we call, "Common Lisp," was ratified by ANSI in 1994 -- putting it almost neatly between ANSI C (1989) and ANSI C++ (1998). Common Lisp just has a longer history than those two languages so it tends to get flack from the young'uns and ignoramus' for being, "old and crufty." It's a small community but there are plenty of libraries, tools, and compilers under active development.
- onli 13y agoThe bash-example is not very bashy. It is sh, like the header says. Bash fully supports a native for: for i in {0..5};do echo "$1" done
- xcreature 13y agoInterestingly, this comment states that Bash is not available in all POSIX. Here is where I get lost. http://blog.fourthbit.com/2014/03/01/the-best-programming-language-or-how-to-stop-worrying-and-love-the-code/#comment-1268486352 http://blog.fourthbit.com/2014/03/01/the-best-programming-la...
- onli 13y agoYes, that is correct. Bash has additional functionality (and the for-loop I showed could very well be a part of that). If you want posix, better stick to dash, the code he showed. But bash with its additional features (like associative arrays) is much more comfortable, so if you know you can use bash - because the target is GNU/Linux - it is a good idea to use them.
- dllthomas 13y agoSh has for; it does not have the {a..b} construct. But you can write it as: for i in `seq 0 5`; do echo "$i" done and that will work perfectly well on dash.
- nhmit 13y agoWhenever someone says PHP is useless I know that they have no idea what they are talking about. Being ugly is one thing, being useless is something quite different and in case of PHP this could not be further from the truth.
- timje1 13y agoStrange, this article doesn't call PHP useless.
- jbeja 13y agoBreath, breath, he never say somothing against PHP.
- adamors 13y agoNot to mention, that since 5.4 short array syntax exists. He needlessly provides an ugly example, just to be part of the circlejerk. I don't know why I read past the first paragraph, where he claims Javascript is a great language. Hahaha.
- supersystem 13y agoIf you actually want to make things you'll still can't avoid learning C, C++, Java and/or Objective-C. Other languages just don't offer a broad enough ecosystem.
- vinceguidry 13y agoYou can get very far with Ruby or Python before having to learn a bit of C for extensions. I've been using Ruby for years and I've yet to run into a situation where I need it, though admittedly I stick to web stuff.
- supersystem 13y agoDon't get me wrong, I'm a big fan of high-level programming languages. But things like threading, graphical interfaces, multimedia, embedded programming, binary distribution etc. just isn't very well supported. Partly because of technical challenges, but mostly because there isn't a critical mass of people doing those things.
- reirob 13y agoA lot of people earn their lives with PHP and Javascript.
- romanovcode 13y agotl;dr Author loves javascript.
- jbeja 13y agoYour point?
- romanovcode 13y agoHis opinion is biased and he doesn't know what he's talking about.
- jbeja 13y agoBecause he likes javascript?
- pekk 13y agoTo the exclusion of other things he doesn't know anything about
- rizalp 13y agoOf course he is. He even admit it. It's on the second paragraph > you can’t really be objective. So yes, I’m biased.
- pessimizer 13y agoJust because you decide that someone is "biased" doesn't mean that you don't have to address their arguments specifically. We have more reason to think he knows what he's talking about than to think that you do.
- sebnukem2 13y agoJS is like Perl, grok it, and you're in love.
- jbeja 13y agoFirst time that i ever heard that Scheme compile to c and js.
- pjmlp 13y agoC, or how to keep your job safe as security consultant.
- edem 13y agoClojure is definitely __NOT__ a sibling of Scala. Being a sibling of scala would mean that it is something like C to C++ or Java to Ceylon.
- jbeja 13y agoAgree, just because they run in the same platform doesn't mean that they are related far from that.
- dagw 13y agoIt's a half-sibling, since they share a parent (JVM).
- pessimizer 13y agoMore like roommates, because they share a house.
- aryastark 13y agoIt's more like a brothel.
- skywhopper 13y agoThat's a big list. A relatively inexperienced programmer looking for advice on what language to start with would probably be overwhelmed. How to choose what language to learn next? There's a dozen languages they've never heard of on there. Glad to see Bash on there, even if his example code was sort of misleading. Sure, you have to be able to read that stuff, but if you can rely on Bash being there, you can use better syntax. Anyway, Bash (and other similar shells) is special because it's the glue that ties a Unix system together. No other type of language can construct the same kinds of pipelines and filters so concisely or interact with the filesystem so easily. For a certain set of problems, Bash is by far the best option. The ugliness is partially legacy, but mostly just necessary to allow the same language to work at the command prompt without overloading everyday CLI usage with a ton of pointless syntax. It's all about tradeoffs, kids.
- wes-exp 13y agoI'm sorry Common Lisp is not elegant enough for the author, but it has a great community and library support. (At least compared to scheme) Efforts are also underway to spruce things up a bit. https://github.com/fukamachi/cl21 https://github.com/fukamachi/cl21
- nzonbi 13y agoThis was an excellent article. Agree with the author on many points. Some notable mentions: - Scheme: One of the best languages. A shining example of the beauty of simplicity. I personally envy folks that got to learn programming with SICP. Unfortunately, I didn't crossed with the SICP as a kid, when I would probably had devoured it. - Haskell: possibly the most advanced programming language, with the downside of having way too much syntax. - Opinions on programming languages are biased most of the time. Significant experience with dozens of languages is required, to diminish the bias.
- sfvisser 13y agoHaskell too much syntax? That's a very weird claim. Haskell's syntax is one of the leanest around. You could even argue the lack of syntax can be confusing sometimes. Beginners often mix up types, patterns and expressions, because there isn't a huge syntactic difference.
- delluminatus 13y agoHe means that Haskell has a lot of operators. Haskell code is often very symbol-heavy instead of word-heavy, which IMO can make it hard to read. It reminds me of Perl in that way.
- evincarofautumn 13y agoYeah, but those operators are defined by libraries. There is very little built into to the language. Perl is exactly the opposite.
- thinkpad20 13y agoYeah, that surprised me as well. There are declarations of types and classes etc which are a bit confusing at first, and then there are `do` and `case` and the like. Certainly not a lot though, compared to say C++ or Scala. I think what might make it appear more difficult is that it's just so different from almost anything else out there, so it's not just that there's a bit of new syntax to learn, but that almost nothing that you've learned in other languages will be applicable.
- sov 13y agoI wrote a context switch in assembly pretty recently, so,, it's not entirely unused. It's still in quite a bit of our C code.
- jstultz 13y ago"[Java]’s used for everything, from web apps to games. Almost everything except embedded device software, and perhaps high performance parallel computation software." Apparently hasn't ever heard of Embedded Java or Hadoop
- rottyguy 13y agoA bit surprised by how much attention this article is getting here. Someone nailed it by saying it has much breadth but little depth. A speed dating synopsis of competing programming language to speak. Obviously the author likes brunettes with fair skin. I recall reading the "Design and Evolution of C++" and found it quite enlightening. One wishes this type of book was a mandatory delivery for all Language authors...
- pcwalton 13y ago> If there is something that could debunk C is a low-level language with great support for concurrency. Or maybe a mythical language with the properties of Haskell and the pervasiveness of C. So, Rust? :) (Minus the pervasiveness, right now—but you do have the low-level control.)
- kjs3 13y ago«[Smalltalk] The first true object-oriented language.» Simula-67 would like to have a word with you...
- mbillie1 13y agoIt's a bit sad that we keep reading these articles and keep falling into the same trap of rush-to-defend-your-favorite-language and rush-to-complain-that-your-favorite-language-was-omitted. I find these articles seldom thought-provoking and the comments they inspire even less so. It's like reading "10 best ski runs in the country" or something. It's entirely subjective and hardly anyone will agree for any decent set of reasons.
- thelogos 13y agoPeople should first decide what they want to achieve, produce mobile, web, or desktop applications, etc. Then they should find the best framework to achieve their goals. The language is usually force upon you by the framework unless you're working on something cutting-edge. In the past, when I set out to learn a programming language, I would always get nowhere. You learn the syntax from some book, do the exercises, then what? Without a solid goal to hack toward, pretty soon, you will forget everything you've just learned.
- ternaryoperator 13y agoSurprised that Lua did not make the list.
- chrisBob 13y agoI thought the best programming language was the one with the libraries I need (usually from the hardware vender of the card I need to interface with).
- tbomb 13y agoNice read, pretty entertaining round up. I like the use case lists (I think they added most of my entertainment), and overall tone of the article.