Hacker News new | ask | show | jobs
by bonobo3000 3734 days ago
I like it! I have similar opinions on static vs. dynamic, Java vs Python or PLs in general - too many judgements are based on shallow first impressions or ease of getting started to the detriment of future maintenance.

Check out Scala :) Its a pretty complex language, but its the sweet spot between Python and Java i've been looking for.

3 comments

We had very similar experiences with Scala. Java and the JVM are incredibly stable and mature but the language (even with JDK8+) is very restrictive. There's no pattern matching, no full closures, properties are based on a manual naming convention, and even the basic type inference is extremely primitive. The dynamically typed languages like Python and Ruby are fantastically expressive and flexible, but maintaining large bodies of code can be tricky and the performance can't compare to the JVM. Scala gives us the stability and performance of the JVM with great tooling (IntelliJ Scala plugin) and the language is very flexible and expressive. It takes some discipline to focus on writing highly readable Scala code but the result is totally worth the extra effort of learning the language. I'm not surprised that Scala was ranked as one of the most loved languages in the StackOverflow survey for at least the last two years, and Spark and Scala are the top paying tech skills in the US :

http://stackoverflow.com/research/developer-survey-2016#tech...

http://stackoverflow.com/research/developer-survey-2016#tech...

If you're looking for a sweet spot you should try Go.
Go is a bitter spot in my book. All of the costs of a good type system like Scala's, but few of the benefits. (Go may well be better than Java, but why is that your point of comparison?)
this thread is about java vs python. go to me is a sweet sport between what I like about other strongly typed languages and what I like about python
The post you originally replied to was about Scala - if you're suggesting people use Go instead, we should compare Go to Scala.
Go feels more like C with garbage collection and a nicer standard library, but lacks the abstractions necessary to be anywhere near as expressive as Python, Ruby, Scala or even Rust. At the language level some advantages of Go include the fact that it's easy to learn and mostly hard to write unreadable code.
I'm very comfortable in Go, Java and Python, and in my experience Java and Go fill the same niche in terms of use case, but I'm way more productive with Go, for various reasons. And in terms of language, it's waaaaay less verbose than Java and I end up writing far less code to achieve the same goals.

I actually just had the experience of starting a project in Go, and after a prototype the company decided to reboot it in Java (for business and not technical reasons, basically the project started as a server and ended up being a library, so language popularity matters). It took me a lot more code and time to get the Java implementation to where my Go prototype was.

It might just be me, but in terms of a sweet spot between being productive and having high performance, Go is the best of both worlds. It's on par with Java in terms of performance, and slower than python to write - but not as much as Java (and for big projects I suspect you end up more productive in Go than in Python).

Go is just functional enough for me to free up some boilerplate that I feel more productive there. Structs and funcs are 90% things, and I only use a receiver on a func if it helps to clarify an operation or mutate that value. That Java doesn't give this choice directly is sad, but verbs in the land of nouns will do that.

A lot of my time is spent writing and reviewing Java code, which I still enjoy a bit.

Check out Kotlin. It's not a complex language with much faster compile time.
It's a complex language, just not a powerful one. If you want a language that actually simplifies on Scala, try Ceylon.
Kotlin has plenty of killer features, two of them is a very good OOB IDE support even in Community Edition of IDEA and machine translation of Java code to Kotlin.
The IntelliJ Scala plugin is pretty awesome too and it also offers machine translation of Java code to Scala. It's actually the most widely downloaded plugin for IntelliJ by nearly an order of magnitude. I think Kotlin is a much better option than Java, but the main selling point is simplicity for those who don't want to spend the time learning Scala (entirely valid if if that's a priority for you).
Or Xtend if you want a simpler Java with less verbosity
Turbo Pascal has much faster compile times than Kotlin. Compile time just isn't that big a deal as a feature.
It's not a feature, until it becomes a problem. It is a problem in Scala.
I use Scala every day. IntelliJ uses incremental compilation, so most compiles complete quicker than it takes for me to reach for the mug of coffee next to my keyboard.