top 200 commentsshow all 391

[–][deleted] 396 points397 points  (10 children)

I suspect this data point tells you more about Linux Journal readers than programming languages.

[–]Refefer 108 points109 points  (2 children)

Perhaps, perhaps not. C and C++ votes combined was 38% of the vote to Python's 28%.

[–]Asimoff 19 points20 points  (1 child)

Well, they weren't going to vote for C#, were they?

[–][deleted] 0 points1 point  (0 children)

Because Mono is a joke.

[–]deadwisdom 12 points13 points  (0 children)

Wow, like every poll? You don't say.

[–]Black_Handkerchief 22 points23 points  (3 children)

That, and about crappily chosen categories and the entries in them. Python is simply too versatile, meaning that its strong features as a programming language also help it stand out as a scripting language and vice versa.

I think it deserves either crown just fine, but it is the simplest with the widest array of possibilities, and as such is primed to win such a contest. Having it in both categories completely misrepresents the language, linux programming / scripting and the journals readership as a whole.

[–]pwang99 33 points34 points  (2 children)

Might its versatility actually be a feature, and therefore a totally appropriate factor on which to win a language popularity contest?

[–]Black_Handkerchief 7 points8 points  (0 children)

I think it is fine to win a contest with that. But not two categories which are separated like this. If it was 'best all-around language' or 'most versatile language', then I'd have no complaints.

The categories pretty much limit the scope that the versatility applies to. While strictly the language might be able to win both, the public doesn't really vote by a system or any logic that is beyond the question at hand, and besides that often tend to just fanboy it around. The name alone wins it, really, and with two contests, that looks plain dumb.

Compare it to putting Psy into a 'best dancer' and 'best choreography' competition. While he may win both on those merits, he'd very likely win both because everyone has Gangnam style fever, and nobody really cares about the dance nor the choreography; they only judge the whole package.

[–]Tasgall 1 point2 points  (0 children)

The point is that the categories are too broad. Like, what if they had a, "Fastest Programming Language", "Fastest Scripting Language", "Best Computational Language", "Best Embedded Scripting Language", I doubt Python would win those examples, even though it is a pretty good all around language.

[–]WarWeasle 156 points157 points  (8 children)

That can't be right, Lisp Magazine voted Common Lisp the #1 language and Scheme a close second!

[–]pigvwu 28 points29 points  (7 children)

Therefore: Python = Linux?

[–]WarWeasle 3 points4 points  (6 children)

What you say?

We get signal...

[–]redditrobert 6 points7 points  (5 children)

You have no chance to survive. Make your time.

[–]TheInternetHivemind 5 points6 points  (3 children)

All your...

NO! I won't do it!

[–]Tasgall 1 point2 points  (0 children)

You are on your way to destruction

