
Java for beginners - majikarp
https://www.zeroequalsfalse.press/2017/06/22/java/
======
tootie
I don't know Java gets such a bad rap from the current generation. If I had my
way (which I rarely do) I'd start any new server-side project on Java with
Spring Boot. Everything about the stack is so fine-tuned and battle-tested.
There's libs for everything under the sun. I can follow every stack trace even
in a multi-threaded environment. Debuggers are extremely dependable. The IDEs
are top notch. I know it's verbose and I prefer it that way. You spend more
time reading code than writing and I'd rather see it all spelled out than
encoded in punctuation marks. Otherwise, I'd go back to Perl.

~~~
arethuza
I was _very_ enthusiastic about Java from 1995 to about 2000 or so - then it
seemed to become dominated by an "enterprise" outlook and rampant over-
abstractionism.

Java is permanently associated in my mind with hammer factories:

[http://discuss.joelonsoftware.com/default.asp?joel.3.219431....](http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12)

~~~
sk5t
Just forget that EJB, Websphere, Weblogic, JTA, CORBA, and a few other things
ever existed, and having a positive feeling about Java should cause little
cognitive dissonance.

~~~
thehardsphere
I was too young to see the EJB fad and when people made all of these decisions
to use things like WebSphere. Did they make any sense in their own time? Today
they seem remarkably silly. Especially WebSphere, which is so horribly slow
and broken I don't understand why anyone would have chosen to use it besides
"nobody got fired for choosing IBM."

~~~
sk5t
Hard to say... it was a comparatively darker time for information
availability. Other odd, awkward, over-puffed products like ATG Dyanmo,
Plumtree, Interwoven, etc., were killing it in the market too.

I was really green in enterprise software then, and Websphere's suggestion of
useful clustering, configuration management, managed pooling, etc., seemed
tantalizing. (Look how long it takes to start up--it must be doing useful and
complicated stuff!) That said, it didn't take all that long for Tomcat, JBoss,
and others to eat its lunch on projects not rolling along on enormous sunk
costs into IBM tech.

I never actually dug into EJBs or wacky things like container-managed
Javamail. Some colleagues did. They spent a lot of time struggling with the
tooling.

And now I'm just remembering VisualAge for Java. /shudder/

------
AndrewDucker
I keep wanting to like Java, but they insist on everything being done the hard
way compared to C#.

Sure, you want to provide a bunch of different readers, and let people put
them together however you want.

But compare the example there of using a BufferedReader in a loop to read in a
file, and compare to the equivalent in C# - File.ReadLines (which gives you an
IEnumerable<string>) or even File.ReadAllLines (which gives you a string[]).
99% of the time that's all you want, and yet Java makes you do the work
yourself rather than just giving you a utility method.

~~~
martinp
Bad example. You can do this in Java 8: java.nio.file.Files.readAllLines(path)
which returns List<String>.

~~~
singularity2001
so they fix this one horribly convoluted use case, but most of the others are
remaining?

------
linkmotif
This is great. I've always envisioned something like "Java for Node
developers", having learned Java coming from Node, with great reward and
enjoyment. Java is a great and powerful ecosystem and even a fun language when
not written in the absurd 2000s "enterprise" style.

------
supremesaboteur
Would recommend Oracle's official Java trails :
[https://docs.oracle.com/javase/tutorial/](https://docs.oracle.com/javase/tutorial/)

------
ktzar
"Properly commenting code is so often overlooked when developing software and
it is a damn shame".

I'd change that to, "commenting code that is self-explanatory is so often
overused when developing software and it is a damn shame"

In the very same article, there's a function with the following JavaDoc
description "A simple add implementation that performs addition on two integer
values". Nothing I can't get from actually "knowing how to read code".

~~~
Retra
Except by reading that comment, you can tell if the function was implemented
correctly or not.

~~~
ben-schaaf
Until your requirements change and someone forgets to update the comment. Now
you don't know whether you have a bug and/or bad documentation.

~~~
Retra
That should be an easy checkbox for any code reviews you do. If you changed
the function, why didn't you change the comment?

------
collyw
I wish there was something like this for all languages. I know Java, but there
are often occasions when something isn't working that I didn't write and don't
have a clue about how to fix, but just need the basics to get started, and I
can probably work it out by myself (e.g. our Wordpress site when the other two
guys with experience in PHP leave).

Programing syntax isn't usually the difficult part once you know two or three
languages.

------
rb808
> Java - the programming language that most seem to despise with great
> passion.

Is that really true though? Anecdotally it seems lots of big firms are using
Java8 even more often, as sidetracks to Go/Scala/C++* seem to be coming back.

~~~
reading-at-work
Big firms like to use it, but most developers who work there probably don't;
they just suck it up and do it for the paycheck. Source: am a developer at a
big firm being forced to use Java.

~~~
Arcsech
For what it's worth, I'm in the process of converting one of our components
from JavaScript to Java because it is incredibly fragile, difficult to modify,
and everyone hates working with it. Not everyone is forced to use Java.

I really like Java actually, although we do make use of things like Lombok
pretty heavily to reduce the boilerplate, enforce using inheritance very
sparsely, and use immutable value types wherever possible (although sadly this
is the part that gets ignored most often) - doing those things greatly
improves the experience of using Java.

~~~
al452
Google AutoValue is (for my money) a much better alternative to Lombok. Plus
it's strongly opinionated towards immutability, big win.

------
wffurr
Java is Blub.
[http://www.paulgraham.com/avg.html](http://www.paulgraham.com/avg.html)

------
bradleyjg
Not a bad intro, but java.io is an old crufty mess. Use guava's io instead:
[https://github.com/google/guava/wiki/IOExplained](https://github.com/google/guava/wiki/IOExplained)

~~~
tootie
The standard lib has java.nio which is a vast improvement. I usually throw in
Apache Commons IO as well, but Guava is comparable.

------
NoWizards
i really hope this language will disappear

~~~
StyloBill
You can keep on hoping, but you're in for a big disappointment.

