Elektrine lite

← Feed

@vascorsd@mastodon.social

Post #959429

2026-04-06 17:58 UTC

I was thinking of using the new method .runtimeChecked in a piece of code in #scala. I did it temporarily in another bit the other day, but then nobody knew what it was and I was forced to add a big comment that existed for 2 or 3 days until it was changed to be proper again... But really looking at the name is that it is utterly confusing and the intuition runs away from me. I'm going through the pre sip and the "docs" and there were better names. Anyway, it should've been "trustMeBro".

Replies (1)

  • @vascorsd@mastodon.social 2026-04-06 18:04

    And in no place does it explain what it means for the check to be done at runtime. Like does it explode in an uncatchable way?, is there a specific message it gives?, is it an exception that is catchable?... Is it better than doing the typical "throw IllegalState("this shouldn't happen")"?? Nobody knows. The docs are only this https://www.scala-lang.org/api/docs/other-new-features/runtimeChecked.html Absolutely not user friendly. A quick example that should be more developed and then jumps to a weird example.

    Open ##1652041