this post was submitted on 13 Nov 2024
815 points (96.1% liked)
Greentext
4390 readers
1097 users here now
This is a place to share greentexts and witness the confounding life of Anon. If you're new to the Greentext community, think of it as a sort of zoo with Anon as the main attraction.
Be warned:
- Anon is often crazy.
- Anon is often depressed.
- Anon frequently shares thoughts that are immature, offensive, or incomprehensible.
If you find yourself getting angry (or god forbid, agreeing) with something Anon has said, you might be doing it wrong.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
C# is nearly the same, but much, much better.
If I could restrict the world of programming to two languages, it'd be C# and Rust. C# for most things and Rust for a lower level language.
Nah, C# suffers from a lot of the same shit Java does. Needing everything to be a class is just no longer a good design choice (if it ever was). AOT support is still lacking. I don't get, why it does not have typdefs. I think the solution / project structure is unnecessary and I could probably think of more stuff I dislike about C#. But imho, it still beats Java.
Golang is my choice over C# any time. I strongly prefer how interfaces are handled and I actually like the error handling.
It's better than Java, but they still chose to walk headfirst into the same trap that bites Java developers in the ass: associating interface implementations with the struct/class rather than the interface itself.
When you have two interfaces that each require you to implement a function with the same name but a different signature, you're in for a bad time featuring an abomination of wrapper types.
Edit: Clarity.
On that last note, can't you use the explicit interface implementation in C#?
e.g.
Edit: I misread your comment as "like in C#" and wrote this as an answer to the non-existent question of "can't you use explicit interfaces like in C#"
I haven't kept up with recent Java developments, but with Go, you're out of luck. Interface implementations are completely implicit. You don't even have an
implements
keyword.Edit: For Java, a cursory search suggests that they haven't yet added explicit interfaces: https://stackoverflow.com/questions/19111090/does-java-support-explicit-interface-implementation-like-c
He mentioned C#, which does let you explicitly choose to implement same-name functions of two interfaces with different code
For some reason, my brain inserted a "like" before "C#", and answered the question of "can't you use explicit interfaces like C#."