

Under the Hood with Java 10 Enhanced Generics - ancatrusca
http://www.infoq.com/news/2014/12/Java10EnhancedGenerics?utm_source=hacker%20news&utm_medium=link&utm_campaign=news_under_the_hood_java

======
eropple
This is really troubling to me. I'm a Scala developer and JVM nerd by trade
(though more devops and high-level architecture as of late) and I've been
hoping really hard that they'd just bite the bullet, flag-day the current type
erasure and non-unified type system, and make Java 10 what...well, what the
CLR is, now, today. The generic specialization route they describe is at best
gross, isn't much better than what Scala already does today, and kicks the
real problems only slightly further down the road.

Still being crap in _2017_ , when the alternatives are good to great _now_ ,
is dangerous, and Oracle's fear of alienating the masses of people who'll
forever be two versions of Java behind is leaving the door open for Microsoft.
I write games in C# in my free time, and between how great VS/R# is[1] and
Microsoft supporting a CLR implementation I am inclined to trust more than
Mono's on Linux and OS X, I'm excited at the prospect of being able to use
.NET for server applications (no, no Windows Server for me, not now and not
never) in the future.

[1] - IntelliJ comes close, but it does suffer, from a usability standpoint,
from being cross-platform and having to compromise--I'd rather run a VM on my
Mac to use VS than use IntelliJ, all things considered!

~~~
chvid
I think a lot of people would see things differently.

.NET is much less a threat to Java today than it were 10 years ago. Today
Windows is no longer the dominant platform, you have Scala for people wanting
more advanced language features, you have Android and web applications are in
general preferred over desktop applications. And if you are writing desktop
applications then you need to take into account the Mac platform where .NET is
at best a second class citizen.

And when it comes to IDE: I find IntelliJ far better than VS from nearly every
standpoint - I simply don't understand your last remark.

~~~
kasey_junk
Count me also in the camp of someone who has _never_ heard a person choose
Intellij over VS with Resharper who has used both for any significant time.

As for .NET, if it were a viable Linux server side VM, C# would be a very
compelling language in comparison to any of the JVM languages. It blows Java
out of the water, and even as a full time Scala developer, I'd have a hard
time arguing against it vs Scala because the things I love about Scala come
with so many things I hate.

~~~
chvid
Heh. I guess with the IDE's there is quite a bit of personal taste involved
but believe me I am not the only who prefers IntelliJ.

Wrt. the other things; the way I see it .NET-support outside Windows has been
"vapourware" since .NET's inception. It simply has not happened. In the
beginning I thought this was MS's deliberate strategy but now the tables have
turned and as a sinister business strategy it does not make sense anymore.

I have no more love for Oracle than I have for MS and I would love to see
something as solid, cross-platform and performant as the JVM from MS but it
just is not there.

~~~
eropple
Cross-platform and performant? Wait six months. (My friends in a position to
know say sooner, but I'm a pessimist.)

~~~
chvid
Ok. I have been waiting since 2002 so what is another 6 months? :-)

~~~
bigdubs
[https://github.com/aspnet/KestrelHttpServer](https://github.com/aspnet/KestrelHttpServer)

don't need to wait much longer; it's already faster than nodejs for trivial
benchmarks and getting better every day.

------
lmm
If you can't wait until 2018, it's worth pointing out that Scala has
production-quality implementations of these features on the JVM already,
usable today. There are plenty of nontrivial limitations (that will cause a
traditional boxed codepath instead), but the core features are working.

~~~
rational-future
Yeah, but then it has also around 10K other features, most of which you don't
need. Most Java developers won't be able to become Scala masters by 2018
anyway, if at all.

On the other hand C# has even better generics than this proposal, along with
await, dynamic, yield. And it's now supported by MS and Xamarin on all big
platforms.

~~~
eropple
I like C#, I write a lot of it, but the claims of complexity regarding Scala
are just so vastly overblown. Anyone who's a competent Java programmer and has
an open mind (which is the nicest way I can think of to say "doesn't pee
themselves when they see a lambda") can be a competent Scala programmer within
a month of daily use. It's not that hard, the tooling today in IDEA is roughly
Java-level in terms of quality, and the language itself steers you towards
constructs that make doing the Right Thing fairly easy.

~~~
the_af
I like Scala (and I'm starting to use it in my day job!) but I don't really
think IDEA tooling is "roughly Java-level" quality. In fact, all the Scala
IDEs I've tried are astonishingly bad, IntelliJ included.

The consensus among the more knowledgeable Scala programmers at my office is
that IntelliJ is too quirky as an IDE (probably due to its built-in Scala
compiler which gives way too many faux compile errors. This is maddening in a
statically checked language!), and Eclipse-based Scala IDE is only slightly
better. They recommend entirely disabling incremental compilation in the IDE,
and instead using SBT for this. Coincidentally, this is what someone here on
HN told me is the "unofficial recommendation" from the Typesafe guys -- I
wouldn't know. As another example of broken tools, with Scala IDE refactoring
is so fundamentally broken I cannot use it; it often results in wrong code
(with Kepler-based Scala IDE, I've tried refactoring the name of a method and
it resulted in _syntax errors_ in other files!). Debugging is also hit-and-
miss, at least with Scala IDE.

This is miles away from most Java IDEs, which are perfect in this regard. Not
having compile errors correctly reported _as you type_ is truly disappointing.
Not being able to reliable refactor or debug code is very frustrating.

(I realize this is a tooling problem, and I love Scala. I'm just puzzled that
almost nobody seems to consider these issues as disappointing as I do).

~~~
lmm
I won't touch IntelliJ, but I find Eclipse good enough to work with. I've seen
the syntax-errors-in-random-files bug occasionally; it's always been a block
of text "moved" to the wrong place in the file. Annoying and worrying, but
pretty quick to fix. Debugging has always been reliable though, and simpler
refactoring works, and it's getting better at a good rate. But yeah, the
problems are real.

~~~
the_af
It's interesting that debugging is reliable in your setup. I use Kepler-based
Scala IDE, and debugging sometimes doesn't work, which means: not all
expressions are inspectable. Sometimes you cannot inspect the value of a
variable. I'm beginning to think this is actually a Scala issue: maybe those
expressions simply get elided in the actual bytecode?

~~~
lmm
It's possible; I tend to only look at member variables. Note that if you're
inside a block then variables from a slightly larger scope are often under
this/this$2 or similar. Are you using the old scala debugger or the new one?
(I'm using Luna now, which didn't give me the choice, so presumably the new
one is stable enough that they've made it the default?)

