3 ms·
Yep, I agree. I tend to be a type system maximalist: I'd rather have everything that is possible to encode statically be encoded statically, even if it leads to
by lolinder 3y ago
Yep, I agree. I tend to be a type system maximalist: I'd rather have everything that is possible to encode statically be encoded statically, even if it leads to less flexibility later.
If you're starting a new Java codebase from scratch, you can create the structure where the language doesn't using classes, but it'd be nice to have syntactic support for it.
- kaba0 3y agoThis property is not really part of the type system though. Also, as mentioned by another commenter below - is a file exists operation async? Sync? Why, why not?
- wiseowise 3y agoWhat if file exists operation MUST be sync?
- lolinder 3y agoIn TypeScript at least, async-ness is encoded in the type system, because async/await is just syntactic sugar for Promise/then/catch.
- samus 3y agoVery simple - in Java, almost any IO operation in blocking. Exceptions are the stuff in the NIO package, thread interruption and signalling, and maybe process termination.