this post was submitted on 13 Nov 2024
844 points (96.1% liked)

Greentext

4634 readers
615 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
[–] KoalaUnknown@lemmy.world 58 points 1 month ago (7 children)

Am I weird for liking Java? I feel like it just makes so much more sense than other languages.

[–] Serinus@lemmy.world 51 points 1 month ago (5 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.

[–] dragonfucker@lemmy.nz 41 points 1 month ago (1 children)
[–] dukatos@lemm.ee 3 points 1 month ago* (last edited 1 month ago)

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

[–] alsimoneau@lemmy.ca 11 points 1 month ago (1 children)

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

[–] Amir@lemmy.ml 5 points 1 month ago (1 children)

Python should be burning in hell

[–] alsimoneau@lemmy.ca 0 points 1 month ago

Nah, that's Java and JavaScript.

[–] PlusMinus@lemmy.world 9 points 1 month 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.

[–] Serinus@lemmy.world 15 points 1 month 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@lemmy.world 5 points 1 month 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@lemmy.world 1 points 1 month ago* (last edited 1 month 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.

[–] Willem@kutsuya.dev 7 points 1 month 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@lemmy.world 1 points 1 month ago* (last edited 1 month 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

[–] Amir@lemmy.ml 2 points 1 month 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@lemmy.world 3 points 1 month ago* (last edited 1 month 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@lemmy.world -1 points 1 month 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@lemmy.world 7 points 1 month ago* (last edited 1 month 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?

[–] fadingembers@lemmy.blahaj.zone 1 points 1 month ago (1 children)

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

[–] PlusMinus@lemmy.world 2 points 1 month ago

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

[–] spongebue@lemmy.world 6 points 1 month 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.

[–] Kalladblog@lemmy.world 1 points 1 month ago

Isn't Visual Studio Code just a fancy editor and not an IDE?

[–] sentient_loom@sh.itjust.works 26 points 1 month ago

I like how straight-forward the syntax is. And it also seems orderly to have everything be a class. There's a system to it.

I'm using C++ for a project now and I like it in a similar way, but there's more freedom (everything doesn't HAVE to be a class). So with C++ I'll never go back to Java (unless it's for a job).

[–] chunkystyles@sopuli.xyz 20 points 1 month ago (1 children)

No. Every language has its haters. There's a reason Java is so widely used. If you like it, keep at it.

[–] tempest@lemmy.ca 19 points 1 month ago (3 children)

Yes and the reason is because millions of lines of production code were written and it isn't worth rewriting them.

Plenty of languages around now that don't have 30 years of baggage and the specter of Oracle hanging over it.

Now a days many businesses choose Go.

[–] porous_grey_matter@lemmy.ml 6 points 1 month ago

I don't really like Go either, but it's better than Java, and it's pretty good for Big Software (tm). In the end, every language has some problems. Java just has all of them.

[–] AusatKeyboardPremi@lemmy.world 5 points 1 month ago

Now a days many businesses choose Go.

Many companies may choose something other than Java, but Java is still the behemoth.

Such a decision is taken when the company is completely new or if it is a green field project.

Even in the case of the latter, companies just choose to stick with their existing tech (read: expertise and experience of their tech teams)..

[–] dukatos@lemm.ee 0 points 1 month ago

The only reason not to choose Go is legacy systems with SOAP. That shit will never die.

[–] dev_null@lemmy.ml 12 points 1 month ago* (last edited 1 month ago) (1 children)

I thought I like Java until I tried Kotlin. It's everything I liked about Java, but with everything wrong with it fixed.

[–] infinite_ass@leminal.space 2 points 1 month ago (1 children)

I used to be very into Java and Kotlin looks nice. What's your favorite IDE?

[–] dev_null@lemmy.ml 2 points 1 month ago (1 children)

I use IntelliJ Idea. The free Community Edition is all you need.

[–] svcg@lemmy.blahaj.zone 9 points 1 month ago (1 children)

I am a certified Java hater, but you're allowed to like it. If simple and objected oriented is what you want, I can see the attraction, and it has a good and mature ecosystem.

[–] bitchkat@lemmy.world 4 points 1 month ago

The ecosystem is java's biggest asset. C# is actually a pretty decent language to develop in but the ecosystem just pales. Zookeeper for example doesn't have an official client. But one guy ported the Java client but it hasn't been updated in years. Maybe it's recently because I moved on from that job.

[–] SorteKanin@feddit.dk 7 points 1 month ago (2 children)

Honestly I would consider that a bit weird. At the very least, old-fashioned. If you like Java, it makes me think you haven't tried a better more modern language to compare it with.

[–] KoalaUnknown@lemmy.world 1 points 1 month ago* (last edited 1 month ago) (1 children)

The first language I learned was Python and I hated it. I have not tried Rust yet but I have tried all the Cs.

Edit: added missing not

[–] SorteKanin@feddit.dk 1 points 1 month ago

(I assume you left out a "not" there)

You should definitely give Rust a shot. It is only conceptually similar to C++ but otherwise very different.

[–] Malfeasant@lemm.ee 1 points 1 month ago (1 children)

Which would you suggest? (And if you say python, I will attack you with a pointed stick)

[–] SorteKanin@feddit.dk 1 points 1 month ago

Definitely not Python. Rust is very nice though.

[–] lurch@sh.itjust.works 5 points 1 month ago (1 children)

No, Java has lots of merits. For example, once you know layout managers, you can have a resizable GUI app in no time. It's the exact opposite of arranging things pixel by pixel. You just define "I want a grid of these buttons south and a big text field in the center" and Java will do the rest. I whip up apps like this for the silliest things, like noting which dungeon has what rotating boss this week in a game, so it's more convinient than noting it in a text file.

[–] dev_null@lemmy.ml 2 points 1 month ago

And GUI is even easier and faster with Compose.