For me #2 source is good and more cleaner then source #1.
➕ 1
j
Joffrey
02/25/2024, 1:51 PM
I wouldn't pay so much attention to the compiled code in general unless you want to investigate particular issues that you or your users experienced. Here I would just look at the source. The second snippet is better in terms of readability. The property name
asBar
might need to be revisited based on the real domain names, as this is usually a function name.
👆 3
e
ephemient
02/25/2024, 3:06 PM
"zero-sized" doesn't have an equivalent in JVM
➕ 2
ephemient
02/25/2024, 3:07 PM
here, enum entries are objects and all constructed when the class is loaded, no matter which way you write it