Java's Hello World Is About To Change Forever

preview_player
Показать описание
Java's Hello World program is about to get a HUGE makeover.

Java's new JDK Version 21 is coming this September, and bringing in some amazing changes. Let's talk about the very best one here.

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Camera I use for recording:

🎙️Microphone I use (classy, I know):

00:00 New Hello World
00:35 What Changed?
04:17 How You Can Try It
09:09 What About IDEs?

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

There's about a 7-second part of this video that I had to re-record since I found while I was editing that I had totally flubbed a line. Thing is I had already trimmed my beard a little, so if you look closely it's definitely not a seamless transition. Let me know if you can see where it is.
And let me know if you'd like to hear more about this kind of thing, new features in newer Java versions!

CodingWithJohn
Автор

Java was my first language, then I moved to C#. it's fascinating to learn that C# was inspired by Java, C# implemented the changes and now Java is learning from it's apprentice

panic_seller
Автор

For me, as I have been using Java for years, the "unnecessary" keywords are a comfort. They make me feel reassured that the code i have written will work exactly how I intend it to. By removing these I feel it may make the code seem more ambiguous. That being said it does feel like a step in the right direction for Java as the language's complexity normally turns beginners away and this will help more people get to grips with the basics before moving on to the more complicated side - hopefully increasing Java's popularity. I also appreciate it is not a requirement to use the new layout so I can't complain. It seems overall to be a positive change for Java :)

archiewood
Автор

As an experienced java programmer looking at this new main() method from the point of view of when I first started out, the first thing that comes to mind is "What took them so long???"
However, looking at this new main() method from the point of view of an experienced java programmer my first thought would be, "Meh, I've been doing it this way for all these years, and I've got all my project templates that I've built up over time, I'll just keep doing it old school!"

mikes
Автор

Java 21 is a new reason for companies to stay at Java 8 xD

glaze
Автор

it sure looks better, but it was such a good reminder that the main method is public and static, and that you can pass arguments as strings that you can use right in the main method, I always liked that the entire code is detailed and self-explanatory, but it will be hidden from the beginners now, making it hard for them to grasp the basics of the language functionality

LuneAgent
Автор

I’m not sure this one change is going to really make Java an easier language for a beginner to learn programming with. I’m a Java developer and I think it’s a fantastic language. But when people who have never programmed before ask me if they should “learn Java”, I tell them, if you really want to become a software developer, I highly recommend you start with Python first and learn some basic programming concepts there. As far as all the boiler plate in the traditional “Hello World” Java program, I actually think it’s a great teaching opportunity. It took me a very long time as a programmer to be comfortable with not knowing things. It happens to all of us, all the time. Whether it’s a new project in an unfamiliar domain, or a new library or framework, when you are starting out with it there are many things you’re not going to understand and a few things you will. That can be frustrating and stressful. Part of being a successful developer is learning to be comfortable with not knowing everything and trusting that the knowledge will come in time. I think teaching that concept to a new developer by explaining that they can ignore all the boilerplate and it will eventually become clear later on is a vital skill for them to learn.

RobRoss
Автор

Dude... Public static void main (String [] args) was the hug at the start of what could be a hell of an algorithm...

nicoleta
Автор

4:42 to 5:44
Golden...
Probably unrelated, but thank you SO MUCH for explaining what "setting an environment variable" means! I've been coding for a few years now, and this was NEVER explained! Most tutorials for downloading any software just say "do this and this" and I followed them helplessly...

phoenixflames
Автор

This will be a big help in whiteboarding leetcode during interviews!

darksalmon
Автор

As an experienced engineer, I'd still like to have the blueprint of the object defined just for the sake of clarity of how objects manifests itself in Java and it's nice to know that the devs left the class definition as an option. The pros for me is in the memory usage as this could potentially save a lot of disk space especially while I'm noticing there is a popular trend in Java's relatively new functional paradigms. I can imagine myself writing a rest API with just a few lines using the function utility package and I think that would be phenomenal. At the same I also love Java's syntax being verbal enough to justify the behavior of it's statements.

tombenjamin
Автор

This should be discussed from didactics point of view for future introductory programming classes. This is clearly a feature for learners and not for professionals. I would be happy to discuss this with other professors.

philippetrov
Автор

Nice!! Java is finally catching up with Groovy. The syntax you demonstrated is valid syntax for Groovy.

restagner
Автор

Oh that is really interesting. I definitely remember being overly curious about what the whole "public static void main" thing meant when first learning Java (and I specifically remember the frustration when everyone told me to just forget about it for now haha)

I have a question though, since the main method no longer needs to be static, does that mean we can do things that we previously couldn't do? Or does it just automatically treat it as being static?

rubens_cube
Автор

I am a one year old java student and I like the old java way because it is precise. no ambiguity.

sooxpix
Автор

John, you're amazing! The way you explain Java makes it way easier. By the way, it never bothered me since VSCode always filled that line for me! 😂

gabucarneiro
Автор

It's like deja vu.

I distinctly remember that Microsoft's version of C++ supports a void main with no args as well, and when I started coding in C++, everyone said not to use it, lol. It is nice to see it become mainstream in a non-C++ environment.

chigozie
Автор

That's a good idea to provide the option to omit the class declaration because in the most cases, it's always the same: class is public, the name matches the file name, no extensions/implementations. I can only say: go ahead! 👍🏼

DerSchakal
Автор

That is what Python for, if people want to it easy, Python to go. I went from Python and now learning Java and sure, it is hard if you compare two but that is for every different language. It was a huge curve when I understood that Python is dynamically typed and Java is statically typed but then again both have ups and downs.
Anyway I will be most likely doing it the way I learned it in the books because this does not really speed anything up as most IDE will automatically write all these for you in the .java file anyway

chiter
Автор

I've been a java programmer for 5 months and studying this language been 1 year. My honestly opinion is that this changes are amazing, there allow you to know better how Java works and when you don't know nothing about versions like 1.8, 11, 15, 17, 19 and 20, force you to begin with this new version to understand easily how the things work. This doesn't mean that you don't gonna need to know this things later, it's only to be more friendly when you are learning or showing Java to other people.

rodrigomarques
visit shbcf.ru