this post was submitted on 13 Nov 2024
797 points (96.3% liked)

Greentext

4384 readers
1505 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:

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
[–] Serinus 50 points 1 day ago (4 children)

C# is nearly the same, but much, much better.

  • It doesn't (usually) come with the Java culture 8 layers of abstraction. This isn't in the Java language. This isn't in OO. Yet nearly every Java programmer makes things way more complicated than it needs to be.
  • It's a prettier language. Similar syntax with less bullshit.
  • It's open source
  • It's still multiplatform. Modern dotnet / C# works on anything.
  • Both Visual Studio and Visual Studio code are great IDEs that blow Eclipse out of the water
  • It's one of the most common business languages.
  • It's going to be supported forever.

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.

[–] [email protected] 39 points 1 day ago (1 children)
[–] [email protected] 3 points 1 day ago* (last edited 1 day ago)

Kids will never understand this. The same is with JScript.

[–] [email protected] 8 points 1 day ago (1 children)

I'll take Python and Fortran, thank you very much

[–] [email protected] 4 points 1 day ago (1 children)

Python should be burning in hell

[–] [email protected] 1 points 1 day ago

Nah, that's Java and JavaScript.

[–] spongebue 6 points 1 day ago

I only had one job that used C#, and it was the worst job I ever had. Even with the worst possible way to be introduced to the language, I still love it.

[–] PlusMinus 8 points 1 day ago (3 children)

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.

[–] [email protected] 1 points 20 hours ago (1 children)

Is there anything I can read about how we're moving away from everything being a class?

[–] PlusMinus 2 points 14 hours ago

No sorry, but try literally any other language ;-)

[–] Serinus 14 points 1 day ago (1 children)

Needing everything to be a class

In 2015 they added scripting. If you're making a real project, you should absolutely use classes. (It's not that hard. Don't do the Java shit.) But you can absolutely write one off scripts just fine.

AOT support is still lacking.

Publishing your app as Native AOT produces an app that's self-contained and that has been ahead-of-time (AOT) compiled to native code. Source.

[–] PlusMinus 5 points 1 day ago

I think you misunderstood my post. I am quite proficient with C#. I just think other languages do it better.

AOT is not where it should be yet, because not all libraries have full stripping support.

[–] pivot_root 1 points 1 day ago* (last edited 1 day ago) (2 children)

I strongly prefer how interfaces are handled

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.

[–] [email protected] 7 points 1 day ago (1 children)

On that last note, can't you use the explicit interface implementation in C#?

e.g.

public class SampleClass : IControl, ISurface
{
    void IControl.Paint()
    {
        System.Console.WriteLine("IControl.Paint");
    }
    void ISurface.Paint()
    {
        System.Console.WriteLine("ISurface.Paint");
    }
}
[–] pivot_root 1 points 1 day ago* (last edited 1 day ago) (1 children)

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

[–] [email protected] 2 points 1 day ago (1 children)

He mentioned C#, which does let you explicitly choose to implement same-name functions of two interfaces with different code

[–] pivot_root 3 points 1 day ago* (last edited 1 day ago)

For some reason, my brain inserted a "like" before "in C#", and answered the question of "can't you use explicit interfaces like in C#."

[–] TunaCowboy 0 points 1 day ago (1 children)

just one more oop bro I swear

Pure oopium. All oop 'design patterns' exist solely to overcome the inherent flaws of oop.

[–] pivot_root 7 points 1 day ago* (last edited 1 day ago)

just one more oop bro I swear

Didn't understand my criticisms of Go and Java's interfaces, or do you just enjoy LARPing as a senior programmer while living in a small world where the term "interface" strictly means object-oriented programming and not the broader idea of being a specification describing how systems can interact with each other?