this post was submitted on 14 Jun 2023
3 points (100.0% liked)
Scala
336 readers
1 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
(even newer here, hence a belated reply).
My interactive climate model SWIM now written in scala3 (originally java), uses loads of enums for real-world things, for example gases in the atmosphere, landuse biomes, sources of electricity, economic sectors, scenario definitions, stabilisation/equity algorithm options, etc. Such enums help map over irregular data structures, connect with user-adjustable choosers, etc.. So I waited for scala3 before embarking on this project - and am very happy with the language.
Recently I experiment applying enums also to region-definitions, but anticipating over 1000 of these, fear that the neater code may compromise efficiency (bearing in mind, this all works in scala.js - client side). From such experience, could elaborate (maybe elsewhere ...?) some ways Scala3 enums might still be improved.