Advances in the java programming language, version 16 and newer, slashed a million lines of code from my codebase. Maintaining my programs became easier overnight, due to this 1 secret trick: Records. 
Unfortunately version 16 was not LTS, so I had to wait until this year’s release of version 21, which is LTS. 
 Go read the linked article. It explains Java Records in a very approachable manner.

  • thisisawayoflife@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I’ll be honest, I still haven’t figured out how to properly replace my POJOs with records. I tried a few weeks ago (17) and it was definitely not a plug n play situation. I don’t remember exactly the friction I ran into but I quickly abandoned it in favor of POJOs to get a POC done. I need to revisit it and see what the issue was. I think it was field accessibility or something like that.