Live data from Hacker News

Why Java? Tales from a Python Convert

sookocheff.com

81–90 of 102 posts

Re: Why Java? Tales from a Python Convert

#81

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…

To be completely fair PyCharm is darn good with Python. PyLint will get you to quite comfortable place as well.

Thanks to this thread I just discovered the state of type hinting in Python 3.5.1 and I am super excited.

I can imagine working on huge code base and having a beef with Python but being a Java developer I think that would be using the tool incorrectly. The reason why I am saying this is that in Java world we (or some of us) work on large projects, we have multi-module projects with millions lines of code.

Whenever I think about Python project, I like to think that I would build series of small, independent modules. Maintain them separately. Thus limiting burden of dynamic language. In Java/JVM land you can achieve the same with small JARs. But we often don't (for various reasons).

TL;DR: There are more than decent tools for Python. Java =/= Python. Development approach matters.

Re: Why Java? Tales from a Python Convert

#82
post #37

OP 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…

> The millennials think outside the braces.

Please don't generalize. You have not been elected to represent all millennials.

Re: Why Java? Tales from a Python Convert

#84

Earlier quoted context omitted.

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.

Java provides less of the benefits of static typing than many other statically-typed languages (even than others available on the JVM), at a much higher cost in required ritual invocations made to the type system. Yes, there is a value in static typing, but that value is minimized when you have a type system that isn't particularly expressive and/or have to make add a lot of redundant code to satisfy a comparatively…

> Java provides less of the benefits of static typing than many other statically-typed languages

Don't let Java's type declarations fool you into thinking that Java is statically typed. It's still dynamic typing, with merely some kind of type hints slapped on top to be checked at compile time.

Re: Why Java? Tales from a Python Convert

#85
post #37

OP 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…

> 1. Desktop users are tricked in to installing Ask toolbar crapware. Which other language tricks users in to doing that?

.NET requires you to install Windows. I think it's the same category.

Re: Why Java? Tales from a Python Convert

#86

Earlier quoted context omitted.

And don't forget Java's type erasure. Still wondering how they could actually call that a FEATURE.

Was erasure necessary to maintain backwards compatibility? Also what are you doing that you need type information at runtime?

No it wasn't necessary to maintain backwards compatibility. Type erasure was implemented to allow libraries to upgrade to generics without breaking compatibility with existing applications.

Re: Why Java? Tales from a Python Convert

#87
post #57

Earlier quoted context omitted.

> Java is built on language concepts that are now 20 years old. Name me at least one language, even remotely mainstream, that is built on language concepts which aren't at least 20 years old.

Well, you know Archimedes and Aristotle had thought through all concepts in everything so nothing is new really :). Or more recently, all languages are just little flavors on Turin machine or Lambda calculus. But practically, Python had been one of the language that sets aside itself dramatically. It's still surprising to me that language designers - including folks on Go team - still have hard time thinking outside…

> uses == vs =

So does Python.

On the other hand, Smalltalk is way older than 20 and some of its features are innovative even today. I think finding the sweet spot between novelty and familiarity often beats innovation for its own sake.

Re: Why Java? Tales from a Python Convert

#88
post #37

OP 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…

About 1, having installed the JDK dozens of times I have never seen the ask toolbar crapware, could be true with the browser plugin (that should have died a long time ago) or the JRE (that I never needed to install).

About 3 to be honest I don't care at all of having braces, I actually dislike python because its lack of braces and what says if something is in a block is the indentation (I don't want to care about it when writing code, there are IDEs for that, specially when I move code around a lot), unless I am doing some quick tests on something and I dont have a minimal environment I do need a REPL at all (Java 9 may take care of that).

True that Java is not exactly truly open source, I have to agree with that.

Java being owned by oracle may be bad but being owned by a bad company does not make it a bad language.

Re: Why Java? Tales from a Python Convert

#89
post #86

Earlier quoted context omitted.

Was erasure necessary to maintain backwards compatibility? Also what are you doing that you need type information at runtime?

No it wasn't necessary to maintain backwards compatibility. Type erasure was implemented to allow libraries to upgrade to generics without breaking compatibility with existing applications.

How is that not backwards compatibility?

Re: Why Java? Tales from a Python Convert

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

It's still an issue, because as far as the type system is concerned, every reference type can still be null.

Optional gives you a way to avoid using nulls, but null is still in the language and libraries still use it.

Post reply on HN