KCDC 2025 Live Blog Table of Contents

KCDC grew. There are talks in two halls this year plus dev ops days, I hurt my finger so curious to see how live blogging goes! (It’s going fine. WordPress autocomplete lets me save typing some characters which evens out that touch typing with one finger less usable is slower)

Wednesday

Thursday

Friday

[javaone 2025] know your java

Speaker: Venkat Subramaniam

See the table of contents for more posts


Exercise 0 – warm up

  • How many years have you been doing Java

Exercise 1 – Collection’s remove

  • An ArrayList containing 1, 2, 3 becomes 1, 3 when call remove(1)
  • If you change to Collection<Integer> numbers = new ArrayList<>, what happens.
  • It is [2,3] because uses method on Collection, not on the ArrayList
  • “Code always does what you type and not what you mean”

Exercise 2: type inference

  • Exercise 1 but with var numbers = new ArrayList<>()
  • now it is [1,3] because var uses type on right which is ArrayList
  • Just because you like type inference doesn’t mean use it all the time. Determine when right thing to do

Exercise 3: Arrays.asList()

  • Arrays.asList(1, 2, 3)
  • Which of add/set are printed and what is in list?
  • add throws exception, set works so it is [1,2, 2]
  • Lesson: quit using asList. Use List.of instead

Exercise 4: forEach

  • .forEach(name -> upper.add(name))
  • worked until made one change
  • side effects is the problem (change was probably making it parallel)
  • forgot “it works on my machine”. better is “it failed on my machine”. Want it to fail on your machine instead of in prod
  • The lambda is not pure. A pure function is idempotent. Returns same result for same input regardless of how many times it is called.
  • A pure function does not emphasize anything outside it. It is ok to mutate; it’s like changing clothes. Just don’t do so in public; aka as a side effect
  • A pure function does not depending on anything outside that may possibly change.

Exercise 5: stream

  • int[] factor= new int[]1,2,3};
  • stream = numbers.stream().map(n -> n * factor[0]);
  • factor[0] = 0;
  • stream.forEach(System.out::println)
  • 000 because lazy evaluation

My take

This was cool. It wasn’t Venkat’s usual style. It was more interactive. He had a QR code to a Google form for each exercise so the audience could reply. That’s a great technique. If I ever have to present remotely about certifications, I’m going to copy it! It was interesting seeing the Google form results A lot of mixed results

[javaone 2025] A New Model for Java Object Initialization

Speaker: Dan Smith

See the table of contents for more posts


General

  • Dictionary says initializing is to set something to a starting position/value/configuration
  • Dangerous things happen if don’t satisfy invariants
  • Initialize – local variables, fields, arrays, classes, class instances, specific objects, components, modules, frameworks, systems

Variables

  • Well behaved variable always initialized before used
  • If final, only one initialization
  • Local variables checked at compile time
  • Whether the default value is an initial value depends on programmer intent
  • Final fields are good because must be initialized/can’t be mutated. However don’t prevent reading before initialization. (via constructor calling a method)

Class initialization state

  • Uninitialized – init hasn’t started yet, class can’t be used
  • Larval – init code running in specific thread; other threads block. Can see default values or final values changing. Can see accidental state
  • Initialized – init completed, class can be used
  • Erroneous – init threw exception. Class may never be used

Instance initialization

  • Some code runs early in construction like passing things to another constructor
  • Other code runs later like instance initializers or constructor bodies

JEP 492 – Flexible constructor bodies

  • Allows more code to run in early phase.
  • Can have lines of code before this/super call
  • Larval state now split into early and late larval
  • Early larval – constructor code is running up the hierarchy
  • Late larval – nrolling down the hierarchy. starting from when Object superclass initialized
  • In early larval, can’t use this or invoke instance methods
  • In late larval, be careful. this can be shared; field may change value, final fields may change
  • Instance initializers considered early larval
  • Array creation expressions produced an initialized array. Programmers don’t see a larval state.

Why change?

  • Initialization bugs are subtle and hard to see
  • Value classes must initialize fields before sharing larval object so JVM can freely make copies
  • Allows null checked variables to ensure cannot be null so can’t have a default value

Future

  • Want to change the timing so field initializers and implicit super() run in early phase.

My take

It was like getting a pick behind the scenes. I also learned that larval is a state. (said in Q&A that concept exists now for classes but doesn’t use term. And for instances the concept is there but don’t use the term state) The beginning was slow and I was worried I would be bored. But it got better