3 ms·
The worst problem with almost all popular programming languages are null and shitty error handling, such that, when you call foo() where foo is String foo(){ bl
by bedobi 5y ago
The worst problem with almost all popular programming languages are null and shitty error handling, such that, when you call foo() where foo is String foo(){ blabla } you can get a String, null OR an exception/hidden error response, but most compilers happily let you treat it as if it only ever returns a String. (What!!!?)
I hope some day null is no longer a thing, and that Functional Programming types like Option, Either, Try etc in the native libraries is the new default. (BTW, there's really nothing "Functional Programming" about them, they're just objects like any other in "Object Oriented" languages)
- angelzen 5y agoNot top 5 languages, but Scala & Rust fit the bill.
- phil294 5y agoEven JavaScript does, with strictest TypeScript settings (not on Exceptions though). When I returned to a Java project recently, the lack of null safety was seriously off-putting. It does indeed feel like the "billion-dollar mistake" of programming.
- deepsun 5y agoKotlin as well. The result type is "String?".