Re:Java Is Unsound: The Industry Perspective
by tigershark on Tuesday January 24, 2017 @05:56PM
(#13476561)
Thanks god c# doesn't have checked exceptions, they are just an enormous pain, especially when heavily using actions and functions, and most of the time they are completely ignored, rendering them completely useless.
The option type in Java is extremely verbose and doesn't guarantee that you won't have null pointers.
In c# you can use the null conditional operator and the coalesce operator that at least are much less verbose and more elegant.
The best solution is obviously to use a functional language like f# where you can't have null pointers.
[ Parent
| on HN ]
Re:Java Is Unsound: The Industry Perspective
by lacampbell on Tuesday January 24, 2017 @07:14PM
(#13477146)
> The best solution is obviously to use a functional language like f# where you can't have null pointers.
You absolutely can:
Microsoft (R) F# Interactive version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> let s:string = null ;;
val s : string = null
Re:Java Is Unsound: The Industry Perspective
by tigershark on Wednesday January 25, 2017 @04:11AM
(#13479922)
String is a .net type, f# types cannot reference null unless you explicitly add some attribute if I recall correctly.