Re:The advantages of static typing, simply stated
by noelwelsh on Friday September 16, 2016 @10:26AM
(#12514202)
You don't need to have these issues. If you have a field that is optional, you can model that with the Optional type in Java 8. So I would model your dataList as Option<List<Something>>. If I cared that a list is definitely not empty I would create a type called NonEmptyList to model that. This is very typical is Scala, which is the language I use most often.
[ Parent
| on HN ]
There are no comments on this comment yet.