
Javapocalypse - sleepyhead
http://jz13.java.no
======
StavrosK
This is irrelevant, but I just had my first Java experience yesterday. I
decided to make an Android app, it's a simple remote control for hobby
projects (Raspberry Pi/etc) that gives you a customizable UI with buttons that
perform API calls. It'd be pretty simple to do in Python, which is the
language I am proficient in, but Android development sounds fun so I wanted to
get started in that.

Creating the UI was easy enough, but making an HTTP response was hell. The
simplest HTTP GET took around 30 lines of code, and the compiler kept
complaining about unhandled exceptions (I know the URL is fine, it's a fixed
string I can see, it's not going to throw MalformedURLException, I don't want
to catch it, thank you. What? I can't compile without it?). Wrapping the calls
up in try/catch blocks was easy enough (if a bit verbose), but now the
variable only existed in that scope.

I know I'm new enough that I can't form an opinion about the language, but I
know that something that has as simple an interface as an HTTP GET call
shouldn't take 30 lines of boilerplate to do. I'm wondering how people deal
with this issue (I'm guessing it's a lack of a good standard library?). What
attracts people to the Java world? Is it the tooling (Eclipse was, admittedly,
very good about auto-fixing my mistakes). Is the verbosity just "the way it
is", or am I doing something wrong?

~~~
AYBABTME
Java is verbose. Tooling is great, however.

For exceptions, there are two types. Checked exceptions and runtime
exceptions.

* Checked exceptions need to be explicitly handled in your code, or it doesn't compile. * Runtime exceptions can just happen, you don't need to check them. I personally don't really like the runtime exceptions because they can hide in thousands of place and throw when you don't expect it. However, you don't need to check them so it makes for less verbose code... but it's like putting your head in the sand.

To reduce verbosity of exception handling, I find a pseudo-solution is to just
propagate the exception up the stack and deal with it later. It depends for
what exception, but for instance, a MalformedUrlException for which you KNOW
the Url is fine, can be checked much higher in the call stack. You will save
yourself the local verbosity, which hides meaning, and really if the Url is
malformed, you might not want the app to keep running; if it's hard-coded you
should expect it to be right. It's in the same spirit of Go's
`regexp.MustCompile(string)` that makes a compile error if the hardcoded
string you give it is not a valid regex.

That being said, Java is a daily pain, but the extensive tooling makes it
usable.

~~~
famousactress
Yeah, this is the argument I got tired of and why I jumped ship out of
developing in Java for over a decade: "Java is pretty painful, but don't
worry.. the tools are so good you don't have to write much code."

~~~
ChikkaChiChi
This blows my mind and this may be the reason I have so many problems dealing
with frameworks of any kind.

If I am writing live code, I...want to write code. I don't want something to
do it for me. If its in a language I am comfortable with I can generally write
it more effectively than a tool in a toolbox and know how to fix it when it
breaks.

Maybe I am just a control freak.

~~~
famousactress
No, you're normal. Couple things though: The knowing how to fix it when it
breaks isn't a real problem in my experience with Java... the stuff that tools
tend to generate for you is so boilerplate there's not much mystery there, so
I never felt _abstracted from_ the meat of the programs, really.

The Java language, while I was using it, was very slow to change or evolve.
Tools, on the other hand, didn't suffer from the bike-shedding and lack of
leadership, so they evolved quickly to solve the pragmatic problems they could
solve. When I decided to look around and choose a language to re-invest myself
in I looked very closely at leadership.. Who the BDFL was (and whether one
existed), how the language was evolving, and what the values of the community
were. That meant more to me than syntax, though of course they're related.

Sort of like "watch the player, not the ball" advice you get in soccer.

------
tommorris
The JavaZone people do great trailers.

Lady Java -
[https://www.youtube.com/watch?v=Mk3qkQROb_k](https://www.youtube.com/watch?v=Mk3qkQROb_k)

The Streaming -
[http://jz11.java.no/trailer_video.html](http://jz11.java.no/trailer_video.html)

Java 4-Ever - [http://jz10.java.no/java-4-ever-
trailer.html](http://jz10.java.no/java-4-ever-trailer.html)

~~~
Espenhh
We have collected all the previous videos at the "videos-tab" on the web page
as well: [http://jz13.java.no/videos.html](http://jz13.java.no/videos.html)

There are some great talks from last year's conference there as well, many of
them in English. The one by Tim Berglund about Git is great!

~~~
Nrsolis
Jesus, Mary, and Joseph.

That was the best video for ANY computer topic I've ever seen. HILARIOUS.

I'm going to be smiling the rest of the day.

~~~
efa
Especially the very end. Stephen with his pole!

------
jstsch
With the domain java.no, this headline sounded like a plea to stop all Java
development ;)

~~~
afandian
My first thought was "I bet this is another abuse of TLDs, what are the
chances this is actually Norwegian". Pleasantly surprised.

~~~
deadairspace
From wikipedia: [.no] domain registrations are limited to organizations with a
presence in Norway and registration at the Brønnøysund Register Centre.

------
tommorris
"But, Mr President, if we destroy Java, what will parse the 5,000 line XML
files we use...?"

------
BonoboBoner
And here I was thinking these airport towers run COBOL.

~~~
makmanalp
You could say Java _is_ the new COBOL :) </tongue-in-cheek>

~~~
Roboprog
More like, "ha ha, only serious"

Object fields = Data Division; Bean = Copy Book

Practices that actively discourage functional style programming in favor of
procedural style programming with widely scoped variables.

I'm glad Java is more widely used than C++, but it's a hard language to really
love, despite being (mostly) how I earn my living.

------
sivanmz
Java is just not made for quick prototyping. In production, the URL will come
from somewhere, not written by hand, so it would need to be checked anyway.
Sadly there's no quick-prototyping mode in Java where you can say, just call
this URL string an don't bother checking.

Another example is the inability to just read a local file into a string with
a simple API call. It's this way, again, because in production the program has
to reason about paths and file systems and can't make assumptions about the
validity (or size) of the file you just want to load and play with.

In production code, no matter the language, you have to guard against these
issues. The nice thing about objects (immutable, anyway), is that once
constructed and validated, they do not require tedious validation at every
method and client they are passed into. That actually results in less
boilerplate, and less test writing.

So just remember, Java always assumes your code is production-bound and
requires upfront planning and checking. That's why it's unpleasant to
prototype with.

------
Roboprog
Yay Oracle! Save us from the 42 year lag to create an open source alternative.

I know the video is a joke, but that was harsh. I think there are quite a few
good open source languages that only took about 5 years or so to get going
with a decent runtime library. What takes years is to get _adoption_ of new
tools from the grass roots up, more so than implementation.

------
mordae
Hmm, the video makes me wonder.

What if the button software was written in Java and did, in fact, nothing.
Perhaps with a nice 40-something line stack trace in the log file. Meanwhile,
a completely new worm targeting the Java platform crashed most of the
infrastructure.

------
dergachev
Hey that was a lot less lame than expected!

------
tzury
I haven't seen geek-related commercial made so well and funny for quite a long
time.

------
transfire
The sad irony is that it is the termination of COBOL that could actually bring
society to its knees. If Java died, it wouldn't take long for all that code to
be rewritten in Go. But how many COBOL programmers do you know?

~~~
bilbo0s
"...If Java died, it wouldn't take long for all that code to be rewritten in
Go..."

Guy...

You don't just rewrite code that's been through the FDA approval process. It
doesn't work like that. If you want to replace a java or c based medical
imaging viewer... you can... but you have to prove it won't kill anybody. Or
make any doctors cut off the left leg instead of the right one because a
transform is flipped due to a DICOM attribute being interpreted incorrectly.
Or that RTP calculations are still correct, and the PET/CT fusion is
registering correctly. You can't get Radiation dosage calculations wrong by
even a tiny amount.

And you have to prove all of that to the FDA and sign thousands of sheets of
documentation swearing to it. And the standard fine print in that
documentation makes you criminally liable if a bug is found.

And that's just 1 tiny industry that java is used in.

Multiply that difficulty by every life and death or money based industry and
you begin to get an idea of what a monumental task getting rid of java would
be. Think oil extraction and exploration systems... uh... no excuses there...
they MUST work. Think industrial control systems... software for nuclear
facilities, or even software for a simple coal based energy plant, can't just
be thrown together. People in a city or area depend on these facilities to
meet their energy needs.

Maybe I'm misunderstanding you... what is your definition of "wouldn't take
long"?

~~~
transfire
I made the assumption that we would still have access to the original source
code. So it wouldn't be so hard to translate Java to another modern language,
e.g. one of the most modern being Go. On the other hand, so few people know
COBOL these days that even with source code, translating those systems would
take considerably longer.

------
dromidas
Was I the only one that read this as "JAV Apocalypse"? I don't want the
Japanese Adult Videos to go away :(

------
tharshan09
I may not like java that much - mostly due to bad experiences from uni. But
WOW! that video was really great, very funny.

------
sleepyhead
"Patrol 403 investigating reports of open source activity"

~~~
talloaktrees
That was the best part.

------
chii
He is the Javatar! ROFL

------
jph98
Nearly £700 really?

I spent £100 on Geecon last year.

