5 ms·
> having implicit nulls (C, C++, Java, JS, C#), > lack of proper sum types (C, C++, Java, JS) Incidentally, Java and C# have addressed (or are in the process
by apta 6y ago
> having implicit nulls (C, C++, Java, JS, C#),
> lack of proper sum types (C, C++, Java, JS)
Incidentally, Java and C# have addressed (or are in the process of addressing) both issues. Both languages/platforms are superior to golang in almost every conceivable way.
- karmakaze 6y agoI'm not aware of any current Java project on Sum types. There is multi-catch for exceptions but no immediate plans I know to use elsewhere.
- apta 6y agoA form of pattern matching and switch expression has already made it to the language as of JDK 14. Those are paving the way for full blown pattern matching and sealed types: https://cr.openjdk.java.net/~briangoetz/amber/datum.html https://cr.openjdk.java.net/~briangoetz/amber/datum.html https://openjdk.java.net/jeps/360 https://openjdk.java.net/jeps/360
- richardwhiuk 6y agoJava aren't fixing nulls, IMHO. They are making it worse.
- apta 6y agoHow are they making it worse? In any case, there already exist solutions in place: https://checkerframework.org/manual/#example-use https://checkerframework.org/manual/#example-use https://github.com/uber/NullAway https://github.com/uber/NullAway
- richardwhiuk 6y agoThe code ends up looking like: Optional<Integer> foo; //.... if (foo != null) { foo.and_then(new Consumer () { function accept(Integer foo) { } }); }
- karmakaze 6y agoI would never assign null to an Optional nor use a library that returned one. To ensure assignment before use make it final.
- deleted 6y ago[deleted]
- matwood 6y agoI've used a lot of Java and C#, and a decent amount of Go. I'm not sure I would call Go inferior. The design goals were different. I'm also not a language wonk, so maybe that's why I enjoy the relative simplicity of Go. The developer loop of code, run, code is very fast, and the standard library is good out the box. I just want to write code and get stuff done. To that end, Go is another capable, workman type language (like Java or C#).
- spion 6y agoExcept for green threads.
- erik_seaberg 6y agoThat's true though Project Loom is working on fibers. There's already an early access release to test.
- pgwhalen 6y agoMinor point, they've settled on the name "virtual threads" instead at this point.
- balfirevic 6y agoSum types are not planned for C# 9, are they?
- apta 6y agoIt has pattern matching, but not a full discriminated union implementation yet. That seems to be on the roadmap though: https://github.com/dotnet/csharplang/issues/113 https://github.com/dotnet/csharplang/issues/113 https://github.com/dotnet/csharplang/issues/485 https://github.com/dotnet/csharplang/issues/485
- hactually 6y agoNeither have addressed it though - they do have works in progress. Same as the lack of decent threading in Java. It's been a WIP for years. Lets judge based on status quo rather than being disingenious.
- vips7L 6y agoHow does Java not have decent threading? Go doesn't even have actual threads. I'm assuming you're talking about goroutines aka virtual threads/fibers whatever which are entirely different from actual threads.
- hactually 6y agoapologies, but yes, you're correct - I was referring to green threads
- SureshG 6y agoHopefully will preview in next release (6 months release cycle) http://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.html http://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.h... EAP build - http://jdk.java.net/loom/ http://jdk.java.net/loom/