[devnexus 2024] moving java forward together

Speaker: Sharat Chander

@sharat_chander

For more, see the 2024 DevNexus Blog Table of Contents


General

  • Began with a survey of how long people have been using Java. A lot of people at 25+ years and a small bunch for all 29 years! (Java turns 30 next year)
  • Tech we have now used to be impossible – ex: phone
  • Sci fi shows what possible
  • Trap : “move fast and break things” At a point, speed causes harm. Remember the user experience
  • If long out window on train, goes by too fast. But if look farher out, can see. Need to look beyond that window
  • People first. Technology second. Remember the users.
  • Avoid “get shit done”. Innovation in of itsel is not innovating. What purpose if not helpfu
  • What power do you have in your environment. One person can do a lot.
  • Need to prepare next generation befoe age out

Quotes

  • “Move thoughtfully and build things” – Sharat’s dad. Meants to be careful and thing before break
  • ”You know less than you know” – Sharat’s dad. Recognize learning opportunities
  • ”Mastery is not the destination; only be the beginning” Sean Phillips

Java DevRel Team at Oracle

  • Stewards of Java
  • Learn, share, contribute
  • Foundational Programs – Oracle academy, Oracle university, Open JDK, Java User Groups, Java Champions
  • 10-20% of audience raised hand as not being part of a JUG (Java User Group)
  • New/Digital program – inside.java, dev.java, youtube.com/java

Awards

  • Called up latest Java Champion
  • Pratik and Atlanta JUG for lifetyime achievement award. 20 years of DevNexus!

gson supports records

I like using records in Java and getting rid of the boilerplate on my immutable objects. I also like using gson (google’s serialization/deserialization library) for my lightweight JSON needs. All I need is an annotation to use a different field type. (For complex parsing I use Jackson)

Suppose I want parse this

var json = """
   {"first":"Mickey",
	"last":"Mouse",
	"birth_year":1928}
	""";

For example before records, I would write:

class Name {
	 private String first;
	 private String last;
     @SerializedName("birth_year") int birthYear;

     // boilerplate methods
}

I needed to use my IDE to generate a constructor, getters, and a toString(). And additionally, equals/hashCode if needed for that class.

In Java 17, I switched to records. I didn’t realize I could use them with gson annotations until recently. Turns out all I need to write is:

record Name(String first, 
   String last, 
   @SerializedName("birth_year") int birthYear) { }

The parsing code remains the same

var gson = new Gson();
var name = gson.fromJson(json, Name.class);
System.out.println(name);

ChatGPT for education – is it like a calculator?

At the NYC FRC (FIRST Robotics Challenge) local kickoff, there was a speaker from Columbia about AI. The target audience was high school students. He said two things that stuck with me. First was:

Self awareness is the ability to imagine yourself in the future; the farther in the future, the more self aware

He also noted that his dog can imagine himself about a minute in the future. Like eating the food about to come. Humans can imagine further out of course.

The other was about AI being like a calculator. I like that analogy. It shows that using ChatGPT isn’t a replacement for learning how to write/code/etc. We don’t let kids use a calculator on tests until they already know how to add. And you don’t want to have to go to a calculator or pull out your phone to add 5 + 8!