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.
That's because Java is object-oriented. Data and the functions that operate on that data are not supposed to be separated. A clean object-oriented design has no plain getters and setters.
Why Java? Tales from a Python Convert
31–40 of 102 posts
Re: Why Java? Tales from a Python Convert
#32Earlier 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.
Let's remove them and go back to IDE generated goto's !
Re: Why Java? Tales from a Python Convert
#33Earlier quoted context omitted.
I'm seriously tired of this argument against getters and setters, just generate them with the IDE some also support collapsible regions with a start and end comment, and forget about them. So considering you can just generate and forget why is it tedious?
Because it's actually useless, having the work been done by someone else or something else means the work is still done, and you still depend on that 3rd-party.
Re: Why Java? Tales from a Python Convert
#34NullPointerException 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.
Re: Why Java? Tales from a Python Convert
#35The 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.
Use public fields, add getters and setters if you have to. Serialize your POJOs using Jackson. All modern data frameworks can deal with public fields just as well as getter/setter combinations.
(Unless you are publishing a public API. In that case, you can't easily convert a public field to a private field/getter/setter setup if needed, as the cat is out of the bag and clients have code against the public field.)
Do I wish there were auto properties like C#? Oh yeah, I'd love that. But I do find modeling fairly easy.
I also lament having to manually maintain equals/compare/hashCode/toString implementations. However, with IDE auto-generation of code (using IntelliJ) makes this merely noisy and annoying, and not a time sink or a constant source of dumb errors.
Re: Why Java? Tales from a Python Convert
#36The 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.
lombok
Re: Why Java? Tales from a Python Convert
#371. Desktop users are tricked in to installing Ask toolbar crapware. Which other language tricks users in to doing that?
2. Java development actually have languished for very long time and it is very recent that it started to catch up with C# and other modern languages. Java forums are filled with cries and screams for adding these improvements for years on.
3. Java is built on language concepts that are now 20 years old. Back than people wanted every language look like C++. The millennials think outside the braces. They expect language to infer types instead of repeatedly being specified all over. They expect REPL. They don't want everything modeled as object and so on. Mature language does not equal modern language.
3. Java is not truely "open source" or "free". Ask Google and Apache Harmony for the legal battles they had to fight with Oracle.
4. If Microsoft had done what it's doing with C# and .Net back in 2000, I highly doubt Java would be as popular as it is now. In other words, things can be popular even while being technically legging behind. This is not to say C# was initially just a Java copy cat but it did grew up fast while Java folks set on their laurels.
5. Java is owned by Oracle. Enough said.
I think modern languages should not have obligation to look like C/C++ and it should use advances in automatic type inference, functional paradigms etc. Anything 20 years old would have great libraries and VMs, but then mainframes and Cobol were also very safe, "reliable" and had great libraries and infrastructure at some point. It's ok to use mature tools to get shit done now but proposing them as new frontier doesn't make sense.
Re: Why Java? Tales from a Python Convert
#38Re: Why Java? Tales from a Python Convert
#39OP is glossing way too many things. 1. Desktop users are tricked in to installing Ask toolbar crapware. Which other language tricks users in to doing that? 2. Java development actually have languished for very long time and it is very recent that it started to catch up with C# and other modern languages. Java forums are filled with cries and screams for adding these improvements for years on. 3. Java is built on lang…
Name me at least one language, even remotely mainstream, that is built on language concepts which aren't at least 20 years old.
Re: Why Java? Tales from a Python Convert
#40i 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"
System.out.println("Foobar");
Either you're referring to something else or you misunderstood the language. The `out` stream is static so there is no need to create your own class first. (http://docs.oracle.com/javase/7/docs/api/java/lang/System.ht...)