Oct 29, 2026 · 54 min · 9 segments
Object-Oriented Programming offers a lot of flexibility for modelling diverse domains but not all elements need that flexibility. Data, specifically, is often better modeled by simple, immutable types…
Nicolai ParlogHost
So you're talking about flexible constructor bodies and how that allows to do basically describe this.

So in the past when you had a call to another constructor or to a super constructor which is basically the same thing, but like a constructor, another constructor, the same class of the super constructor, you couldn't have any statements before.

Like if you want to do some working with some parameters, you always have to have like the static functions that you put into the call of super.
And so sometimes people would have dummy arguments in the super just so that there's a place where you can call some function and do something unrelated.

Yeah, or you have an intermediate constructor that then takes that stuff and then recombines it.

And then flexible constructor, but he started out very innocuous as, oh, wouldn't it be nice to have statements before the call?
Not just expressions, but let you have statements too and then put the super call at the point in the block where it's appropriate.

Yeah, and that's how it started out, right? And then it morphed into you cannot only have statements and those statements basically lived in a very, very close to static context where it's like an aesthetic method.
Yeah, like maybe the second or third preview, we modified it to allow you to assign to the fields, which is interesting.
The other thing that fed into this is in Valhalla, we were talking about objects that It wasn't just nice if they can be properly initialized before anybody can manipulate them.
And so we realized that early construction context before the super call is the place where you can make assignments to your fields and then guaranteed that no one will ever see the null before you made that assignment or whatever else is in your data.

So you're talking about flexible constructor bodies and how that allows to do basically describe this.

So in the past when you had a call to another constructor or to a super constructor which is basically the same thing, but like a constructor, another constructor, the same class of the super constructor, you couldn't have any statements before.

Like if you want to do some working with some parameters, you always have to have like the static functions that you put into the call of super.
And so sometimes people would have dummy arguments in the super just so that there's a place where you can call some function and do something unrelated.

Yeah, or you have an intermediate constructor that then takes that stuff and then recombines it.

And then flexible constructor, but he started out very innocuous as, oh, wouldn't it be nice to have statements before the call?
Not just expressions, but let you have statements too and then put the super call at the point in the block where it's appropriate.

Yeah, and that's how it started out, right? And then it morphed into you cannot only have statements and those statements basically lived in a very, very close to static context where it's like an aesthetic method.
Yeah, like maybe the second or third preview, we modified it to allow you to assign to the fields, which is interesting.
The other thing that fed into this is in Valhalla, we were talking about objects that It wasn't just nice if they can be properly initialized before anybody can manipulate them.
And so we realized that early construction context before the super call is the place where you can make assignments to your fields and then guaranteed that no one will ever see the null before you made that assignment or whatever else is in your data.
The rest of this transcript — segmented and speaker-labeled, so you land on the exact moment something was said
Search every transcript — by keyword, by phrase, or by meaning, across every show Radar indexes
Trends — what is surging across podcasts, measured against its own baseline
Alerts — when a name you follow appears in a newly indexed episode
No account is needed to search Radar.