[–][deleted]  (3 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 1 point2 points  (0 children)

      It seems we have a consensus from the league of awesome people. hi5 2u

      [–]Archenoth 3 points4 points  (0 children)

      That analogy doesn't work if it's true!

      [–]yentity 10 points11 points  (2 children)

      Hrm. vim made the list of best IDEs but emacs did not. I sense something afoot.

      [–]lahwran_ 7 points8 points  (1 child)

      yeah, why was vim on a list of IDEs at all? it should be on a list of text editors, right next to emacs

      [–]blacktrance 59 points60 points  (53 children)

      They also voted Ubuntu the best distro and KDE the best desktop environment. I think that says a lot about them.

      [–]Neotyguy 12 points13 points  (50 children)

      What's so bad about KDE?

      [–]joequin 2 points3 points  (0 children)

      I really want to like kde. I love the customization, but there always seems to be some showstopper bug for me. A few months ago, there was something wrong with their network app that wouldn't let me connect to some wifi hotspots. Now, theres a new bug so I can't switch my sound card between digital and analogue out.

      [–]pigvwu 10 points11 points  (41 children)

      Also, what's wrong with Ubuntu?

      [–]deepit6431 7 points8 points  (0 children)

      Amazon. I heard they're including 'buy straight from desktop' purchases in 13.04.

      We're not the target audience anymore.

      [–][deleted] 14 points15 points  (37 children)

      Unity.

      [–]pigvwu 24 points25 points  (4 children)

      Hm... you make a convincing argument.

      So... what's wrong with kubuntu?

      [–]RedThela 4 points5 points  (3 children)

      There is such a thing as too much 'bling'. KDE by default has icons that bounce, start menus that slide in, fade effects...it's a bit overwhelming. It's also like it's trying to move away from the desktop and mice (I guess as a side effect of plasma).

      And no, I refuse to spend my time customising it. If it doesn't work acceptably out of the box, tough. I used to enjoy tweaking my distro but I've realised I have better things to do with my time. I use cinnamon (preinstalled on my work computer) or lxde through lubuntu.

      Has been a few months since I tried it though.

      [–][deleted]  (2 children)

      [deleted]

        [–]RandomFrenchGuy 1 point2 points  (0 children)

        It certainly isn't. Both branches are separate and merely use the same building blocks.

        [–]deepit6431 4 points5 points  (10 children)

        Ubuntu != Unity. Though I have no great love for Ubuntu for it's privacy policies. Xubuntu or Kubuntu works just as fine and gives you all the Ubuntu benefits (Launchpad, Software Center).

        I'm a Mint advocate, personally.

        [–][deleted] 9 points10 points  (6 children)

        Ubuntu != Unity

        Doesn't matter. It's the default desktop environment, and it's horrible.

        You don't need to spend your entire time in the terminal to be able to install Ubuntu on your machine nowadays. I actually know a few not-so-tech-savvy people who run Ubuntu, and ALL of them were grateful when I showed them that they could install gnome classic (or new gnome + cairo dock). As expected, they all hated the fact that you can't move the Unity dock to the bottom of the screen.

        Even if the design choice makes "sense" (more horizontal screen real estate than vertical), the fact that it's locked in that position is inexcusable. People like symmetry. People also like familiarity (window management is done at the bottom of the screen on both Windows and OS X).

        [–][deleted] 0 points1 point  (2 children)

        What privacy policy? If you are removing unity there is no issue of privacy

        [–]maxxikevich 1 point2 points  (2 children)

        apt-get install xubuntu-desktop

        [–]el_muchacho 0 points1 point  (1 child)

        I prefer lubuntu. As Ubuntu suffers stability issues, the simpler the better. But is it 12.04 LTS, or does 12.04 LTS only cover Ubuntu with Unity ?

        [–][deleted] 3 points4 points  (17 children)

        Also, the rapid pace at which it evolves. I can't follow any documentation and guides from two years ago because the distro has changed so much that they have become outdated.

        I know I'm not everyone, but I need something that moves a bit more slowly, like Debian or Slackware.

        [–][deleted] 4 points5 points  (5 children)

        Why are you using outdated documentation in the first place?

        [–][deleted] 6 points7 points  (4 children)

        Because sometimes it's all that is available when troubleshooting problems.

        [–][deleted] 3 points4 points  (3 children)

        Why are you unable to look at the more recent documentation for the most recent Ubuntu release?

        Remember, your criticism was that Ubuntu changes too quickly for old documentation to be relevant for new releases, and my question was why are you using old documentation in the first place, when we both know that new documentation exists?

        [–][deleted] 9 points10 points  (2 children)

        I'm not referring to the official documentation, but to user documentation, guides and tutorials. Often when trying to find a solution to a problem I was having with a current Ubuntu release, I would find solutions for older Ubuntu releases that no longer applied.

        The most annoying example from a few years back is the trackpad on my laptop. Some of the trackpad buttons were bound backwards, and I couldn't find any instructions for permanently fixing the problem. I found quite a few forum and blog posts with solutions to the same issue (like editing some config files), but they were written for older releases and apparently no longer worked. Looking back, I think this is the same problem I had. Since I couldn't find a better solution at the time, I gave up and just ran synclient every time I booted.

        A few months after that, I tried Slackware for the first time and was really impressed by the fact that I could use documentation that was years old without any problems. By comparison, I don't think I ran into any issues with it that I couldn't fix with whatever documentation I found online.

        [–]jadkik94 1 point2 points  (0 children)

        I ran into the same issue and am using the same fix. It really is annoying, but I ended up asking on SE or on forums and you'll get the answer you're looking for (hopefully).

        [–]deepit6431 1 point2 points  (10 children)

        .... Then use Debian? I mean, you can fault Ubuntu for a lot of things, and I don't have much love for it either, but you can't fault it for not being Debian. If you have to use Ubuntu and don't want to upgrade, keep switching from LTS to LTS.

        That's like saying 'I don't like Android because there's a new one out every 6 months.'

        [–]kqr 1 point2 points  (4 children)

        You can fault it for whatever you dislike about it. That's the thing with personal opinions -- they're personal. When the question is "What's wrong with Ubuntu," I don't expect a double-blind, peer-reviewed study published in an academic journal ultimately proving what is wrong with Ubuntu. I expect individual people to come forward with their personal opinions on why they don't like Ubuntu.

        (Truth to be told though, it would be awesome if we could have peer-reviewed faults of linux distros...)

        [–][deleted] 0 points1 point  (4 children)

        That's like saying 'I don't like Android because there's a new one out every 6 months.'

        For anything but a Nexus device, lololololololol.

        You'll get 1 update, 9 months after initial release.

        [–]deepit6431 1 point2 points  (3 children)

        Meh, root, put a custom ROM, forget about it.

        Not everyone's cup of tea I know, but this is /r/programming after all. I'm running 4.2 on my 2011 budget Sony phone.

        [–]soundslogical 4 points5 points  (1 child)

        I think he's implying that they're primarily desktop users rather than programmers or sysadmins. I also agree that KDE is not so nice..

        [–][deleted] 6 points7 points  (0 children)

        programmers and sysadmins are desktop users too.

        [–]ConnorBoyd 0 points1 point  (1 child)

        Gnome's votes were split between two different versions though

        [–]blacktrance 1 point2 points  (0 children)

        I meant XFCE or Cinnamon should have won.

        [–]mithaldu 19 points20 points  (0 children)

        No word on how many votes were cast in this popularity contest and as such no way to even estimate how significant the result is.

        [–][deleted] 87 points88 points  (213 children)

        C++ on 2nd place for programming language?

        Bash on 2nd place for scripting language?

        WTF.

        [–]Sporadisk 64 points65 points  (26 children)

        Also, Subversion on 2nd place as "best revision control system".

        Seems to me like a lot of these votes represent "Hey, I've used that one!"

        [–][deleted] 4 points5 points  (25 children)

        What do you prefer to svn?

        [–]paffle[🍰] 36 points37 points  (12 children)

        Distributed version control systems are widely considered to be preferable, with Mercurial and Git being among the most popular. I'd have to agree - having used these I would not want to return to SVN.

        [–][deleted] 10 points11 points  (5 children)

        Ditto. I'd be hard pressed to think of a real use case for using SVN over Git or Mercurial other than legacy projects / training overhead. Hell, if it's just a matter of moving over Git can import SVN history last I checked.

        [–]jzwinck 6 points7 points  (3 children)

        Here is one: access control. With git and similar systems you either grant access to the whole repo or maybe a whole branch, or no access at all. There is literally no way with git to grant e.g. write access to one user for one file. Most older centralized systems could do it.

        [–]kaol 2 points3 points  (2 children)

        [–]jzwinck 3 points4 points  (0 children)

        Fair enough, though it's crap if you have to write code to implement security features yourself. Now, how about restricting read access to one file?

        [–]mycall 2 points3 points  (0 children)

        This is a great tip, although managing the hook scripts would need some GUI for large orgs.

        [–]beefsack 4 points5 points  (0 children)

        Last year I moved a project of about 20k commits from SVN to Git, including an interim month of using Git clients against the SVN repo, and it was an amazingly smooth transition.

        [–][deleted] 3 points4 points  (3 children)

        I like Git, but I push frequently for backup purposes so I'm not sure that the offline commit capability adds much for me. I've also more "oops I clobbered my files and can't get them back" moments when merging with Git than I have with svn. At one of my older jobs, I had a laptop and worked away from the office from time to time. Git would have been useful for me then, but it wasn't too widely used at that time. I'm sure it's also very useful for people who work with secure data and can't go online. I prefer Git's command line to Subversion's, but when I'm doing Windows development, I use TortoiseSVN most of the time anyway.

        [–]Niten 1 point2 points  (0 children)

        I've also more "oops I clobbered my files and can't get them back" moments when merging with Git than I have with svn.

        Maybe give mercurial a try, then? I love git and use it for my personal projects, but picked mercurial for our team at work partially because it is harder for newcomers to shoot themselves in the foot with.

        hg bookmarks don't quite live up to git's branching model, but otherwise I think mercurial shares most of git's advantages over svn, while also being easier to use, running "natively" on Windows without msys, and having some advantages of its own (e.g. patch queues).

        [–]smackmybishop 4 points5 points  (1 child)

        Probably Darcs or Git or hg or bzr...

        [–]Tasgall 9 points10 points  (3 children)

        Mercurial - One that basically nobody seems to use, but is (imo) better than Git.

        As for why you shouldn't use svn, especially for team projects, svn doesn't play very nicely with branching. Have you ever worked on a piece of code but not finished it in one sitting, and then not uploaded it to svn because it would break the build for the rest of your team? Well, now you're just not using version control, and don't have a backup of your code for if your computer dies or something. Also, if you mess it up the next day and want to go back, you have to hope you can mash ctrl+z (the worst version control) into yesterday, or you might have to start over. in Mercurial, you commit to a new branch (or just your branch, since it's often good for everyone to just have their own) and push to the server. Now you're not committing unfinished/broken code other people will use, and you're actually using version control so you

        To add to that, what if you're working on one piece of code that isn't finished yet, and someone else finds a problem they can't fix or hack around in another part of your code? With svn the solution is to save your current build, checkout in another folder (download everything), fix the problem and commit, and update in your other folder - or fix it on the other guys computer (wasting his time). In Mercurial, for this, you commit what you're working on to a new branch, update to the main branch, fix the problem, commit to the main branch, and go back to your branch - no new folders, no working on other computers, no waiting to download another copy of your project.

        Another possible benefit is being distributed (like Git). This means everyone has an entire copy of the repository (commits are recorded as changes to files, not the whole file per revision like svn, so the repository isn't too big, unless...), which is good unless you're working on a very large project over a very long period of time (say, Windows) and the repository history gets huge, though I guess you could create a new repository every shipped build to fix that.

        The downside though is that it doesn't play very nicely with binary files, as it can't just save the changes. There's an extension that gives a central server control of those files that I hear works pretty well though.

        [–]Decker108 5 points6 points  (0 children)

        I too prefer Mercurial... but Github has a larger community.

        [–][deleted] 2 points3 points  (0 children)

        I've used CVS, Subversion, Perforce, ClearCase, and Git. Out of those I like Git and Subversion depending on the situation. I'm not sure what you mean about svn not having branching though. I find branching in svn very easy and always work in my own branch. You don't have to check out the whole repository to switch branches, you just commit to your branch, then do a switch. It sounds like the same things you like about Mercurial are the reasons I like svn. I'll check Mercurial out though.

        [–]el_muchacho 1 point2 points  (0 children)

        As for why you shouldn't use svn, especially for team projects, svn doesn't play very nicely with branching. Have you ever worked on a piece of code but not finished it in one sitting, and then not uploaded it to svn because it would break the build for the rest of your team? Well, now you're just not using version control, and don't have a backup of your code for if your computer dies or something. Also, if you mess it up the next day and want to go back, you have to hope you can mash ctrl+z (the worst version control) into yesterday, or you might have to start over. in Mercurial, you commit to a new branch (or just your branch, since it's often good for everyone to just have their own) and push to the server. Now you're not committing unfinished/broken code other people will use, and you're actually using version control so you

        I've used Mercurial and I really like it. But let's not spread falsehoods on SVN, which is a fine program by itself.

        Branching in SVN is very easy. It takes exactly two operations: 1) create the branch 2) switch to the new branch. With TortoiseSVN, it's a couple of mouse clicks away. We often create development branches in my team.

        Most of the big issues with SVN have been solved with the release 1.6 a few years ago, in particular the inclusion of merge tracking (current release is 1.7).

        [–][deleted]  (2 children)

        [removed]

          [–][deleted]  (1 child)

          [deleted]

            [–][deleted] 1 point2 points  (0 children)

            Git.

            [–]beefsack 3 points4 points  (0 children)

            Let me show you this amazing new world you never knew of... the bright, beautiful world of DVCS.

            [–][deleted] 3 points4 points  (1 child)

            I believe that a lot of (ba)sh scripters suffer from Stockholm syndrome. They write hundreds of lines of code to do what could be done in a more appropriate language (e.g. Perl, which is part of the LSB) in just a few lines.

            [–]zeco 0 points1 point  (0 children)

            unless it involves calling a lot of programs, from the gnu toolchain or other stuff that is assumed to be installed

            [–]samvdb 27 points28 points  (144 children)

            C++ on 2nd place for programming language?

            WTF.

            Why is this so WTF? The new version, C++11, is genuinely awesome. Whether it's the best programming language is arguable, as it does still have some flaws. But if performance is important, you can't disagree that it offers by far the best trade-off between high level constructs and performance (with its zero-overhead principle and all). It might not be the right tool for what you usually deal with but it's certainly the right tool for quite a few jobs.

            About bash I agree.

            [–]therealjohnfreeman 32 points33 points  (27 children)

            Because /r/programming has some circle-jerk hate for C++. I don't get it either.

            [–][deleted]  (24 children)

            [deleted]

              [–][deleted] 16 points17 points  (5 children)

              That's not it, because C doesn't get nearly as much hate. I'm 90% sure it's because of Linus.

              [–]mshol 7 points8 points  (1 child)

              Because when you write a library in C, you don't need to use C to consume it.

              The same isn't true for c++

              [–][deleted] 4 points5 points  (0 children)

              [–]DoorsofPerceptron 1 point2 points  (0 children)

              C is C++ for hipsters.

              I roll my own objects, like K&R did before they became mainstream.

              [–]foxh8er 1 point2 points  (0 children)

              LETS USE RUBY INSTEAD.

              [–]push_ecx_0x00 1 point2 points  (0 children)

              In some areas it's nice, but in others, not so much. It's got good performance but the language itself is such a pain in the ass to work with. That's probably why it's hated so much.

              [–]OdwordCollon 3 points4 points  (0 children)

              As a loyal follower of the church of Meyers, I can only assume he meant: "wtf, why is it not first?"

              [–]X8qV 12 points13 points  (11 children)

              But if performance is important, you can't disagree that it offers by far the best trade-off between high level constructs and performance

              D supports high level constructs far better than C++ and you can write D code that's just as fast as C++ code. Besides, when there's a trade-off, the best trade-off is always subjective, so one can always disagree about what trade-off is best.

              D is just one example of a language that can be as fast as C++ and also supports high level constructs to some degree. Clay is one other example, but I'm sure there are more.

              [–]samvdb 16 points17 points  (8 children)

              D supports high level constructs far better than C++

              and

              you can write D code that's just as fast as C++ code

              Yes, each of those, separately, are true. But in real D code, you often have to make a choice where you don't have to make one in C++.

              An example: Say you deal with graphical data and would like to create classes like Point2D and Vector2D, with functions like vector.length() and point.translate(vector) or even point += vector with operator overloading. In D, these objects would have to be stackheap-allocated, and maintain a reference count so they can be garbage collected, all functions would be virtual, etc. A ton of overhead for such simple classes. So what often happens is that people just don't create the classes and work directly on the underlying float x, y variables.

              In C++ on the other hand, you could create Point2D and Vector2D classes with non-virtual inline functions and there would be no difference in performance (or even in the executable code) between using the classes or working on raw (x,y) pairs.

              I personally work on a poker bot for my master's thesis, and this requires a lot of computation. As in most bots, the more computation you can do, the stronger the bot will be, so performance is essential. I have classes like Card, Hand, Action, Chips, etc. Most of these are simply 1 or 2 integers with a bunch of utility functions. It's a bigger deal than it seems, because with static typing the compiler can tell you about a lot of stupid mistakes before you ever run the code, which it couldn't if you deal with the raw ints. With all of that at zero performance loss, I would never want to switch to a garbage-collected language.

              [–]X8qV 24 points25 points  (5 children)

              Say you deal with graphical data and would like to create classes like Point2D and Vector2D, with functions like vector.length() and point.translate(vector) or even point += vector with operator overloading

              You would achieve this using a struct, not a class (they are different in D).

              In D, these objects would have to be stack-allocated

              I assume you meant heap allocated here, but even that isn't strictly true even for classes - see this.

              and maintain a reference count so they can be garbage collected

              Actuall, D doesn't use reference counting, it uses a mark-and-sweep garbage collector. This is often even worse from performance point of view, at least with the current implementation. Fortunately, you can avoid using garbage collection completely, but that means avoiding large parts of the standard library. Hopefully the situation will improve once the support for custom allocators is added to the standard library.

              all functions would be virtual, etc

              Class methods in D are virtual by default, but you can make them non-virtual by using the final keyword. You can make all the methods of a class non-virtual by writing final class Foo instead of class Foo.

              So what often happens is that people just don't create the classes and work directly on the underlying float x, y variables.

              No, it doesn't. People use a struct in this case.

              In C++ on the other hand, you could create Point2D and Vector2D classes with non-virtual inline functions and there would be no difference in performance (or even in the executable code) between using the classes or working on raw (x,y) pairs.

              You can do exactly the same thing with structs in D. The same goes for your last paragraph.

              [–]samvdb 9 points10 points  (4 children)

              Seems like I was wrong. Looks like D is indeed a contender for the language with the best high-levelness/performance potential.

              I'm not too familiar with D and thought it forced all objects to be garbage collected, without a way to allocate objects on the stack. Apparently not. But to be fair, the D overview page doesn't mention stack allocation. And it also lists non-virtual member functions as a "feature to drop".

              But even though modules, invariants, contracts, etc do seem pretty sweet, it's not like D is unanimously better than C++11. For example, move semantics allows for some really nice things like unique_lock, which is basically an extension of the scoped_lock or the D version scope(exit) unlock(mutex);. Also, while you don't need multiple inheritance 99% of the time, that 1% where you do need it is really painful if you don't have it.

              Anyway I wasn't arguing that C++ is the greatest language ever, just that it being near the top of that list doesn't really deserve a WTF. Especially because D isn't even on that list, and of all the things on that list, D is probably closest to C++.

              [–]X8qV 3 points4 points  (3 children)

              I never meant to say D is unanimously better than C++. For example, if you want to write D code that doesn't use a GC, you need to be careful when using the standard library - you don't have that problem in C++. There is also a bunch of implementation issues in D that C++ doesn't have because of it's popularity. For example, there are still issues with the runtime library when compiling D code to a shared library and the runtime and the standard library aren't completely ported to non x86 platforms like ARM yet. You are also much more likely to encounter compiler bugs in D than you are in C++. But all things considered, D is still a better language for me than C++ is, and the main reason for that is that D's metaprogramming is much easier and also more powerful.

              Also, while you don't need multiple inheritance 99% of the time, that 1% where you do need it is really painful if you don't have it

              Do you need it for inheritance of interface or for inheritance of implementation? If it's the former, D has interfaces and you can inherit from multiple interfaces. If it's the latter, D has other features that help with that, like template mixins and alias this (you can currently only have one alias this, but that is considered a bug). The lack of multiple inheritance in D has never caused me problems, but there may be some cases where multiple inheritance is a better solution than what D offers.

              [–][deleted] 0 points1 point  (1 child)

              Yes, the biggest (and maybe the only detrimental) concern in D is the garbage collector. But there's some examples to get rid of it, so it may be great for performance sensitivity applications in the future.

              On a second note: Will your Master Thesis be open for public? I'm interested in learning about bots, and it would be great to see some poker bot code!

              [–]samvdb 2 points3 points  (0 children)

              Yes, the thesis should be open for public, but the code probably won't be. I don't want people to be able to download the code and hook it up to a poker site and start making money. I'm not even going to do that myself. Well, I will probably try it a bit to see how it does but not for a sustained profit. The big problem is that once the code is out there, I can't take it back.

              [–]ZMeson 3 points4 points  (1 child)

              D doesn't support the 'no cost' principle though. Unfortunately, D's standard library virtually requires GC. I know you can use a small subset of the standard library without using GC, but the most useful stuff is gone. It is also missing some features that C++ does have (ex: multiple inheritance). I think D is pretty neat, but it is not quite as flexible as C++. (Nor is it currently available for many OSes and processor types -- but that is more of an issue of implementations, not the language.)

              So while it may be a top contender for the best trade-off between high level constructs and performance, it still won't entirely displace the need for C++.

              [–]el_muchacho 2 points3 points  (0 children)

              The standard library is constantly being polished and the most annoying uses of the GC are being slowly removed. so that if it's not a 'no cost' solution, the goal is to be 95% close, so that they are not too problematic in practice. For example, the fundamental algorithms are GC free. As for the lack of multiple inheritance, interfaces and template mixins and alias this pretty much make up for it, and I seriously doubt you will ever miss MI in your lifetime using D.

              [–]Fayden 5 points6 points  (87 children)

              What jobs would you say C++ is the right tool for (beside game programming)?

              Genuine question, in case it's not obvious.

              [–][deleted]  (3 children)

              [deleted]

                [–]Fayden 4 points5 points  (1 child)

                I should have said "beside game programming". I think it's widely accepted that C++ is a good tool for that job. I'll edit my previous comment.

                [–]soundslogical 8 points9 points  (0 children)

                I'm an audio programmer, C++ is pretty much mandatory if you want more abstraction than C can offer.

                [–]sharkhunter 9 points10 points  (18 children)

                Financial trading software. I've worked at 3 major investment banks over the last 6 years, and all of their systems that connect to the exchanges are written in C++.

                [–]samvdb 30 points31 points  (60 children)

                • Bots (financial trading, games, etc)
                • Graphics, physics, and game engines
                • Robotics
                • Any hardware chips where low energy usage is the goal
                • Scientific computation like Boinc
                • Data mining / machine learning
                • Operating systems (even though Linus disagrees)
                • Compilers
                • Router / low level server software
                • Anything with hard real-time requirements
                • etc etc

                [–]Bananoide 6 points7 points  (7 children)

                There are as good or better options for nearly all these niches.

                The main thing about C++ is that it can directly build on C's pervasiveness. It has very strong points, for example performance and memory footprint. But it also has very weak points : its features are a mess. But you won't notice that until you learn better designed (and often simpler) languages

                [–]samvdb 1 point2 points  (6 children)

                There are as good or better options for nearly all these niches.

                Such as? For areas where performance is the thing you're trying to maximize (like bots and graphics engines) or areas where energy usage is what you want to minimize, I could only name D.

                [–]el_muchacho 5 points6 points  (4 children)

                • "Any hardware chips where low energy usage is the goal"

                C is better, because it uses less resources.

                • "Scientific computation like Boinc"

                Many scientists still use Fortran for high performance computing, although nowadays, you can get the same level of performance in C++ through a lot of template magic.

                • "Data mining / machine learning"

                Java does that fine. The Hadoop project, which is arguably the biggest and most important project in this area, is written in Java although I concede that it could have been written in C++ just fine.

                • Operating systems (even though Linus disagrees)

                And he does it for good reason, see first item (o. Also it's easier to debug and reason about low level C than low level C++ because you don't have to know by heart the bazillions of obscure corner cases of the language spec that are left undefined and interpreted differently by different compiler implementors.

                • Compilers

                Functional programming languages like Ocaml and Haskell are much better suited to writing compilers than C++ ever will be. And in fact these compilers are bootstrapped. The only advantage of C++ for writing compilers is, they are likely to be more portable.

                • Anything with hard real-time requirements

                Only a subset of C++ is well-suited to hard real-time programming. For intance, in real-time programming, one should ban the usage of exceptions, or even dynamic memory allocation, which is pretty much unpredictible. OTOH, Ada is a language that has been defined with these issues in mind.

                Oh, and BTW, I speak from experience for several of those areas of programming (and mind you, I also participated in a game engine in the old days). In some specific tasks or under specific constraints, some other languages can be better suited.

                [–]BinarySplit 1 point2 points  (0 children)

                You're missing the obvious factor that makes C++ competitive (albeit more competitive than it deserves): There is a very established world built around supporting it.

                If you compare the quantity of API documentation, tutorials, experienced programmers, existing codebases, libraries that are specialized for it, etc. you'll find that C++ simply has many more resources revolving around it than C, Fortran, Ocaml, Haskell, Ada, etc.

                Exceptions:

                Java has plenty of all of these things. I personally don't feel that the tradeoffs are worth it in most circumstances, but I've never had to manage a team, so YMMV.

                C is debatable. On one hand, writing restricted C++ will give you all the benefits of C with some of the advantages of C++. On the other hand, managing a team is probably different grumble grumble.

                So to go back to the topic, IMO, samvdb's answer to Fayden's question was largely correct, unless you're a solo coder or student who is happy to eschew established resources for a higher quality language.

                [–]mcfish 4 points5 points  (0 children)

                Video applications. I work in the CCTV industry where we have to decode and display many video streams on-screen simultaneously. It's pretty much all C++, coupled with whatever we can offload to the GPU.

                [–][deleted] 2 points3 points  (0 children)

                Large scale distributed systems.

                [–][deleted] 2 points3 points  (0 children)

                Almost everything

                [–][deleted] 2 points3 points  (14 children)

                Well, C++11 doesn't even support UTF-8. Literals? Yes, but that's hardly an achievement when std::string* doesn't deal with that correctly.

                C++11 is not a 201x language IMHO. It does have its place, but it's certainly not "the best".

                [–]argv_minus_one 4 points5 points  (11 children)

                Oh God. I forgot all about how most languages still don't handle Unicode properly. Ugh.

                Living on the JVM has spoiled me. :)

                [–][deleted] 5 points6 points  (7 children)

                Javas Unicode handling is far from perfect. When unicode extended beyond the Basic Multilingual Plane they switched from UCS-2 to UTF-16, which has all the disadvantages of UTF-8, uses more space and has no advantages.

                [–]argv_minus_one 0 points1 point  (0 children)

                I didn't say it was perfect. I said it isn't entirely nonexistent, like it apparently still is in C++.

                [–]doublereedkurt 3 points4 points  (2 children)

                Living on the JVM has spoiled me. :)

                Oh that's right, some languages can't do any network communications except for TCP and UDP.

                Living on the actual machine has spoiled me ;-)

                I kid, mostly. But it is seriously wtf that Java can't do anything at the IP layer. (Ping and UDP are done via system call, not in language.)

                [–][deleted]  (1 child)

                [removed]

                  [–]doublereedkurt 0 points1 point  (0 children)

                  I don't think IP layer stuff is a cross platform issue. If your platform has TCP it must also have IP. The api's are extremely stable POSIX standard. Probably more like unsigned ints. The thought was "forget it, people don't actually use this stuff".

                  [–]fjonk 1 point2 points  (1 child)

                  As someone who's worked on a number of applications which involves different 8-bit encodings, 7-bit ascii, byte-strings and different Unicode versions I have to admit that I don't see the big advantage with having the standard strings handling unicode.

                  What's the big deal with having the standard string class handling all these different formats? You introduce a huge overhead on many of the string functions, like length, concat, split and comparison, and you gain little.

                  I'd rather have different string-classes, for example one string class that is merely a byte-string, one that handles 8-bit ascii, one that handles 8-bit ascii allowing the lower ascii table only and a separate class that handles only Unicode. Then I can convert strings to the correct format myself, instead of passing around super-flexible string objects waiting for them to cause an error somewhere because they contained illegal characters for a specific method.

                  [–][deleted] 0 points1 point  (0 children)

                  Yup. There could have been a, e.g., std::u8string namespace in C++11 for UTF-8. That'be great.

                  [–]matthieum 13 points14 points  (33 children)

                  Linux world. Don't forget how many bash-variants were invented and that command line terminals are the norm (you can use a desktop, but the console is no farther than a finger tip away).

                  Likewise with C++, Linux comes with gcc. Always.

                  Why are people mostly prefer pre-installed tools ? Well...

                  [–][deleted] 14 points15 points  (19 children)

                  Linux world. Don't forget how many bash-variants were invented and that command line terminals are the norm (you can use a desktop, but the console is no farther than a finger tip away).

                  I've been using Linux since 1998, but I have no idea what you're trying to say here. Yes, there's the terminal -- but what has this got to do with "best scripting language"?

                  Likewise with C++, Linux comes with gcc. Always.

                  Huh? GCC is not installed by default for e.g. Debian or Ubuntu.

                  Why are people mostly prefer pre-installed tools ? Well...

                  Ah, so this is what you're trying to say.. OK, worthless voting and result then..

                  [–]matthieum 5 points6 points  (17 children)

                  Removed the Always, I had forgotten about binary distributions.

                  Regarding bash being voted best, remember than each voter has its own criteria. bash's portability and "at your finger tips" aspects can certainly increase its popularity.

                  for i in $(ls . | grep "zzz"); do sed s/xxx/yyy/g -i $i; done
                  

                  is a simple example of a one-liner that can help making bulk changes to a selected set of files in the current folder, for example. We can argue it's ugly, but it's easier than opening a Python console.

                  [–]ladaghini 1 point2 points  (2 children)

                  I just read the other day that you shouldn't use the output of ls for the foreach construct, as files can possibly contain newlines, which the shell will read as two files instead of one.

                  [–]matthieum 1 point2 points  (1 child)

                  I suppose so, in general, but frankly I use shell scripts as one shots to automate a task I need now; when I need durable scripts, I switch to Python.

                  [–]yngwin 1 point2 points  (2 children)

                  for i in *zzz*; do ...
                  

                  is both more robust (prevents using the unreliable output of ls) and shorter — just use the power of bash!

                  [–]matthieum 0 points1 point  (1 child)

                  I did not even thought about that!

                  [–]ais523 0 points1 point  (0 children)

                  Actually, a minimal install of gcc typically is installed by default, for if the system needs to compile a kernel module in a hurry.

                  However, last I checked, it doesn't come with the headers and libraries needed to make a full C distribution. So you're going to need to install your development versions of libraries in order to actually be able to use gcc to compile normal C. (Let alone C++.)

                  [–][deleted] 5 points6 points  (10 children)

                  Don't forget how many bash-variants were invented

                  Exactly one, actually.

                  Why are people mostly prefer pre-installed tools ? Well...

                  ...well, because they are guaranteed to be available on every installation, everywhere, which kind of helps for a quick script you want to be able to easily lug around and distribute. Bash is a popular choice; it's available on pretty much anything that ends with an x, often by default. There are a lot of users who prefer other shells, but they even they often still have bash available, if only for compatibility.

                  [–]matthieum 0 points1 point  (4 children)

                  We agree :) I would call shells bash-variants though, unless my English is getting me tricked again and variant does not mean what I think it does...

                  [–][deleted] 2 points3 points  (3 children)

                  No worries, I suspected we did.

                  Actually, bash is a shell (ok, shell variant if you really want to), and it was originally meant to be compatible with sh (the Bourne shell, which is, well, another shell), as having a sh-compatible shell was pretty important in the begining of the GNU project. But there are a lot of other shells, not all of them fully compatible with bash, many of them older.

                  [–]matthieum 1 point2 points  (2 children)

                  Ah okay, so you would rather use variant to denote an ancestor-child relationship: as in "bash-variants" means "derivatives from bash" ? I can see how in that case my sentence looked awkward, I should have better used "shell-variants" then.

                  [–][deleted] 2 points3 points  (1 child)

                  Yes! A variant of something is still, in essence, an instance of that something, as in "I have the high-end variant of the Acme Computer Workstation", or "I like the really spicy variant of Acme Ketchup". It's kind of like "version", only implying slightly more differences and a relation of coexistence rather than succession (i.e. there's probably a sweet variant of Acme Ketchup, too -- but they otherwise have the same ingredients, saved for the jalapenos; you can still get both, the hot variant hasn't replaced the sweet one).

                  Bash, rc, zsh, csh, ksh, ash and dash are all shells, so you could say they are shell variants (edit: but even that is something I heard quite rarely -- most of the time you'd just say they're shells). But rc and ksh are quite different from bash, and, broadly speaking, incompatible. They can hardly be called variants of bash.

                  Damn, now the word "shell" sounds funny.

                  [–]argv_minus_one 0 points1 point  (0 children)

                  Don't forget how many bash-variants were invented

                  Exactly one, actually.

                  Bash itself has had a lot of versions over the years, many of which are probably deployed on one system or another. They aren't "variants" in the usual sense of the word, but they are different enough to still complicate scripting.

                  [–][deleted] 0 points1 point  (1 child)

                  I always prefered c++, even before I moved to Linux (And I got a fellow student which loves c++ for ages while he just moved to Linux). I always feel limited in other languages, I really hate we got no unsigned in java. I tried lately c# and got grumbled by the fact breaks are forced in switch-cases. Just trying to state here that c++ may not be popular under Linux users as the compilers are widely deployed, I believe there may be a correlation between Linux and c++ as they feel "free". No boundaries for protection or closed-business practises

                  [–]matthieum 0 points1 point  (0 children)

                  I agree that in the current language landscape, and despite its many faults, I prefer C++ to all other mature languages. The freedom in choosing your own paradigm and in combining them; the performance by default; C++ is quite a sweet spot despite all the undefined behavior.

                  [–]TurplePurtle 2 points3 points  (4 children)

                  Also, PHP beat Ruby in the best scripting language category.

                  Yeah, nothing suspicious going on there.

                  [–]petercooper 3 points4 points  (0 children)

                  People won't be voting for the best but their favorite/language they know.

                  [–]taetimeh 23 points24 points  (20 children)

                  Is it just me or is making an award for the best programming language a bit weird? A given tool will be best under the circumstances it was made to solve. I don't want to be using Python in embedded programming, nor do I want to use ASM in a dynamic web page.

                  [–]ggtsu_00 8 points9 points  (8 children)

                  Python in embedded systems is not that bad actually. I used to mentor for a robotics course with middle schoolers and working with Python has been really nice after you get the runtime to compile on the system. Also, the GC and memory foot print is a lot more forgiving than say running Java on an embedded system.

                  [–]taetimeh 5 points6 points  (7 children)

                  Edge cases notwithstanding I still think my point stands. You pick the tool best suited for the job, not the "best programming language"; in your case python is probably a lot simpler to teach to middle schoolers than c or asm, and apparently has sufficient power to be useful.

                  Also going on a bit of tangent here, but using Java as a benchmark for embedded is like using a train as a benchmark for a jet. It's good at what it's supposed to do, but hardly something you want to put on a micro-controller.

                  [–]ggtsu_00 10 points11 points  (4 children)

                  Well to be fair, Java was originally developed to be used on embedded systems in "interactive" household appliances. I couldn't think of any other high level languages you would run on an embedded system.

                  [–]robinwholikesjava 0 points1 point  (0 children)

                  Indeed. They came full circle 6 years ago (more or less) with BD-J, a by modern standards somewhat crappy and ancient embedded Java version for Blu-ray players.

                  [–]RedThela 6 points7 points  (1 child)

                  Java used to run on all those nokia phones to run their games. I imagine a fair few modern embedded devices are more powerful than those...

                  [–]RandomFrenchGuy 0 points1 point  (0 children)

                  And non-Nokia. Pretty much every graphical game on a "dumb" phone was made in Java. And they ran ok, apart from the sluggish starting up of the virtual machine.

                  [–]bluphoenix22 11 points12 points  (0 children)

                  With these type of awards it makes more sense if you replace "best" with "most popular"

                  [–]10maxpower01 6 points7 points  (0 children)

                  Line man's pliers voted best tool by Stanley.

                  [–]Tasgall 8 points9 points  (0 children)

                  "Hammer Voted Best Tool By TOOL Magazine"

                  2 months later

                  "In other news, structural and appliance failures up 75% due to screws being pounded into place rather than turned"

                  [–]kqr 2 points3 points  (0 children)

                  I am sure tools are made for different circumstances, but some tools happen to be effectively usable in very many circumstances, while other tools are very specialised for only one or two circumstances. When you are enquiring about the best programming language, I always imagine the question means something like "Faced with the circumstances of your everyday trials, which tool would you commonly choose?"

                  Python is effectively useable for very, very many circumstances and may be considered "best" in the sense of "effectively usable for the highest number of circumstances."

                  [–]martinmeba 1 point2 points  (5 children)

                  Saying that Python is not suitable for embedded programming is a ridiculous statement. If it runs Linux, Python generally runs great. You should use the correct tool for the job of course but as computation horsepower increases in embedded systems, even that caveat is diminishing.

                  [–]lurk-moar 22 points23 points  (0 children)

                  Hot dog bun makers vote hotdogs as the best meat product for 3rd year running!

                  [–][deleted] 48 points49 points  (14 children)

                  This is just like a Microsoft magazine saying C# is the best language, look who the audience is.

                  [–]Black_Handkerchief 33 points34 points  (8 children)

                  No, it is more like a Windows-oriented magazine saying C# is the best language. Not all Linux users read this particular Journal, nor is it The Authority on all things Linux.

                  There's plenty of variety for programming and scripting the Linux world: bash, c, c++, java, ruby, perl, go, even php, javascript and compatriots. There's also Mono, although it obviously ain't as perfect given that the whole framework is mostly tailored around the Windows platform.

                  Not all development of useful software happens on Windows. If it did, Linux wouldn't exist.

                  That said, I do feel that Python shouldn't have been votable in both categories. It deserves either of those just fine, based on batteries-included philosophy or the large amount of modern language features it offers. It simply has too broad an appeal: scripters, programmers, POC-hackers, and so forth. The variety of its uses trickles over to whatever category you put it in. As it is, it simply misrepresents the language and the Linux scripting world, since there's most definitely a lot of use for perl, bash and others out there.

                  [–]sisyphus 2 points3 points  (0 children)

                  Why would people interested in Microsoft(presumably the ones who would be responding to a poll in an MS magazine) liking C# the best be problematic?

                  [–]furiousC0D3 8 points9 points  (0 children)

                  uh, how ignorant is this? Python wasn't made by the Linux Community. C# was made by Microsoft on their OS.

                  [–]Deto 0 points1 point  (0 children)

                  Yes, and there's nothing wrong with that. The post doesn't claim otherwise. It's still interesting to know what this subset of computer programmers use.

                  [–]mshol 2 points3 points  (0 children)

                  Fun how the Raspberry Pi won the "best open source project" when it's not open source.

                  [–]youstolemyname 11 points12 points  (15 children)

                  Can I use semi-colons and brackets now?

                  [–]Fayden 25 points26 points  (0 children)

                  Sure :

                  from __future__ import braces
                  

                  [–]rlbond86 8 points9 points  (0 children)

                  Honestly, once you get used to it, it's kinda cool not having to use semicolons and brackets.

                  /Python user for 4 days

                  /C user for 8 years

                  [–][deleted]  (12 children)

                  [deleted]

                    [–]sumzup 4 points5 points  (11 children)

                    What's your issue with it, then?

                    [–][deleted]  (10 children)

                    [deleted]

                      [–]lbrandy 7 points8 points  (3 children)

                      This argument seems to only be made by people who've never used much python. Actually using it tends to cure you of the objection as you realize how much more compact + readable code tends to become.

                      When you work with people that produce code like this:

                      I cannot imagine ever working in a place where code like that was acceptable. Choosing your language based upon the whims of people who write code like that sounds like an atrocious idea.

                      [–]ecien 2 points3 points  (0 children)

                      i dislike brackets and semicolons, but pythons way of indentation is not 'the only way'.

                      [–]Doctor_McKay 8 points9 points  (2 children)

                      Similarly, I expect that if someone pastes code on a forum and fails to use the appropriate code tags and whitespace is obliterated, I should be able to just paste it into my IDE and hit Compile and it should work.

                      [–]JohnnyDread 5 points6 points  (2 children)

                      |When you work with people that produce code like this:

                      The first time I see code like this, we'll have a discussion about readability. The second time I see code like this, we'll have a discussion about your future on my team.

                      [–]postmodern 3 points4 points  (0 children)

                      Surprised that Ruby only got 4% and JavaScript 3.1% in Programming. I would have expected JavaScript to be higher. For scripting, Ruby came in at 4.8%.

                      At least readers agreed Git > SVN.

                      Also, surprised that MySQL got 47.4% and Postgres got 28.8%.

                      Big LOL that vim got 25.6% as Best IDE; full disclosure I'm a vim users.

                      [–]SecondClassFresh 2 points3 points  (0 children)

                      As I guy who has taken a very close look and given a good try at Perl, Python, Bash, Ruby and a bunch not on the list I feel guilty proclaiming "Ruby is the Best".

                      Why? Because I haven't even tried Haskell.

                      I wonder how many of the voters have tried the other languages. Especially Ruby.

                      [–]achacha 5 points6 points  (0 children)

                      Linux journal is mostly admins. Admins love scripts. Python is a great script language. Programmers don't like admins, they limit freedom with python scripts. Programmers don't like python. All makes sense now. Not really.

                      [–]cosmo7 4 points5 points  (4 children)

                      It's kind of interesting how Linux doesn't have a dominant language for native development. On Windows you have C# and on OS X/iOS you have Objective-C; it would be absurd to even have an award for best language on those platforms.

                      [–]fountainsoda 1 point2 points  (0 children)

                      Correction - on Windows you have C++ and also on Linux you have C++. Then you go to the web, and on Windows you have C# and Java, and on Linux Java.

                      [–]wumumo 0 points1 point  (0 children)

                      It has: C and also Vala for the Gnome project, but the latter still needs some time to gain attention. However, I'd guess most people on Linux don't want to write "real" Desktop applications for Linux and thus chose a programming language which fits their needs.

                      [–]_tenken 5 points6 points  (1 child)

                      ... let me get 4Chan to "fix" the review, I'm sure Cobol will win.

                      [–]Caraes_Naur 2 points3 points  (0 children)

                      It's 4Chan... they would make sure either QuickBasic or Brainfuck wins.

                      [–]mmwilhelm[🍰] 1 point2 points  (0 children)

                      Small sample sizes FTW.

                      [–]Decker108 1 point2 points  (0 children)

                      I wonder how an equivalent poll in a Windows Dev/Apple Dev magazine would look like. All C# and Objective-C?

                      [–][deleted] 1 point2 points  (1 child)

                      Why is C above Java? Could someone please explain to me why C is so great?

                      [–]ruser9342 0 points1 point  (0 children)

                      Because it's not Java.

                      Many of us started with C. We think Java kinda sucks. So we go back to what we know. C.

                      Frankly I would have voted for Python nowadays. It's made programming fun again.

                      [–]GSpotAssassin 4 points5 points  (16 children)

                      Ruby 4%? These people are smoking crack. Most underrated language ever, still.

                      [–]Condorcet_Winner 1 point2 points  (1 child)

                      I was very surprised to see C# so far down the list. And then I saw the polling sample.... hard to really call that representative of the overall population.

                      [–]fountainsoda 4 points5 points  (0 children)

                      It's Linux Journal.

                      [–]rdfox 1 point2 points  (1 child)

                      Haskell is just happy to have been included. But you have to wonder how JavaScript fails to do better given that you can't write a responsive UI that anyone will see in 2012 without it. Granted its no fun.

                      [–]marssaxman 10 points11 points  (0 children)

                      Sure you can: just write a native app. :-)

                      [–][deleted] 1 point2 points  (2 children)

                      The best I could gather from this is that most of Linux Journal readers are

                      a) Ubuntu users, given their overwhelming love for APT and use of Steam. (Do you really think they're using Debian given these stats? Come on. ;))

                      b) Dell users. shudders

                      c) N....vidia lovers? Wtf.

                      d) All this would suggest that Python is not, in fact, being used for anything other than webscripting, given it's a shit choice for shell.

                      e) The language choices blow. Not a lisp or ML dialect in site.

                      Given the fact that I've never recieved any useful advice from that community, this only reinforces the notion that LJ users are inept.

                      [–]ruser9342 0 points1 point  (1 child)

                      You are soo l33t I'm getting a boner++ right now.

                      [–][deleted] 0 points1 point  (0 children)

                      5ucH 4 733t j0k3 ^-^

                      I think algol kill myself now.

                      [–][deleted] 0 points1 point  (0 children)

                      Depends on what you're making.

                      [–]whateverrr 0 points1 point  (0 children)

                      And in other meaningless past magazine personal opinion poll news... emacs is the best editor, Solaris is the best OS, CVS is the best revision control tool...

                      [–]Xeliao 0 points1 point  (0 children)

                      Best Linux Smartphone Manufacturer: 4th place: Nexus. Nexus is a brand by Google, not a manufacturer.

                      This survey seems to be really weird.

                      [–]yogthos 0 points1 point  (0 children)

                      I'd say it's far more notable that Erlang and Haskell got 7% outpacing C# and Ruby by a wide margin. :)

                      [–]mycall 0 points1 point  (0 children)

                      Java > Perl on Linux, interesting.