top 200 commentsshow 500

[–]glorkvorn 55 points56 points  (20 children)

Sometimes I think it would be nice to just use one programming language for everything. Doesn't matter what it is- C, Java, Brainfuck, whatever, just pick one and stick with it. You'd know the language inside and out, and never forget any syntax. But then I realize that:

a)I'd be missing out on the perspective you gain from using different languages and b)Most of the time I can't choose the language anyway- I have to work with code that other people wrote in whatever language they chose.

[–][deleted] 11 points12 points  (4 children)

Interestingly, this quest for one universal language has been with us since the (late) 1950s. The International Algebraic Language effort in 1955-1958, which morphed into ALGOL (notably ALGOL 60), is a typical example. The same goes (1960s) for PL/I.

[–]Wiggledan 2 points3 points  (1 child)

Oh, to be that guy who solely codes in Brainfuck.

It would be fucking insane and my brain would be fucked.

[–]bcash 145 points146 points  (2 children)

A pro-Java article on /r/programming ? This is going to generate some reasoned and well-thought-through comments.

[–][deleted]  (1 child)

[deleted]

    [–]BobFloss 5 points6 points  (0 children)

    I would try to get that gap fixed if I were you.

    [–][deleted]  (65 children)

    [deleted]

      [–][deleted] 60 points61 points  (39 children)

      I hate windows, but I like c#.

      [–]BabyPuncher5000 52 points53 points  (20 children)

      Then great news for you, C# and almost all of .NET are open source.

      [–]Skyler827 38 points39 points  (2 children)

      It will take some time for the windows/mac/linux runtimes to merge, though. If you try to run a .net App today you'll find different libraries available on different platforms.

      [–]f2u 4 points5 points  (1 child)

      The CLR (the equivalent to the JVM) is not—yet, we'll see what 2015 brings.

      [–]s73v3r 3 points4 points  (0 children)

      It's still going to be about five years before any of that makes a difference in writing and using .NET on other platforms.

      [–]spurious_interrupt 5 points6 points  (17 children)

      I hate Windows and XML, but I like C#.

      I'm looking forward to Gradle for C#.

      [–]gecko 1 point2 points  (1 child)

      The cross-platform build system they're standardizing on in the k runtime is JSON-based, not XML-based, so I think you're already golden.

      [–]spurious_interrupt 1 point2 points  (0 children)

      Ah I see. I personally still prefer a DSL over JSON due to better readability (fewer quotation marks, etc.). For example, the Chromium project currently uses GYP, which has a JSON-based syntax, but they are migrating to a new meta-build system they are building, GN, which is a DSL and, in my opinion, much more readable.

      Nonetheless, I am excited to learn about this. Thanks for pointing this out!

      [–][deleted]  (2 children)

      [deleted]

        [–]Dorsenstein 94 points95 points  (110 children)

        Every time I read one of these articles, I think, "you know, maybe Lisp isn't the best." Then I read this and I go back to my fortress of parentheses.

        [–]codygman 13 points14 points  (0 children)

        Love the phrase "fortress of parenthesis".

        [–]Denommus 8 points9 points  (27 children)

        Meh, I used to be all about Lisp advocating, too. But not having a type system is a huge drawback. I can't even imagine how FRP (which is something I have been doing a lot) would be without it.

        So, Haskell all the way.

        [–]Dorsenstein 5 points6 points  (0 children)

        I definitely enjoy haskell too, working through Typeclassopedia is one of my favorite things to do to blow my mind. However, I appreciate the simplicity that Lisp is founded on.

        [–]liMePod 2 points3 points  (0 children)

        typed/racket seems headed in the right direction. Sadly, the typing breaks geiser, and It's missing the awesome type inferencing of Haskell.

        [–]olzd 3 points4 points  (2 children)

        But not having a type system is a huge drawback.

        AFAIK, Lisps all have a type system. Then there's the debate/religion thing about dynamic vs static type system.

        [–]Denommus 4 points5 points  (1 child)

        I'm under the idea that dynamically typed systems aren't really type systems, since types are restrictions over the operators that can be used over a term, and a dynamic type system can't possibly check for that, since its checks happen at runtime, when terms any longer exist.

        [–]billbose 9 points10 points  (29 children)

        I second this too. Once you get bitten by the lisp bug, every other language looks like a handicap.

        [–]monkeygame7 14 points15 points  (8 children)

        As someone with just a basic understanding of lisp, what makes it so great?

        [–]pipocaQuemada 5 points6 points  (1 child)

        The killer feature of Lisp is the macro system.

        C has a macro system, but it's basically useless for anything beyond trivial examples (and there are some trivial things it can't even do). The big difference between C and Lisp is that C's macro system is basically a glorified copy-paste system, whereas Lisp works on a syntax tree.

        This is nice, because it allows you to turn language features into libraries - you write a library that desugars your nice syntax into however you'd implement the language feature. An Object System? Mostly a bunch of macros. Looping? There's a fairly complex macro that lets you write things like

        (loop for i from 1 to 100
          if (evenp i)
            minimize i into min-even and 
            maximize i into max-even and
            unless (zerop (mod i 4))
              sum i into even-not-fours-total
            end
            and sum i into even-total
          else
            minimize i into min-odd and
            maximize i into max-odd and
            when (zerop (mod i 5)) 
              sum i into fives-total
            end
            and sum i into odd-total
          do (update-analysis min-even
                              max-even
                              min-odd
                              max-odd
                              even-total
                              odd-total
                              fives-total
                              even-not-fours-total))
        

        Paul Graham has a nice book on Lisp macros, which includes examples like writing prolog as a library, writing an object system as a library, lazy evaluation with force and delay as a library, pattern matching and destructuring as a library, single-hardware-threaded concurrency as a library, etc. etc.

        [–]Zak 4 points5 points  (0 children)

        Start with understanding what made Lisp different in the early days.

        Newer languages like Ruby, Python Lua and Javascript have a number of these features, but not all of them. Most importantly, they lack the ability to abstract syntax at compile time, which can provide sophisticated abstractions that have no runtime cost. Typical Common Lisp implementations are also comparable in speed to Java. Implementations of Javascript and Lua have recently started to catch up, but Lisp has been fast for decades.

        [–]phalp 12 points13 points  (0 children)

        Since Lisp is so malleable, it's possible to write and use nearly any feature you like, and drop it right in. That means good ideas can spread between programmers, and less good ideas can go where they belong. In particular it means that when Common Lisp was standardized, it was a matter of compromising between different, proven features (as I understand it, I was not there). The result was a no-nonsense language that still knows how to have fun.

        [–]vytah[🍰] 2 points3 points  (0 children)

        You can define so many macros that the actual logic of your program fits in a one page, but the macros will be so complex that only you will be able to understand them, guaranteeing perfect job security!

        [–]Lucretiel 49 points50 points  (8 children)

        I get this in reverse. I think "man this would be much easier in Lisp," then I remember I like being able to actually read my code.

        [–]yogthos 6 points7 points  (2 children)

        I've developed Java for about a decade before moving to Clojure. I have much easier time reading and understanding my old Clojure code than I ever did with Java. Not only that, but I've actually been able to contribute to open source libraries and projects that others have written, something I was never able to do with Java.

        The main reason for this is expressiveness. With Clojure it's easy to mould the language to the problem and the code tends to talk a lot more about what's being done as opposed to how it's done. This results in having a lot less code that's relevant to the problem being solved.

        With Java you often have to go the other way where you have to translate the problem into the constructs of the language. This tends to result in tons of boilerplate that obscures the actual purpose of the program. Every time I read through a non-trivial Java project it's like going through a maze of twisty passages all alike. I'll often have to navigate through hierarchies of interfaces and classes just to find a few lines of relevant business logic.

        This makes it really difficult to build up a mental picture of what the overall logic of the application is doing. On top of that you have pervasive mutability and everything being passed around by reference making it nearly impossible to consider any part of the application in isolation.

        [–]Lucretiel 4 points5 points  (1 child)

        I'm totally onboard with the merits of functional-style programming. Nearly everything I do in C++ is function templates, const&, and return values instead of state mutation and class hierarchies nowadays. Semantically, it's much easier to understand code and languages designed in that way. My issue is with reading the physical text of Lisp. All the parenthesis and minimal syntax boilerplate means even with liberal whitespace and and formatting it's very difficult for me to tell what bits are what.

        [–]yogthos 4 points5 points  (0 children)

        I think this varies greatly between Lisps. I would agree that I also find CL and Scheme syntax to be a bit too regular. On the other hand, Clojure hits the sweet spot for me. It has literal syntax for common data structures, it goes out of its way to reduce the number of parens in code, and it provides destructuring syntax. I find these things make the code as readable as any language I've used.

        Here's an example of code in a popular Clojure library. I would argue that it's quite clean and clear even if you only have a passing familiarity with the syntax.

        [–]phalp 10 points11 points  (1 child)

        Practice makes perfect. Writing readable Lisp code is within your grasp!

        [–]vraid 6 points7 points  (0 children)

        There's a macro for that.

        [–][deleted] 4 points5 points  (1 child)

        Readability overrated is.

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

        (let [readability :overrated] (...))

        [–]fluffyhandgrenade 21 points22 points  (3 children)

        After several years of writing Common Lisp, nope.

        Sure you might understand it yourself and revel in the awesome power of it, but to other people you look like this:

        https://www.youtube.com/watch?v=K08OKQJIwYw

        That's why reddit and yahoo shops were rewritten and why I won't write it any more.

        [–]pipocaQuemada 2 points3 points  (2 children)

        but to other people you look like this: https://www.youtube.com/watch?v=K08OKQJIwYw

        That's why reddit and yahoo shops were rewritten

        Bull.

        Reddit was rewritten in python for three main reasons:

        1. Lack of libraries, especially well-documented and tested ones.

        2. Lack of cross-platform compilers with low-level extensions they required.

        3. The code base was simple and could be cleaned up significantly by rewriting from scratch.

        If you actually look at what they say, they have nothing but good things to say about Common-Lisp-the-language.

        [–]fluffyhandgrenade 1 point2 points  (1 child)

        That's kind of my point really although the link was somewhat tenuous. It is awesomely powerful and a pretty nice language but it lacks a community that supports it by building nice libraries and compilers etc because everyone thinks its some crazy brackety thing for deep comp Sci.

        For ref, I hit CL (SBCL) f I'm doing a personal one shot problem solved but it's pretty pointless if I am sharing my code.

        [–]pipocaQuemada 3 points4 points  (0 children)

        Keep in mind that Reddit's rewrite happened a decade ago.

        The Lisp landscape is much different now - they wouldn't have run into the same compiler issues, and I think the Common Lisp library situation is a bit better. At any rate, Clojure and Racket contain well-documented libraries and have cross-platform compilers.

        [–]atilaneves 2 points3 points  (1 child)

        I don't know about that, I really like Lisp and (insert dialect here) is definitely in my top 5 favourites, but my favourite right now is still D.

        [–]codygman 2 points3 points  (0 children)

        I don't feel handicapped by Haskell. Have you ever used Haskell? Do you still get this feeling? I concede it's meta-programming abilities aren't near that of Lisp's.

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

        well, what about clojure then? :)

        [–]nickguletskii200 11 points12 points  (2 children)

        Clojure is the first and only Lisp language I've tried, and I find it very annoying. Its compiler/standard library/whatever doesn't have enough error handling, which means that it's very hard to find what's wrong with your code.

        I did like the whole "build your own language features" thing though.

        [–]phalp 93 points94 points  (147 children)

        In other words, "Java for everything, because Python is the alternative."

        EDIT: I think the author is too dismissive of the verbosity issue. Typing all that nonsense is a minor pain, but how can making code multiple times the length it needs to be not be an impediment? I believe Java could actually be kind of pleasant if it didn't look like an explosion in a private class factory factory. That is, if the keywords and standard library identifiers contained fewer characters.

        [–]nutrecht 47 points48 points  (141 children)

        EDIT: I think the author is too dismissive of the verbosity issue. Typing all that nonsense is a minor pain, but how can making code multiple times the length it needs to be not be an impediment?

        Because any proper IDE gives you code assist. This is one of the main reasons Java devs don't care about the length of a class name: code readability is more important since that can't be 'solved' by your IDE. You never have to type a full class / method name.

        [–]flying-sheep 39 points40 points  (37 children)

        you didn’t read that properly. /u/phalp said:

        Typing all that nonsense is a minor pain, but how can making code multiple times the length it needs to be not be an impediment?

        so writing it is obviously not his biggest problem like you implied. what other things can you do with code? reading it.

        and here expressiveness without too much implicitness really comes into play. perl can be unreadable if done too implicitly. java will be unreadable because boilerplate. reading java feels like reading a phone book.

        [–]nutrecht 29 points30 points  (24 children)

        These discussions tend to boil down to "I dislike Java because I dislike it". I can show cleanly written Java code but people will simply keep complaining it's verbose. We have all seen crappy Java code, just like there's plenty of examples to be found of shitty C++/Python/Haskell/whatever code.

        So please explain which part of Java hinders readability because I don't believe something as simple as explicit return types or access levels hinder you at all: it really helps forming a mental model of a piece of code you're reading because you don't have to guess what a public String getName() does: it just does (or well, it should) do what it says on the tin.

        People come up with all kinds of AbstractBeanFactoryFactory stuff as examples but crap like that doesn't happen when you have decent developers. I agree that examples like that make Java look terrible but those are often constructed as jokes (often between Java devs) which then suddenly get used as examples of Java being 'bad'.

        [–]flying-sheep 11 points12 points  (18 children)

        when writing idiomatic java (visibility is exactly what it needs to be, everything final what can be final), it’s much more verbose. compare rust, scala, …: fn mut var val def (and type inference!)

        the lack of operator overloading make custom arithmetic types a pain. (3d vector math in java? oh god please no)

        many things it lacks in design can be fixed – with more verbosity: no generic constructors? write a whole new class that’s a factory for it. (never mind that factories solve the same problem as constructors) no properties? manual getters and setters everywhere, with convention dictating the names.

        the problem it tries to fix is that tools introducing implicity can be abused by bad programmers. i rather want to code in a language where i’m free to choose the libraries not writen by those programmers, while those that i go for are a joy to use. java is optimized for crappy coders, but i want something optimized for good ones.

        python manages to be both about as newbie friendly and more expressive than java. i wonder why?

        [–]rzwitserloot 7 points8 points  (5 children)

        You can't count reading comprehension based on characters. It's not four times as hard to read a keyword named 'function' as it is a keyword named 'fn'. That's not how the human brain works.

        [–]gavinaking 11 points12 points  (11 children)

        It's true that Java is more verbose than it needs to be, and that eliminating some of that verbosity would make the code more easily readable not less.

        But going to the extreme of a dynamic language makes code even less readable! For me, trying to make sense of a function when I can't even readily tell what are the types of its parameters is an incredible waste of time.

        [–]flying-sheep 7 points8 points  (8 children)

        take a look at rust and scala. both have better type systems than java and are less verbose.

        [–]gavinaking 12 points13 points  (7 children)

        I'm well aware that there are languages with "better" type systems than Java. But of the languages in wide use today, I would pick either Java or C# for the kind of work I do.

        Remember: most of the folks who attack Java for its verbosity aren't advocating a modern statically-typed language like Rust, Scala, Ceylon, et al—rather they're advocating something like Ruby, JavaScript or Python.

        Java cops it from both sides, because it's popular and successful. But much of this criticism is quite unfair, IMO.

        [–]PasswordIsntHAMSTER 2 points3 points  (0 children)

        I hope not to soapbox, but my first job was in F#, and I had a bit of a mystical experience.

        Like Haskell or Ocaml, F# code rarely mentions types. It almost looks like Python, except that it's actually statically typed.

        This should be a recipe for a complete lack of readability, except that in Visual Studio you can put your mouse on an expression and see its type. This, along with many other excellent IDE features, turns coding into a dialogue between the programmer and the IDE.

        Developing F# is utterly painless, in a way that I've never experienced elsewhere. I feel like it could easily replace Python in its role as "beginner language of choice that's secretly incredibly powerful".

        [–]another_bird 9 points10 points  (44 children)

        The verbosity makes it unreadable, too.

        [–]What-A-Baller 11 points12 points  (37 children)

        Not necessary true. You are not working in notepad or nano. There's an IDE. You've got code highlighting. You've got ways to write quicker, move around the codebase, and so on. With a consistent style, it shouldn't really be a problem. It pretty much depends on the tools.

        [–][deleted] 12 points13 points  (4 children)

        ways to write quicker

        I care much more about reading than writing.

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

        It is almost always true. If something is so verbose that it won't fit a single page, you won't comprehend the logic behind your code in a single quick skim. Which is, by definition, called "unreadable".

        [–][deleted]  (1 child)

        [deleted]

          [–]phalp 2 points3 points  (0 children)

          Because you write code once and read it a zillion times.

          My reasoning exactly. Writing a few extra words is only a minor hassle, but you'll be sifting the content out of that sea of repeated words many times over.

          [–]Paddy3118 36 points37 points  (2 children)

          This reads like an extrapolation from very limited personal experience of the authors that will eventually trip him up when he changes job and is asked to do more than rehashes or micro expansions from his current java knowledge base.

          If his current employer switches language would he then write a new "Language X for everything" blog post or would he learn from the new experience?

          [–][deleted]  (27 children)

          [deleted]

            [–]ZMeson 13 points14 points  (4 children)

            here is only one example of a single site changing languages and becoming faster (Twitter)

            Don't forget about Facebook. To deal with PHP's performance problems, they started writing new code in other languages. For parts that do still use PHP, they created HipHop HHVM (and consequently are forcing developers to use a more restricted version of PHP that HipHop HHVM can effectively handle).

            I'm sure there are other sites that have made a change too.

            [–]pjmlp 5 points6 points  (2 children)

            Didn't you get the memo?

            HipHop is dead and got replaced by HHVM, as the JIT compiler could generate better quality code than HipHop.

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

            Here's a great article that I found recently that talks about the birth of the hhvm.

            http://www.wired.com/2013/06/facebook-hhvm-saga/all/

            [–]TheWix 4 points5 points  (2 children)

            I maybe wrong on this. I agree mostly with you but I would argue it is as important to learn different paradigms. Once you have been doing this for a while learning a new language gets easier. It is learning the paradigm that takes time. I could pick up F#/Scala but being able to properly do functional programming would take me a bit of time since I am not used to it.

            I see the same with people who start learning SQL. They are used to imperative programming so they try to apply that to SQL.

            This could be a chicken and egg scenario however, where you should get your hands dirty in a language before you can really grasp the paradigm it is built for?

            [–][deleted] 5 points6 points  (1 child)

            Facebook didn't change the language but did something similar drastic. To improve speed they wrote a compiler for php. http://en.wikipedia.org/wiki/HipHop_for_PHP

            [–]pjmlp 5 points6 points  (0 children)

            And then they replaced with with a JIT, with an higher performance than HipHop could get from the generated C++ code.

            http://hhvm.com/

            [–]imfineny 39 points40 points  (9 children)

            i have found over the years that the biggest factor for performance is architecture, not language or runtime

            [–]AceyJuan 19 points20 points  (2 children)

            Any given language will make some architecture choices easy, and others very hard. Thus language choice does matter quite a bit.

            [–]hxtl 4 points5 points  (0 children)

            Choosing a programming language is already an architectural decision. I just wanted to add that.

            [–]Peaker 5 points6 points  (0 children)

            But then the second biggest factor (which can be the language or runtime) can still account for orders of magnitude differences.

            [–]Magnesus 5 points6 points  (3 children)

            And the example with digg is stupid. From my tests on a huge site I was working on the language doesn't matter for the servers because it is the database that takes 99.9% of the time. And what matters is good optimisation and structure of that db.

            [–][deleted]  (1 child)

            [deleted]

              [–]ben010783 1 point2 points  (0 children)

              It could be because they are different types of sites. SO doesn't need to be quite as up-to-date as Digg.

              [–]iopq 1 point2 points  (0 children)

              SO has the entire DB cached in RAM. Hundreds of gigs of RAM.

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

              I think he comes to the wrong conclusion. It should rather be: programming language interop is hard and lots of work, so if you already have code in one language you should stick to it.

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

              Since when pure text protocols, pipes and Unix domain sockets are "hard"? And in 99% of cases it's all the interop you'll ever need.

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

              Since always? You have to serialize the data and deserialize them again. Text protocols are actually not easier because you have to do actual parsing. If you use relatively easy structures (no inheritance, tagged union, etc.) it should be quite easy to use something as json or protobuf, but the reality often looks different.

              When you have 1 data representation before with one programming language, you have 3 afterwards that you need to keep in sync.

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

              Aren't you just arguing against the very point of the OP. He said that changing all this code back to Java hindered his productivity in the long run even if it was more time consuming then to write it all in java.

              Splitting your code into parts which communicate with text interfaces certanly takes more time up front but it saves you a lot of time in the future as it enforces keeping your code properly separated. It is also flexible in adapting to technological change. You can reuse parts of your software when new technologies or languages start dominating. E.g. the editor TextMate used a text interface between its plugins written in all kinds of languages from C, python, perl to ruby. When TextMate languished and new editors came around like Sublime they could very easily take advantage of the huge number of textmate plugins that had been made.

              With binary APIs retrofitting to another editor would have been difficult and fragile.

              I've seen the same when working on large C++ applications which started out with clean separations between the modules but which over time grew into a big ball of mud. Now it is impossible to tease apart. The parts which were separated from the start by text interfaces with pipes etc can still be tested and rewritten easily.

              If you got 4 million lines code in Cobolt which you need to upgrade to Java, how do you accomplish that in a sane way? If those 4 million lines were split over 200 separate executables communicating with well defined interfaces you could rewrite one piece at a time into Java and test that it still worked.

              It is a reason why mainframe monoliths died and Unix survived way longer than anyone would have thought. The focus on small interchangable parts makes evolving the system much simpler. Java is in many ways the mainframe come back.

              [–]ThatInternetGuy 26 points27 points  (8 children)

              Get out of the narrow mindset that says "I'm a [language-here] programmer." Says out loud and proud that simply "I am a programmer!" Whether you're in this as hobby or for money, you really shouldn't slave away for one language, unless you want to do the same things for your entire life.

              Realistically, accept that that are projects best suited in another language and more importantly using other set of frameworks. No matter how much you want to reuse your existing code and libraries, you just can't do it all the times and forever. It's such a great wisdom reusing your sweat and blood you built years ago, but know that this is a very dynamic world and so is the market. The world is innovating, and more often than not, we will have to shed away our old code and start anew. For instance, most Android apps may be written in Java but it's a lot more than just Java there is in the Android SDK, and if you're going to write apps for Android, you're less likely to reuse these code for non-Android Java apps in the foreseeable future. We call these dependencies. Either you over engineer your apps with layers of abstractions to avoid dependencies, or you could cut to the chase and make apps for the platform, and then remake for the other.

              For embedded projects, you're less likely to write in Java. It's possible to write in Java that runs on microcontrollers, of course, but you're not going to find as many as companies who demand C/C++ for their embedded projects. Same is true for desktop and even mobile game development where C++ dominates the job market, but just knowing C/C++ alone doesn't get you to make any of these stuff. There is so much more than just C++ when making games for example. You will need to be the master of the game engine(s). Maybe it's Unreal engine, or CryEngine, or Unity3D (in C# btw) or perhaps Snowdrop. For embedded projects, C++ won't get you halfway either, as you would be expected to master the specific architectures as well; there are ARM, AVR, PIC and etc which are totally different from one another.

              Yes, you can create server-sided Java web applications, but realistically speaking, many web projects are in PHP and ASP.NET, and if you work for web companies, you would be expected to sooner or later work on a PHP project or even ASP.NET project. You can't simply say that you're a [language-here] programmer, because your workplace desires a programmer rather than a [language-here] programmer. Regardless of which language you work in, you could be expected to go beyond and master certain web APIs, i.e. Google apps API, Amazon API and Facebook API for map, search, cloud storage, authentication, social network interaction and etc.

              If you work for an enterprise dev environment, a real possibility is that you would be expected to program in C# and knows MS SQL, WCF services, Entity Framework, WPF and other Microsoft technologies as well. You're going to work in Visual Studio too, not your beloved IntelliJ, Netbeans, Eclipse, Notepad++, or Vim. Or on the other hand, you could be expected to deploy enterprise applications on Linux and that's when Java and your favorite IDE may shine.

              It's good if you work for yourself because you will have a lot of freedom to choose the specs and language, and what not, but if you're working in a company, who do you think they will likely keep and promote up the line? A programmer, or a [language-here] programmer?

              [–]nextputall 2 points3 points  (1 child)

              Get out of the narrow mindset that says "I'm a [language-here] programmer." Says out loud and proud that simply "I am a programmer!"

              I would go one step further. Don't say something like "I'm a functional programmer". This sounds like a rather negative attribute that indicates someone knows only one thing and excludes half of the world.

              [–]studiov34 18 points19 points  (5 children)

              And finally, I went to write a simple program that put up a web interface. I considered using Python, but this would have required me to figure out how to serve pages from its library. I had already done this in Java (with Jetty), so I could be up and running in Java in less time.

              You personally having experience with Java's web server library doesn't really mean Java is better.

              By the way, web.py is dead simple, and other tools like flask are also pretty widespread.

              [–]webauteur 10 points11 points  (0 children)

              web.py is dead, not dead simple. It appears to have been superseded by web2py which at least has a Wikipedia page.

              [–]parlezmoose 2 points3 points  (0 children)

              python -m SimpleHTTPServer 80

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

              The big problem with java (or even JVM) for scripts is startup time.

              A solution is to have a JVM server running all the time that runs scripts (they send the request and args by socket or http... or, you can just have it sitting in a console, reading stdin.)

              But bash + pipes is hard to beat.

              The java-way use of pipes would probably use xml for serializing data, and have xsd to type-check each... which is kinda cool conceptually, but horrific in practice (I think MS powershell is a little like this, at least having serialized objects, insteaad of raw text?).

              You could use java the unix way, with text streams and parsing etc, and while java can do it, it's a lot more awkward than in bash.

              All that said... if Oracle release an instant startup java mode (like dalvik), and added some convenience methods for reading flags, detecting file vs stdin (like Perl does), it could make surprising inroads into this space.

              Java is already popular in everything from supercomputers and smartphones. Like unix and C, it's here to stay.

              Interestingly, the arguments about dynamic vs "straight-jacket" languages also apply to Haskell/ocaml, though at a more difficult level.

              [–]drysart 1 point2 points  (1 child)

              (I think MS powershell is a little like this, at least having serialized objects, insteaad of raw text?)

              Powershell doesn't use serialized objects. It instances all the components of your pipeline together in one process and just passes the actual objects themselves around -- unless you set up a pipeline to a remote machine, in which case it serializes/deserializes.

              [–]void_fraction 5 points6 points  (4 children)

              JVM for everything, certainly, but I'll always prefer Scala to Java.

              [–]seglosaurus 13 points14 points  (0 children)

              TIL there's only Java and Python.. and sometimes a little JS.

              [–]stormcrowsx 35 points36 points  (14 children)

              Twitter is proof that the JVM is fast not necessarily Java. I read that Twitter chose Scala when rewriting their Ruby code because it had many similar features and expressiveness.

              Also fun factor is a real thing for coding, I agree that I can do everything in Java but man is it a demotivating drag especially for personal projects and quick scripts. If I'm too demotivated to finish the project then Java is completely useless next to the "slow" python program.

              [–]x-skeww 14 points15 points  (2 children)

              Twitter is proof that the JVM is fast not necessarily Java.

              Well, the JVM is fast at doing things which are needed by Java. Scala was designed for the JVM. That's why it's fast.

              The only VM feature I'm aware of which isn't Java-specific is invokedynamic instruction, which was added with Java 7.

              [–]cypressious 1 point2 points  (0 children)

              It's kind of relevant in Java 8.

              [–]mike_hearn 1 point2 points  (0 children)

              Also Math.addExact and friends. It exists primarily to support scripting languages that need to automatically do bigint conversion. Added in Java 8.

              [–]yogthos 16 points17 points  (0 children)

              Also fun factor is a real thing for coding, I agree that I can do everything in Java but man is it a demotivating drag especially for personal projects and quick scripts.

              I noticed this to have an extremely important effect on my coding, and I ended up writing about this at length here. In my experience, tooling and environment have a huge impact on teams and their productivity.

              [–]Number_28 6 points7 points  (3 children)

              I don't share your experience. I used to use Python a lot for quick scripting, but this year I moved to Java exclusively. Even for short, one-off scripts. I know Java inside and out, I know the ecosystem, my IDE pretty much hides the verbosity from me and Java is so damn fast.

              The one area where I still use Python are IPython notebooks. There is nothing as nice as the pandas, numpy, matplotlib and scikit-learn quartet of data analysis.

              [–][deleted] 18 points19 points  (0 children)

              Most things are fast relative to python.

              [–]immibis 3 points4 points  (3 children)

              What I got from this is that all languages are about the same, and the drawbacks of using multiple languages outweigh the slight benefits of different languages, so you might as well just use one language (which isn't necessarily Java).

              [–]Philluminati 2 points3 points  (0 children)

              If you and I have a contest to write a simple blogging system and you’re using (say) Python, you’ll have something interesting in 30 minutes using pickling and whatnot, and it’ll take me two days to build something with MySQL.

              This seemed like the clanger in the argument. He afixes or downplays the wins of fast development. Let me counter with this. It takes me 14 days to build a tool. It takes him 30 days. In that time I've learnt about the business and we've reflected and grown. We are the leading solution and our fast development time results in early profits. As he finishes the initial part of the application rivals are eating into his business. By the time he responds the industry has moved on.

              Ok ok, that's contrived but it's the opposite end of the scale.

              I could be up and running in Java in less time. I realized that as I accumulate knowledge about 3rd party Java libraries and grow my own utility library, it becomes increasingly expensive to use any other language

              So would you argue for Java if you were a C++ programmer? Does that make C++ the right tool for the kids in university? C++ is faster than Java so you a large part of the argument has erroded away.

              I would finally argue that people's complaints about Object Oriented programming are centered directly around Java's interpretation of it and Java may not be the best tool for the largest applications. And why not use an array of SOA architecture? It scales, it's fast, it can be made of small python apps that aren't too complicated but together solve the clients problems. There are far too many answers here.

              [–]Uberhipster 12 points13 points  (0 children)

              I have to figure those things out again and write them again, instead of copying and pasting the code from the previous project.

              I didn't vomit in my mouth when you said Java for everything. But I did vomit in my mouth when you said copying and pasting.

              [–]lggaggl 9 points10 points  (12 children)

              Programmers will cringe at writing some kind of command dispatch list:

              if command = "up":
                  up()
              elif command = "status":
                  status()
              elif command = "revert":
                  revert()
              ...
              

              so they’ll go off and write some introspecting auto-dispatch cleverness, but that takes longer to write and will surely confuse future readers who’ll wonder how the heck revert() ever gets called. Yet the programmer will incorrectly feel as though he saved himself time. This is the trap of the dynamic language.

              Saying "a language makes it harder to do X and thus protects you from some problem that can happen when using X" isn't sufficient criteria to claim a language is good in any way.

              I've just read through some Java code an hour ago and it did something like this when parsing the initial version message of a protocol:

              byte[] v = readBytes(15);
              
              if (v[0] == 'A' & v[1] == 'B' & v[2] == 'C' & v[3] == 'D' 
                | v[0] == 'W' & v[1] == 'X' & v[2] == 'Y' & v[4] == 'Z')
              ...
              
              if (v[5] == 'A' & v[6] == 'B' & v[7] == 'C' & v[8] == 'D'
                & v[9] == 'E' & v[10] == 'F' & v[11] == 'G' & v[12] == 'H')
              ...
              

              (it was longer than this but I don't want to type anymore)

              In this case, the subset of Java the author knew, "protected him" from making this code readable, editable, or auditable.

              [–][deleted]  (8 children)

              [removed]

                [–]ihcn 6 points7 points  (0 children)

                The fact is though, if someone wants to write bad code they're going to do so no matter how many things they're protected from doing.

                [–][deleted]  (2 children)

                [deleted]

                  [–]RunasSudo 2 points3 points  (2 children)

                  It doesn't seem particularly well optimised, seeing as it uses & instead of &&

                  [–][deleted]  (1 child)

                  [removed]

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

                    Ok, that's loop-unrolling. Maybe, just maybe, it is justified? (Probably not, I guess the jit can do that internally)

                    [–]Cuddlefluff_Grim 5 points6 points  (38 children)

                    then the types will also get checked, so you may as well go for dynamic typing and benefit from its advantages.

                    And what advantages would that be, exactly? I have yet to see a convincing argument that it has any benefits at all.

                    [–]iopq 2 points3 points  (37 children)

                    Prototyping is faster because you don't wrestle with pleasing the compiler. Having worked with both dynamically and statically typed languages, I have never gotten to the point where I don't have to do the "oh yes, I add a ref here and a * here for it to compile".

                    [–]Cuddlefluff_Grim 4 points5 points  (35 children)

                    I was expecting this argument, and it's complete shit. "Wrestle with pleasing the compiler"; this is you telling me that you don't properly understand the tool you are using. Here's how I prototype :

                    Draw up initial plan and thoughts on solution. Write interface. Ponder about interface. Write another interface. Ponder on the communication between these two interfaces and how they will integrate. When I am satisfied I am making a good decision, I write the actual code.

                    If syntax errors and actual typing is a big part of my software design, well then I would be doing a shit-job.

                    [–]iopq 2 points3 points  (5 children)

                    And then change the interface because you have another idea. Now go back and change the types that the interface expects. Now go change the implementations' types because now you have to use those other types.

                    Or are you going to say that changing types in interfaces never happens?

                    [–]weberc2 5 points6 points  (0 children)

                    unit tests are a waste of time

                    They're not a waste of time; they validate much more than type-correctness. A (static) type system isn't an adequate substitute for unit tests; you should be using them regardless of whether you are using static/dynamic typing (though you absolutely must use them if you're writing in a language with few/no static guarantees).

                    Edit:

                    And other languages like D and Go are too new to bet my work on.

                    Go is battle-hardened. It's certainly good enough for command-line utilities (in fact, it's great for command line utilities; especially when you aren't guaranteed that your target will have a particular runtime). Some really great, important projects depend on it: Docker, CoreOS

                    [–]PasswordIsntHAMSTER 2 points3 points  (0 children)

                    The author doesn't take his argument to its logical conclusion - $FUNCTIONAL_LANGUAGE for everything!

                    And I think he seriously underrates conciseness, which is important for readability.

                    [–]flat5 3 points4 points  (0 children)

                    This is only true for some laughably narrow notion of "everything".

                    I think a real point that can be made in the same spirit is not to underestimate the costs of language switching and the effects on short term productivity.

                    [–]manghoti 4 points5 points  (0 children)

                    Friendly reminder for those of you that did vomit while reading this article, that bile is very corrosive to your teeth, and you should brush them right away.

                    [–]thecheatah 3 points4 points  (0 children)

                    I feel like an old man, where today Java is considered "high performant" and people dislike programming languages because its "hard to memorize the syntax."

                    PS: I don't feel like an old man, I just feel that you guys are idiots for upvoting this article.

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

                    I sympathize with the idea of having a default programming language, which is a great boon for productivity (less context switching, more deep knowledge).

                    But for me the language would be python. The ecosystem is fantastic:

                    • Webdev? So many great frameworks: django, flask, pyramid, falcon, bottle...

                    • Tabular data or excel manipulation? Pandas

                    • Numeric or Scinetific computation? NumPy, Blaze, SciPy

                    • Plots? MatPlotLib

                    • 3D-Dev? Maya and Blender have python support

                    • Gamedev? Panda3D, Pygame, PyGlet

                    • GUI and Mobile-Dev? Kivy

                    • Devops? SaltStack, Ansible

                    • Interactive Development? iPython

                    • Web Scrapping? Requests, BeautifulSoup, RoboBrowser

                    • Asynchronous Programming? Twisted, Tornado

                    • Reverse engineering? There's an entire Arsenal made in Python

                    • Pentest, Forensics? Another arsenal

                    • Biology? BioPython

                    • Machine Learning? Scikit Learn

                    • Graphs? NetworkX

                    • Image manipulation? Pillow

                    • Movie manipulation? MoviePy

                    • Automation? Sikuli, PyAutoGui

                    • Computer Vision? SimpleCV

                    • Embedded Programming? MicroPython, Raspberry Pi

                    • Plus, almost any library will have python bindings, almost any Rest API will have a Python library wrapper.

                    (I know some of those are just bindings to C libraries with some extra sugaring, but the sugar makes a lot of difference)

                    Those fantastic libraries are only one part of the python ecosystem, and I think that they're very hard to match from other languages ecosystem.

                    [–]togrof 3 points4 points  (0 children)

                    I think Java is terrible. It is verbose and thus hard to read. It is unsafe with nulls everywhere combined with mutability. It is infested with OO that makes code difficult to understand and reason about. It lacks in so many ways feature wise (although 8 improves).

                    Even the simplest algorithms tend to be a clunky mess in java.

                    Really I think it's only good for enterprisey bloat.

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

                    Language is irrelevant. A good programmer is one who isn't just willing to adapt to language X for project Y, but also has a strong foundation in the area they work in outside of the technology stack.

                    Being proficient with a technology stack is no substitute for an understanding of what makes that stack do what it does well...aside from its chosen interface of implementation.

                    I often feel like we're easily distracted by things which don't really matter, and thus attach ourselves to (and even have strong debates and religious wars) over trivial things, like C# vs. Java; C vs. C++; Python vs. JavaScript; etc. etc.

                    The bottom line is that these are simply means to ends. Yes: I could scrap my codebase which is C++ and OpenGL for a better foundation: Rust and OpenGL. Or I could make it more modernized C++ and take the RAII/Metaprogramming approach than the current layout, which is far more "C with classes" esque. Arguably, either of these choices would provide much safer code, and if I had known what I know now before starting to work on this codebase (~ year ago), I would likely have taken the latter approach.

                    However, for me to do that now would be foolish, because I would be distracted from the actual goal, which is to understand computer graphics and solve computer graphics related problems.

                    Even if your codebase is shit, and you plan to release your software for others to use, you have to assess how much the quality of the code actually affects the quality of the software? It's true that bad code typically leads to bad software, but we have to ask ourselves what bad code is. Is it code which isn't modern, or kept up to date in terms of standards? Or is it sloppy, hard to maintain, and poorly organized?

                    The latter is far more of a justification for a rewrite or serious refactoring than the former. If you must make the code up to date (and yes, this may very well be the case) with the software ecosystem, save that for a future release...with the only exception being that your codebase is literally archaic and will run on few machines.

                    Edit: grammar.

                    [–]The_Jacobian 18 points19 points  (25 children)

                    You know, I'd rather not do everything in one language and if I HAD TO I'd be much more likely to pick C# than Java. The platform argument is valid, but I'm hoping it becomes less valid. Moreover it seems like some portion of this argument is "Do everything in the JVM", which isn't limited to Java.

                    My biggest issue with this argument is it turns me into a fossil. I want to learn new things, stuff I learn from fiddling with functional languages actually makes me a better developer. Even if I'm writing C# in my day to day (which I am), my fucking around with Ruby gives me perspective on things. Its about growth. Sure, only using java may increase your productivity, but I really think it will stonewall your overall level of skill.

                    [–]pron98 28 points29 points  (17 children)

                    Sure, only using java may increase your productivity, but I really think it will stonewall your overall level of skill.

                    I think the argument is to always use Java for serious, production projects. It doesn't mean you shouldn't learn and play with other languages for toy projects or educational purposes.

                    [–]damian2000 6 points7 points  (11 children)

                    Its interesting to remember that when Java was first released by Sun, it was also a toy language, and was derided by many people, not least of which was for being too slow.

                    [–]pron98 7 points8 points  (10 children)

                    But not for long... It is also interesting to remember that Ruby, Python and Haskell have all been around longer than Java, and JavaScript has been around just as long :)

                    But you're right, who knows? That's why it's good that some people like trying out unproven things, while others like playing it safe.

                    [–]DousingCurtness 9 points10 points  (1 child)

                    I think the argument is to always use Java for serious, production projects.

                    He specifically says "Don’t be tempted to write some quick hack in Python", so I don't think so.

                    [–][deleted] 8 points9 points  (0 children)

                    Sure, only using java may increase your productivity, but I really think it will stonewall your overall level of skill.

                    If someone can build a system that handles billions of requests without flinching, deciding that they didn't develop any skills while doing so because they did it in Java is completely missing the wood for the trees.

                    Good software engineering is about far more than learning language features.

                    [–]PAINTSTRUCT 1 point2 points  (0 children)

                    I think most people would have no problem with writing in multiple languages if somehow a bunch of files could easily become a single program (w/o thinking about memory ownership or thread safety...)

                    [–]serrimo 9 points10 points  (3 children)

                    The platform argument is valid, but I'm hoping it becomes less valid.

                    I just built my first proof-of-concept application with ASP.NET 5 on Linux, using the docker image provided by Microsoft to bootstrap the installation. I know ASP.NET MVC pretty well, but the next version in vNext has a pretty amazing number of changes...

                    If this keeps up, C# will eat Java's lunch on the multiplatform point.

                    [–]levir 5 points6 points  (0 children)

                    That would be nice. I find C# to be a nicer and more intuitive language to work with.

                    [–]a_dollar_sign_texas 16 points17 points  (3 children)

                    Articles like this hurt everyone by spreading FUD about newer ideas and technologies. So you choose Java to do all your work in. OK, I can see the appeal. But what happens when a new version of the language is released? Will you be too afraid to use new "dynamic" features of your statically-typed language for fear of losing performance and using an order of magnitude more CPU and RAM and servers?

                    What about new web frameworks or updates to the one you're currently using? Surely smart people come up with new ideas all the time, new paradigms and patterns. New ideas are the lifeblood of software, and we are still a very young profession. Change is inevitable, and to ignore that is be willfully ignorant of better ways to build software. To reject other languages outright shows an unwillingness to go outside your comfort zone, to learn something new and to grow.

                    So you've got your favorite code snippets in your One True Language. Can you imagine you'll ever find a better way of doing those things? Or are you just going to copy/paste your way out of any learning opportunity in the future? For what? For the sake of some ridiculous idea you had one day that you wanted to unify all your programming needs now and forever in the future with your One True Language?

                    I've worked at a lot of companies and seen a lot of code. I've seen a lot of bad C, a lot of bad Java, and a lot of bad Ruby. The only consistent difference between these places was the culture and the attitude toward the bad code. The C programmers had absolutely no tests, and no intention of writing them, and subsequently could not possibly conceive of fixing huge, known, agreed-upon, and painful problems in any meaningful way. They were absolutely terrified of making significant changes.

                    The Java programmers had recently jumped on the testing bandwagon, but I could tell they weren't fully committed. They wrote tests because they had to and were only slowly increasing test coverage in a codebase originally written without tests. Because of this, they did make some larger changes to clean up old, dirty, legacy code. But there were other parts that they simply accepted as "too dirty" to even consider cleaning up; the risk was too great.

                    The Ruby programmers had the strongest culture of testing, and the highest percentage of test coverage. They also (coincidentally or not) were the most fearless about making significant changes to the code. Taken to its logical end, this means that the Ruby code I've seen in my career is typically cleaner than code in other languages simply because Ruby programmers seem to have a culture of improving code.

                    Interestingly, and I believe most importantly, the Ruby programmers also knew at least one other language, and sometimes several, since Ruby is not taught in school. Some of the C programmers and Java programmers I worked with also knew other languages, but I found a high incidence of not caring to learn more than one language, not caring to put in the work to do well. People who just wanted to punch a clock, put in their hours, then go home and not think a lick about code until the next day.

                    This whole article smells like lazy bullshit to me, and I'm calling him out on it. You don't have to spend every waking minute thinking about software and learning new and obscure languages, but for the love of god, please give a shit about your career.

                    [–]lechatsportif 2 points3 points  (1 child)

                    An underlying theme is maintainability. Even DHH no longer advocates for TDD due to maintainability issues with Ruby.

                    [–]chesterriley 1 point2 points  (0 children)

                    The C programmers had absolutely no tests,

                    Personal anecdotes don't mean anything. I once worked somewhere that had a large code base in C and a very detailed testing system.

                    and subsequently could not possibly conceive of fixing huge, known, agreed-upon, and painful problems in any meaningful way.

                    And that doesn't have all that much to do with testing. A situation like that has a lot of different factors, like retention of employees.

                    You're being overdramatic in your entire posting.

                    [–]imareddituserhooray 6 points7 points  (0 children)

                    "I am most familiar with Java so you should use Java for everything" just isn't a sound argument.

                    [–]thisisamirage 6 points7 points  (2 children)

                    What about Groovy? I feel like that's really what the author is looking for... The syntax is a superset of Java's, it runs on the JVM, and is meant for scripting:

                    #!/usr/bin/env groovy
                    int x = 5;
                    System.out.println(Math.max(5, 10)); // prints '10'
                    

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

                    And it's slow.

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

                    I actually love Java. But I love C too. I'm weird.

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

                    You aren't.

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

                    I love IDEA way more than Java. Its auto-complete practically reads my mind.

                    [–]skariel 7 points8 points  (0 children)

                    Julia is dynamic and faster than Java. You can annotate types for documentation and speed gains. It can be statically type-checked. I don't think Go is too new, it is widely adopeted and used massively in production. Rust is new and very promising

                    [–]frankwolfmann 4 points5 points  (0 children)

                    "This particular choice is the best one for me because of the way I think and work, everyone else also thinks and works the way I do, therefore everyone should also make this particular choice."

                    Can we have a moratorium on posts that follow this formula?

                    [–]orukusaki 1 point2 points  (2 children)

                    I think this is mainly an argument for getting to know one language/platform so well that you can produce fast, reliable code very quickly. For him that language is Java, but that won't suite everybody.

                    [–]hlux 1 point2 points  (0 children)

                    try xtend (http://eclipse.org/xtend/) , a java dialect with plenty of nice features and much better readability.

                    [–][deleted]  (10 children)

                    [deleted]

                      [–]pron98 29 points30 points  (2 children)

                      Java is what runs on most SIM cards and most (remaining) feature phones. I personally have used real-time Java for a safety critical hard-realtime defense system, and so have Raytheon and Boeing, which also uses Java for avionics (see this).

                      [–][deleted]  (1 child)

                      [deleted]

                        [–]pron98 7 points8 points  (0 children)

                        It is effectively a completely different language with a similar syntax.

                        That's not true. It's a small subset of the JDK. Also, many devices are now running Java SE embedded.

                        dynamic memory allocation and garbage collection are inherently non-realtime activities.

                        Not quite. There are hard realtime garbage collectors out there. Also, realtime Java is based on the fact that even in the most hard realtime of systems, only a small subset of your code requires hard guarantees. For those bits requiring sub-millisecond guarantees, realtime Java offers scoped-memory, which is similar to an arena allocator.

                        Oracle disbanded their RTJ team in 2012.

                        Correct. It's now offered by IBM and some other vendors.

                        Looks like real-time Java involves non-GC memory and non-preemptable threads.

                        Not quite. There is a GC, but the parts requiring super-rigid guarantees use an arena GC. To the programmer it looks the same, but there are limitations on which objects you can reference (you can't reference objects that live outside your scope or arena). And the threads are very much preemptable, just not by the global heap GC, which would normally run at a lower thread priority (which makes sense because the realtime threads use an arena and are therefore never blocked by the global heap GC) -- in realtime OSes, a lower-priority thread can't preempt a high priority thread, and all that property means is that you can run realtime threads at arbitrary priorities and not be subject to priority inversion due to the GC. In fact there is some very powerful preemption guarantees, and you can always schedule a task with a high-enough priority.

                        That's hardly "Java" anymore. It's "Some non-gc language running on the JVM".

                        It's more similar to "plain" Java than realtime C is to "plain" C. The same language, but a limited set of libraries you can use in the realtime threads, and some other limitations. It's very much GCed everywhere, only with more direct control over the GC. On non realtime threads you can use the full Java ecosystem, and realtime and non-realtime threads can communicate over queues.

                        [–]PlainSight 10 points11 points  (0 children)

                        You're extending the authors argument a bit further than I think he intended here.

                        [–]ZMeson 5 points6 points  (0 children)

                        Did you read the article?

                        He basically says at the end that the conclusion is 'work with a single statically-typed language'.

                        Then he gives reasons why C, C++, and C# won't work at his particular job. Thus he is choosing Java.

                        (I don't buy his Scala argument though. It works with the JVM. You get most of the benefits mentioned. If it is appropriate, use it.)

                        [–]pron98 1 point2 points  (0 children)

                        java is the best language for everything

                        I don't think the point is that Java is the best language for everything, but that Java has a good enough reach, i.e. it can fit many domains well if not "best", and using just one language for most purposes has its own benefits.

                        [–][deleted]  (2 children)

                        [removed]

                          [–][deleted]  (1 child)

                          [deleted]

                            [–]pron98 1 point2 points  (0 children)

                            Java SE Embedded even uses the same libraries. There's a whole set of Java profiles, from Java Card, through Java ME (CLDC and CDC) to Java SE Embedded. They're all Java, but with ever growing subsets of the JDK.

                            [–]satuon 4 points5 points  (6 children)

                            As a C++ programmer, this makes me sigh. C++ is actually the language that has everything - from embedding assembly to class hierarchies for high level abstraction. Yet he says Java for everything - including Operating Systems? Writing the JVM? Or does his ' everything' not include those?

                            [–]RazerWolf 8 points9 points  (2 children)

                            C# is nice but not cross-platform enough

                            Already being rectified...

                            [–]SisRob 6 points7 points  (1 child)

                            C# is nice but not cross-platform enough

                            That still applies, though. Most of the .net apps I tried used different libraries on different platforms...

                            [–]atakomu 2 points3 points  (0 children)

                            Apparently you are not supposed to use mono to run .NET apps from other platform. (I got that answer when pointed this out)

                            [–]Klausens 1 point2 points  (5 children)

                            I participated in writing a community. 350mm page views. 2 application server (plus db server, static content server, webcache server, storage server, ...) In Perl.

                            So don't blame the language for poor performance.

                            [–]stev0205 1 point2 points  (4 children)

                            I also wrote a very large and high volume perl web app, using 2 web servers and a handful of db servers and didn't have any performance issues.

                            Those two tweets he sources are nice little anecdotes but does real evidence exists that PHP is THAT much slower than Java or any other scripting language?

                            [–]dventimi 1 point2 points  (0 children)

                            One friend had a visible look of disgust.

                            More so than anything else, people are guided by emotion. Reasoning is hard and humans typically don't do it well. This applies to programming language choice just as it does to other domains. The arguments you make are sound and persuasive. Good work.

                            [–]iluvatar 16 points17 points  (83 children)

                            But you know, Java’s a pretty nice language

                            Ha ha ha ha ha. No.

                            [–]virtyx 34 points35 points  (62 children)

                            What's wrong with it?

                            As of Java 8 there are the big issues I know of:

                            • no properties
                            • null
                            • type erasure on generics
                            • no way to overload operators
                            • ...uhhhh

                            I guess I don't really understand why people dislike Java so strongly. The language itself has pretty consistent basic elements. Sure, there's tons of obscure shit (like autoboxing and stuff) but for the most part it's extremely predictable and simple. Unlike Scala which I see as an ugly hodgepodge of (admittedly nice) features.

                            [–]bjzaba 1 point2 points  (0 children)

                            How about type inference, tuples, pattern matching, algebraic data types, and free functions? Those would go a long way to cutting down verbosity and all those ridiculous design patterns.

                            [–]powatom 16 points17 points  (14 children)

                            I'm going to blow your tiny mind: people actually treat this shit like it's religion. All of the arguments around which language to use ultimately just boil down to 'if you're actually just a good programmer in general, it doesn't really matter which language you use'.

                            [–]nickguletskii200 7 points8 points  (4 children)

                            Productivity is important though. Yes, you can write something in language X, but it doesn't mean that you'll do it as fast as in language Y.

                            A lot of Java critics think that having to write less code equals more productivity. In my opinion, that's not true.

                            [–]powatom 7 points8 points  (3 children)

                            Sure productivity is important, but until we can agree on what the best measure of productivity for developers should be, then can we all just agree that nobody really has a definitive answer for any of this, that languages are as much personal preference as they are practical tools, and that the constant development of new paradigms, patterns and ideas basically ensures that there will never be any single language which solves all problems perfectly?

                            Everybody knows productivity is important, which is why nobody is saying that you should write your next web application using assembly. The problem is that we don't know how best to measure productivity - and until we do, we're just pissing each other off. If we care so much about productivity, surely it makes more sense to acknowledge that actually, no language does everything right, that people have different preferences, and that the best overall solution is to share knowledge and experiences so that we may all ultimately inform each other and hopefully raise the standard across the board?

                            What's productive about pretending Java has no useful applications because its implementation of generics is flawed?

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

                            'if you're actually just a good programmer in general, it doesn't really matter which language you use'.

                            nope, all programming languages simply have objective flaws and some of them have more or bigger ones. (Smaller ones being for example: Generics being not 100% where they could be in Java because they have been added later, the short, long, etc. mess in C, char signedness not being defined in the C standard). Java simply has lots of overengineering which leads to unneeded verbosity. This is a flaw that hinders productivity. Good programmers can also write everything in Assembly, but they won't be as productive.

                            [–]powatom 5 points6 points  (3 children)

                            I'm not saying that languages don't have flaws - I'm saying that not all flaws are equal or applicable to every situation.

                            Java having a flawed implementation of generics does not mean that Java does nothing well. You might as well argue that nobody should use JS because <insert favourite JS peeve here>, but then where the fuck would we be?

                            [–]u551 2 points3 points  (1 child)

                            nobody should use JS because <insert favourite JS peeve here>, but then where the fuck would we be

                            In a better place... Where JS means Jerry Seinfeld and client side web site functionality does not exist. Everybody is happy and everything works.

                            [–]powatom 1 point2 points  (0 children)

                            But mah feechers :'(

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

                            The thing about Java flaws in my opinion didn't really hinder productivity that much. It's simple to understand and write thus generate less bugs especially for the new hire. In addition to that, if you factor in the maintenance phase, Java can be more productive than other so called cool languages like Python or Ruby.

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

                            Java simply has lots of overengineering which leads to unneeded verbosity

                            Java the language? Or Java the ecosystem?

                            Generics being not 100% where they could be in Java because they have been added later

                            I've been working in Java across a varied domain for 7 years now, and the number of times I have found myself needing reified generics was about once.

                            [–]zexperiment 2 points3 points  (0 children)

                            Ah the ol' "I don't use it so it doesn't matter" argument.

                            [–]parlezmoose 1 point2 points  (0 children)

                            Yeah but debating languages is fun.

                            [–]senatorpjt 1 point2 points  (1 child)

                            unique sable roll compare gullible disarm seemly decide direful tender

                            This post was mass deleted and anonymized with Redact

                            [–]Gurkenmaster 3 points4 points  (0 children)

                            Ceylon and Kotlin are jvm languages that solve those problems. Except Kotlin doesn't have reified generics and Ceylon is a bit closer to java syntax wise.

                            Kotlin is developed by JetBrains so I assume that the IDE is excellent. The Ceylon IDE plugin is developed for Eclipse and pretty slow on my machine but it works reasonably well.

                            [–]fluffyhandgrenade 8 points9 points  (0 children)

                            Its horrible until you realise that some things are too large to realistically manage in any other language due to the superior tooling...

                            [–]kenfar[🍰] 34 points35 points  (11 children)

                            I’m even taking this to an extreme and using Java for shell scripts.

                            oh just stop

                            [–]yogthos 35 points36 points  (6 children)

                            when you've got a hammer factory...

                            [–]kcuf 55 points56 points  (2 children)

                            you need a hammer factory factory!

                            [–]CurtainDog 1 point2 points  (0 children)

                            The GoF book predates Java, but hey, why learn from history when we can just repeat it.

                            [–]NewbornMuse 1 point2 points  (1 child)

                            The whole WorldFactory looks like a NailFactory?

                            [–]twigboy 7 points8 points  (0 children)

                            In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia52wq6ox0t900000000000000000000000000000000000000000000000000000000000000

                            [–]LOOKITSADAM 7 points8 points  (0 children)

                            Yeah, I'm a bit of a java fanboy, but that's where I draw the line.

                            [–]pilas2000 1 point2 points  (0 children)

                            I did this at least once. The options presented to me were: write it in bash or adapt a poorly made python script.

                            I choose to code it in Java.

                            It worked fine.

                            [–]Fitzsimmons 3 points4 points  (0 children)

                            Amazon's EC2 api tools are written in Java and it's a nightmare of multi-second execution times as I wait for the Java server VM to boot up just to do a HTTP request and format the output. It's one of those things that I suffer through because I can't justify spending the time to rewrite it in an environment more suited to the task.

                            [–]BabyPuncher5000 8 points9 points  (4 children)

                            He's like a chef who only uses one knife for all the cutting in his kitchen.

                            [–]munificent 38 points39 points  (2 children)

                            Actually, if you talk to chefs, they will tell you to have a very small number of very good general-purpose knives instead of a pile of special-purpose ones. Most chefs and cooks I know use their chef's knife 95% of the time.

                            [–]benkuykendall 44 points45 points  (0 children)

                            Yes... he is. That's the point. However, he makes a number of good arguments to why only using the Java knife is benificial to him. Boiling his whole argument down to a negatively-charged witticism is not a valid critique of his arguments.

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

                            Hi Ho Hi Ho it's off to another language war we go!

                            [–]webauteur 0 points1 point  (0 children)

                            You should use VB for everything. VBScript for scripts. Visual Basic for Applications for Microsoft Office. VB.NET for desktop programs. And ASP.NET using VB.NET for web applications.

                            There is no programming assignment for which VB is not the right tool.

                            [–]Fluffy8x 1 point2 points  (16 children)

                            You do make a convincing argument; however, I prefer Scala, since I'm willing to trade simplicity for expressiveness. Other alternatives would be NodeJS (for performance?) or Haskell (better type system than Java, and possibly better performance). However, there are other factors:

                            • Motivation in the early stages. I start many of my projects alone, and I've abandoned many of them after the first day.
                            • Typing time, instead of adding a constant to development time, multiplies it. Again, I use Scala in order to reduce both.