Live data from Hacker News

Why Java? Tales from a Python Convert

sookocheff.com

61–70 of 102 posts

Re: Why Java? Tales from a Python Convert

#61
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'…

"You're comparing an OS independent language to an entire operating system?"

No, I am not comparing Java, but JVM. JVM is a platform, so it should have insight what's happening on it, don't you think? Whether this insight comes from the platform (JVM or z/OS) or the underlying system (native host OS or mainframe) is irrelevant - you probably want both (and in z/OS you get both).

Whether Java (the language) is clunky is irrelevant - z/OS has lot clunkier languages on it (application development is huge pain on z/OS compared to JVM), and I still think z/OS beats JVM for large/complex/maintainable systems. ;-) (Basically for the same reason - more mature.) z/OS has many logging and tracing functions, at different granularity, some of them are assisted with mainframe hardware. I don't see how JVM could beat it, but I may be wrong.

Re: Why Java? Tales from a Python Convert

#62

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

You didn't say anything about unit tests. Those tend to be the technique that proponents of dynamic languages promote for catching errors earlier.

Re: Why Java? Tales from a Python Convert

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

Now with Optional in Java 8 its not an issue.

Optional is great, but it would be far more powerful if types not wrapped in Optional were guaranteed to not be null.

Re: Why Java? Tales from a Python Convert

#64

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

Although it won't help when using other people's libraries/code, when you're building your own code then you'll probably enjoy Python 3.5's type hints on function parameters. They negate the need for doing hacky things like specifying types in docstrings.

https://docs.python.org/3/library/typing.html#module-typing

Re: Why Java? Tales from a Python Convert

#65

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

This also makes working with Python, even in an IDE, much trickier than Java in an IDE.

Re: Why Java? Tales from a Python Convert

#66

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

Bingo! Coming from C# and C++, I had exactly the same realization using Python (before I switched back). I always ask Python programmers "but are you just keeping track of the types in your head?" because it's impossible to keep myself from doing that. If Python (and dynamic languages in general) are just pushing the type checking into the programmer's lap, I'm not sure what the advantage is other than less verbose (looking) code.

Re: Why Java? Tales from a Python Convert

#67
post #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?

I really prefer Groovy's approach - default get/set behaviour is provided at compile time, but you can override in code with explicit getter/setter methods. Really seems to be the best of both worlds.

Re: Why Java? Tales from a Python Convert

#68
To me, the article doesn't really sell Java the language. The big benefits are in the JVM and libraries, which support many languages far superior to Java. The only virtue of Java the language might be the programmers who know it, and even there, many programmers are not familiar with the new features of Java 8.

Re: Why Java? Tales from a Python Convert

#69

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

Bingo! Coming from C# and C++, I had exactly the same realization using Python (before I switched back). I always ask Python programmers "but are you just keeping track of the types in your head?" because it's impossible to keep myself from doing that. If Python (and dynamic languages in general) are just pushing the type checking into the programmer's lap, I'm not sure what the advantage is other than less verbose (…

That's the problem I had with perl. Sometimes one plus one is two, sometimes it's eleven, and the interpreter doesn't always do what you expect.

Re: Why Java? Tales from a Python Convert

#70

Just a spin on this: as a java developer that recently started doing a lot of python, what has really annoyed me (apart from the utterly woeful IDE functionality compared to typed languages) is the extra "boiler plate" thinking you need to do with python because of the dynamicness meaning you have to keep the types and classes you're using for your codebase in your head, rather than letting the computer deal with tha…

You didn't say anything about unit tests. Those tend to be the technique that proponents of dynamic languages promote for catching errors earlier.

It's pretty difficult to defend the proposition that catching errors in unit tests is superior to not making them.
Post reply on HN