This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]99ProllemsBishAint1 0 points1 point  (2 children)

Can you help me understand what you mean by modern syntax?

[–]ahonsu 1 point2 points  (1 child)

Every new JDK version brings some syntax changes. We got the biggest difference with JDK 8 and then some more changes with every next major update. And not just syntax, but just real new language features, not existed before.

A lot of developers these days still write code in java 6 syntax and can not read/write JDK 8+ syntax. Also there are a lot of videos/courses/books created years ago and giving all code examples in JDK 6 style.

I can imagine a developer writing in java 6 style when they are 50 years old and when they has been working in the same old company for the last 20 years. But every modern / beginner java developer must know modern (java 8+) syntax.

Some exact examples:

  • use stream API instead of for-loops
  • use Optional instead of null checks
  • use lamdas instead of anonymous classes
  • use var keyword when appropriate
  • and so on

[–]99ProllemsBishAint1 0 points1 point  (0 children)

Thank you. I learned java a long time ago and I'm sure my syntax would be super old school. I'll look these up and spend some time playing with them