Live data from Hacker News

Why Java? Tales from a Python Convert

sookocheff.com

41–50 of 102 posts

Re: Why Java? Tales from a Python Convert

#41
post #26

"the JVM has excellent support for production logging and production monitoring, allowing you to easily monitor performance metrics down to an individual thread" Is it "excellent" compared to z/OS and mainframe (SMF and RMF, specifically)? I sincerely doubt it, but I would like to know if there is someone who can compare. I don't think any platform can match z/OS in the visibility into the system, but I am not enough…

You're comparing an OS independent language to an entire operating system? I think you're probably right, I don't think there is a sane comparison. But I don't think that's what the parent was referring to.

I'm not sure there are too many languages that provide (eg via slf4j or JMX) extremely customisable, universal logging and monitoring across multiple libraries that are used together in a single application. That's not a function of the language itself though, just the maturity of the libraries and ecosystem around it. Combine that with the tooling (eg IntelliJ IDEA) and no matter how much you might think Java as a language is verbose/clunky/crappy (which I tend to agree with), it's pretty hard to beat for large, complex, maintainable systems.

Re: Why Java? Tales from a Python Convert

#42

i don't care what lipstick you put on that pig: when something as simple as writing to stdout requires that i first create a new class, i'm not interested. Edit: i do consider this a legitimate issue with how Java 'does' OO. i'd be curious to understand downvoters' thoughts. One more edit: wow, tough crowd. for those not familiar, i'd suggest reading Steve Yegge's essay "Execution in the Kingdom of Nouns"

You're probably getting downvoted because it's factually not true.

System.out.println("Hello, world!");

No new classes there.

Re: Why Java? Tales from a Python Convert

#43
post #4

The one thing keeping me away from Java still is the awful experience around modeling data. Compared to something like a case class in Scala or even autoproperties in C#, writing classes with a bunch of getter and setter methods just to keep state is really tedious.

Google's auto library, auto/value in particular, is worth a look: https://github.com/google/auto/tree/master/value

Re: Why Java? Tales from a Python Convert

#44

i don't care what lipstick you put on that pig: when something as simple as writing to stdout requires that i first create a new class, i'm not interested. Edit: i do consider this a legitimate issue with how Java 'does' OO. i'd be curious to understand downvoters' thoughts. One more edit: wow, tough crowd. for those not familiar, i'd suggest reading Steve Yegge's essay "Execution in the Kingdom of Nouns"

You're probably getting downvoted because it's factually not true. System.out.println("Hello, world!"); No new classes there.

how would you compile that? here's what i get:

  test.java:1: error: class, interface, or enum expected
  System.out.println("foobar");
  ^
  1 error

Re: Why Java? Tales from a Python Convert

#45

Earlier quoted context omitted.

You're probably getting downvoted because it's factually not true. System.out.println("Hello, world!"); No new classes there.

how would you compile that? here's what i get: test.java:1: error: class, interface, or enum expected System.out.println("foobar"); ^ 1 error

Oh -- you're talking about the fact that you need to create a new class for your program's main method?

Yes, this is true, but it has nothing to do with printing to stdout.

Edit: I don't like Java and I've read the essay you're referring to. Please don't assume bad faith in other commenters. Your original post was factually wrong. There's enough wrong with Java that you don't need to make stuff up to criticize it.

Re: Why Java? Tales from a Python Convert

#47
post #34

> Java’s type system, while verbose at times, allows you to write code that largely “just works”. NullPointerException would like to have a word with you about that. In all seriousness, it feels unreal that people can be that impressed by Java's safety or lambdas. Makes you shudder to think about what they've used before that.

Python. Says it in the title.

Re: Why Java? Tales from a Python Convert

#48
post #34

> Java’s type system, while verbose at times, allows you to write code that largely “just works”. NullPointerException would like to have a word with you about that. In all seriousness, it feels unreal that people can be that impressed by Java's safety or lambdas. Makes you shudder to think about what they've used before that.

AttributeError: 'NoneType' object has no attribute

isn't much better.

Java might not be perfect, but it does let you catch a lot of problems at compile time rather than run time, which is a step in the right direction. The alternative (run it and see) gets old fast.

Re: Why Java? Tales from a Python Convert

#49
post #4

The one thing keeping me away from Java still is the awful experience around modeling data. Compared to something like a case class in Scala or even autoproperties in C#, writing classes with a bunch of getter and setter methods just to keep state is really tedious.

One thing to look at for Java would be auto/value (Immutable value-type code generation for Java 1.6+ by Google) https://github.com/google/auto/tree/master/value Not the same as what you reference in the other languages, but useful if you find yourself dealing with it in java.

This is really cool! I had no idea something like this existed.

Re: Why Java? Tales from a Python Convert

#50
post #22

Earlier quoted context omitted.

If it can be generated, why doesn't the compiler do it for you? This shouldn't be done at the IDE level.

Because it's not about tooling, it's about being explicit vs implicit. Though, there is something to be said about having a nice default that you can easily invoke at the code-level.

Many modern-ish languages with OO features (Swift, C#) let you declare that a thing has a getter without having to actually write boilerplate, i.e.:

    private(set) var foo: Int
    Int foo { get }
etc.
Post reply on HN