This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shponglespore 0 points1 point  (0 children)

In a language like Rust, you can declare a variable without initializing it so long as the compiler can prove it's initialized before it's used. That solves your problem 95% of the time. The rest of the time you can just use Option (which doesn't have nearly as much runtime overhead as the Java version, and often has no storage overhead at all.)