Live data from Hacker News

Why Java? Tales from a Python Convert

sookocheff.com

1–10 of 102 posts

Re: Why Java? Tales from a Python Convert

#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.

Re: Why Java? Tales from a Python Convert

#5
post #2

These examples look like C# 2.5 with a little bit of LINQ.

IMHO, C#'s tooling and is definitely ahead. Java is starting to get there, and I can see why the JVM is still popular. But given the actions of Oracle and MS as of late, I think I'd take MS. VS starter projects are easy to setup and run... Every Java application I've worked on has been an exercise in frustration just getting the environment setup.

Re: Why Java? Tales from a Python Convert

#6
post #5
post #2

These examples look like C# 2.5 with a little bit of LINQ.

IMHO, C#'s tooling and is definitely ahead. Java is starting to get there, and I can see why the JVM is still popular. But given the actions of Oracle and MS as of late, I think I'd take MS. VS starter projects are easy to setup and run... Every Java application I've worked on has been an exercise in frustration just getting the environment setup.

I'm also a fan of C# but deploying .NET has been a sticking point. I'm hopeful that Microsoft's open source efforts fix this.

Re: Why Java? Tales from a Python Convert

#7
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.

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?

Re: Why Java? Tales from a Python Convert

#8
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.

Re: Why Java? Tales from a Python Convert

#9
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.

Use `public final` fields and put them in the constructor. Use builder classes to handle optional parameters.

Re: Why Java? Tales from a Python Convert

#10
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.

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.
Post reply on HN