Fireship · @fireship
Java is mounting a huge comeback
Uploaded June 5, 2023 · Length 3:40
Summary
Java is getting new features like unnamed classes and string templates, making it more accessible to beginners and potentially more interesting to use.
- java comeback
- java features
- programming language
- java vs python
- java vs kotlin
- enterprise software
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
it is June 5th 2023 and you're watching
- 0:03
the code report Java is hands down my
- 0:05
all-time favorite programming language
- 0:07
to make fun of python developers roast
- 0:09
it for having so much boilerplate see
- 0:11
developers laugh at absurd class names
- 0:12
like abstract Factory manager Singleton
- 0:15
service manager Factory C plus plus
- 0:17
developers hate that you can't blow your
- 0:18
legs off with memory management as
- 0:19
easily and JavaScript developers are
- 0:21
still trying to fix things like dates
- 0:23
they copied from java over 20 years ago
- 0:25
unfortunately I have some bad news
- 0:26
public static void main string arcs will
- 0:29
no longer be a requirement to write
- 0:30
hello world in Java 21 rendering an
- 0:32
entire industry of java boilerplate
- 0:34
memes static null and void and that's
- 0:36
not good for people like me who make a
- 0:37
living making fun of java because I need
- 0:39
that boilerplate to put food on my
- 0:40
family it's great news however for
- 0:42
anyone who wants to learn Java or more
- 0:44
accurately anyone who's forced to learn
- 0:45
Java this new feature is called unnamed
- 0:47
classes and instant main methods and
- 0:49
allows you to create a main method
- 0:51
without a class and public static void
- 0:52
mainstream arcs this is a great change
- 0:54
but I think we could actually make
- 0:55
things a little bit better by also
- 0:57
removing void and actually why do we
- 0:58
even need a main function in the first
- 0:59
place we could get rid of that
- 1:01
altogether system out seems a little
- 1:03
unnecessary there should just be a
- 1:04
global print line function and if we
- 1:06
rename it to print we then get a perfect
- 1:07
language c-sharp introduced top level
- 1:09
statements in 2020 and maybe in another
- 1:11
10 years Java will get there too before
- 1:13
you get too excited though this feature
- 1:14
is primarily designed to make learning
- 1:16
Java more accessible to beginners the
- 1:18
real boilerplate is not going anywhere
- 1:20
in addition Java is primarily used in
- 1:22
Enterprise which is very slow to adopt
- 1:24
new features there are tons of mission
- 1:25
critical applications out there still
- 1:27
running Java 8 and it could be years or
- 1:28
even decades before these new features
- 1:30
get adopted but Java 21 also has some
- 1:32
other cool updates like structured
- 1:34
concurrency that allows you to run
- 1:36
multiple concurrent jobs on multiple
- 1:37
threads while treating them as a single
- 1:39
unit of work but another thing you might
- 1:41
find kind of crazy about Java is that it
- 1:43
doesn't natively support string
- 1:44
interpolation which means you need to
- 1:45
concatenate a bunch of strings together
- 1:47
like you're in kindergarten or use
- 1:48
string.format which is also kind of
- 1:50
annoying but in Java 21 we have a new
- 1:52
string templates feature which is a new
- 1:54
kind of expression that allows you to
- 1:56
insert values directly into Strings
- 1:57
we've come full circle to where Java is
- 1:59
now looking more like JavaScript and


