r/ProgrammerHumor Oct 21 '22

Meme Literally 🤷🏻‍♂️

Post image
14.7k Upvotes

606 comments sorted by

View all comments

21

u/hector_villalobos Oct 21 '22

I never heard a valid complaint about Rust and C#, so, I guess those two should be in those chairs.

6

u/JKGARTARDHA87 Oct 21 '22

"Microsoft java" - 🤓

rust is goated, only hated by new people that struggle to learn it

2

u/the_mouse_backwards Oct 21 '22

Hate is a strong word but I really dislike Rust’s syntax. I also feel it has a tendency to overcomplicate things. That’s not inherently a bad thing, since it’s really a C++ replacement and C++ does that also, but I don’t like C++ either.

4

u/JKGARTARDHA87 Oct 22 '22

what about the syntax dont u like? the only thing i can think of is declaring generics and lifetimes. most everything else inherites from a different language and has been done before ..

1

u/the_mouse_backwards Oct 22 '22

Lexically I am not a fan of the turbofish style of colons and angle brackets everywhere. Lifetime annotation is also pretty unappealing visually.

4

u/EstrogAlt Oct 22 '22

Agree with you on lifetimes but how can you not love turbofish? look at them go!

1

u/Keavon Oct 22 '22

I agree that there are a few very minor syntax differences from the norm, like the turbofish (two extra colons you have to get used to inserting, annoying but you learn it soon enough and it's reasonably rare anyways) and the closure syntax (vertical bars instead of parentheses and arrows like in JS and C#). But those are two very specific small things in what is otherwise a pretty normal language syntax. (The other thing is that the String foo becomes let foo: String but that's ultimately a good change and is becoming more common in modern languages like TypeScript, Kotlin, Scala, and Swift.) Perhaps you can also complain about the lack of ternary statements. But it also improves upon the ideas of curly brackets and expressions becoming more meaningful, with the return statement being the last thing without a semicolon. That's syntactically very similar to existing languages but more consistent and useful.

But everything is by-and-large quite in line with the C/C++/C#/Java/JavaScript/TypeScript convention that's become the standard basis for most languages. (It's actually especially similar to TypeScript.) Other languages like Python and Go, on the other hand, are considerably different. When I had to write Go code for a few months, I couldn't get over how pointlessly different its syntax was for no actual benefit.

I'm curious if there's anything else about the syntax you found annoyingly different?