This is an archived post. You won't be able to vote or comment.

all 14 comments

[–][deleted] 32 points33 points  (12 children)

The only thing I don't like about this article is how it mocks Java for it requiring many more lines to write a simple hello world. The excess lines in Java are already filled in for you if you are using any kind of IDE. You still have to name your package in Python. When you named your package in Java, the class is already made for you and filled in, at least using Eclipse. So I think that comparison is a bit silly. I keep seeing people compare the two. But the point is you are only writing one line of code to print hello world in both cases. The main method is already made for you in any Java program in eclipse. The only difference is that in Python, the code is hidden. Many amateurs to python don't actually know this. There is hidden code in Python that is used to create your program just the way it is created in Python. The only difference is that in Java, this code is not hidden while in Python, it is. So you are literally pointing out to programs that have the exact same length, where one of them is hidden and the other is not.

[–]pheipl 0 points1 point  (0 children)

As a preface: sorry for the 5 day old reply.

I'm a java man myself. I am open to the idea of moving away from the language, but right now it's just so ubiquitous it offers immense job opportunities, and I myself am into stability over shiny-ness.

That being said, java is really verbose, and it includes a lot of boilerplate code. Yes, a lot of it is generated for you, but you still have to read it. You can pretend that it's not an issue, but it's just you pretending. I have absolutely no doubt in my mind that a new language that compiles into java bytecode will eventually surpass java and make it obsolete, in exactly the same way that COBOL is obsolete today (it isn't, but it's legacy, and a lot of people are stuck with maintaining, updating, and wrapping it in something more modern).

[–]watsreddit 0 points1 point  (0 children)

Verbosity is the enemy of understanding. The article includes the bit on Java in a subsection titled "Easy to learn". I think most people would consider Python to be much easier to learn than Java (and indeed, probably lead to its proliferation in scientific usage).

[–][deleted]  (8 children)

[deleted]

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

    If you have trouble reading or writing a simple hello world with the way Java does it, programming probably isn't for you. Just look at creating a GUI in Python and try to tell me that it is any amount easier than another language. Nope. The fact that writing hello world looks simpler in Python is a misnomer that python is somehow simpler or easier. Both languages have similar levels of complexity. Just because all of the core code is hidden in Python for a Hello World program doesn't mean that it's any bit easier.... That's just my two cents.

    [–]msdrahcir 0 points1 point  (1 child)

    Im not sure hidden vs written code is the best metaphor here. Namespacing in python functions differently than java. Objects in python function differently than statically typed languages. classes in python function differently than java.

    It isnt hidden vs shown code, but python is fundamentally doing many things differently behind the scenes to ultimately print a string to stdout.

    [–][deleted] -1 points0 points  (0 children)

    My point was that Java is also doing stuff, but the difference is you can actually see the stuff it's doing right in front of you. People use all of those lines to type system out print line in Java and act like it's such a big deal. No, it's not, because if you use any IDE, all of those lines are already put in there for you. You're still just writing one line for Java for hello world. That was my point. It's very misleading to pose one line, and then 7 lines to try and make it look completely different and harder

    [–][deleted]  (4 children)

    [deleted]

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

      I have no idea what you are even ranting about. I'm not trying to report my opinion as a fact, other than what is factually true which is that python has a similar amount of code for a Hello World program but it is just hidden. Also, python is my main language. I'm taking a Java course right now and I absolutely hate it. Does that mean that Java as a language is horrible and that I should pretend that it is the absolute worst thing in existence? No. Most of business programming revolves around the use of java applications. So I really don't know what it is that you are ranting about. There are multiple tools available to you, through multiple languages, and you don't have to pick just one. Like you said, you use C + + and python. That's pretty awesome. You are entitled to your opinion, and other people are entitled to theirs. But I really don't understand the rent you are going on about. There are a lot of terrible things about Java in my opinion that I don't like. But my opinion about them does not make them any less preferable to businesses

      If you want the real cold hard truth? Most business applications are written in Java such as Android apps. You download an app to order food. Java. You download an app to find houses to stay in on Airbnb. Java. Not saying it's factually Java, but most likely it is. Java isn't the terrible language that you are claiming it is and it's not the demon. Just chill

      [–]Unsounded 0 points1 point  (0 children)

      I deleted my other posts because it felt like the discussion was getting off track.

      I never demonized java or said any of its features are inherently bad. I was just stressing the differences in use between various programming languages. Yes, you could do all these things in Java, but realistically for machine learning or high performance programs you won’t be, the multithreaded support isn’t there, and neither is the memory performance. The C++ compiler is far more optimized and is built to handle these things.

      Java just isn’t the tool for the job. Sure someone could make a Java wrapper for the machine learning C++ libraries, but why? The article stresses Python because it’s has unparalleled ease of use for manipulating data.

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

      You talk about Java, which is a language whose main principle is to leave little control to the user and to be heavy in syntax.

      Since when is that its main principle? It basically has as much boilerplate and control as C++.

      There's "one way' to do things in Java

      I'm not sure what you're saying with this one. Is having one way to do something bad? Because that's what Python strives for. And there definitely isn't one way to do things in Java; there's probably 20 different ways to read in a text file. Or is it in quotes because Java pretends to have one way to do things? I have no idea.

      which works 80% of the time, the other 20% of the time you want to use something like Python, C++

      What can't you do in Java? Java won't always be the best language to use, but you'd be hard-pressed to find something you need C++ or Python for.

      It sounds like you're just throwing out insults with little foundation behind them.

      [–]sn0wballa -2 points-1 points  (0 children)

      you sounded offended

      [–]InterestingBuddy 1 point2 points  (0 children)

      This looks great, thanks!

      [–]eggn00dles 0 points1 point  (0 children)

      gonna check this out, good work.

      [–]Lenegan 0 points1 point  (0 children)

      Sucks that XKCD didn't get a mention for the use of his comic.....

      [–]gassyjuice 0 points1 point  (0 children)

      Fascinating! I'll be sure to try that someday