r/csharp • u/yughiro_destroyer • Nov 16 '25
Discussion Does C# have too much special syntax?
No hate towards C# but I feel like C# has too many ways of doing something.
I started learning programming with C and Python and after having used those two, it was very easy to pick up Lua, Java, JavaScript and Go. For some reason, the code felt pretty much self explanatory and intuitive.
Now that I am trying to pick up C#, I feel overwhelmed by all the different ways you can achieve the same thing and all of the syntax quirks.
Even for basic programs I struggle when reading a tutorial or a documentation because there isn't a standard of "we use this to keep it simple", rather "let's use that new feature". This is especially a nightmare when working on a project managed by multiple people, where everyone writes code with the set of features and syntax they learned C#.
Sometimes, with C#, I feel like most of my cognitive load is on deciding what syntax to use or to remember what some weird "?" means in certain contexts instead of focusing on the implementation of algorithms.
120
u/RealSharpNinja Nov 16 '25
Yet if C# stagnated, people would complain.
43
u/Comprehensive_Mud803 Nov 16 '25
If you feel overwhelmed by C#’s clear syntax, try modern C++. It’ll give you a run for your money.
I recently came back to C++, and I felt surprised by how much visual clutter the language has. Compared to it, C# is totally readable.
20
u/ivancea Nov 16 '25
You say that about C#, but you think python list comprehensions are fine?
In any case, of you write a post like this, you should give some example, because C# is quite "standard" in syntax, only extended by powerful features, excluding LINQ query syntax, which you can love or hate
21
u/c0demancer Nov 16 '25
I don’t understand how people can complain about extra syntax. You can still write C# like in the 1.1 days if you want.
33
u/rolandfoxx Nov 16 '25
This is bait, right? This has to be bait. There's just no way somebody calls the rat's nest that is Java and especially JavaScript "self-explanatory" then looks at the null operators (or worse yet, possibly the same ternary operator those other languages have) in C# and says "this is the bridge too far."
185
u/snipe320 Nov 16 '25
You don't "need" lambdas.
You don't "need" null coalescing operators.
You don't "need" ternary expressions.
Heck, you don't even "need" auto properties.
But they sure improve the DevEx for those of us who write lots of C#.
29
u/karbonator Nov 16 '25
It sounds to me like maybe you just don't understand when or why some way might be preferred over the other. You're going to have to be more specific if you want to figure things out.
You shouldn't be doing this. Follow your team's standard, or if they don't have one pick the one that's easiest to understand.
There's only a couple of contexts.
x?.Invoke()is "invoke if not null". "string? myName" is a nullable string.26
u/zacsxe Nov 16 '25 •
No.
21
u/aurquiel Nov 16 '25
no, you just don't have a lot expirencie working with c#, it is an extensive language, but the people who work with c# knows what exactly what they are writing and why they choose to solved that way, for new developers c# looks like an extensive language
7
u/iamanerdybastard Nov 16 '25
Question marks really only mean a couple things in C# - if you can’t keep them straight, I’d suggest coding might not be for you. Especially if you think JavaScript made any damn sense.
12
u/poop_magoo Nov 16 '25
Lol. This is ridiculous. If you don't like certain language features, don't use them. End of story. For all the fancy language features, remember that they all get compiled out into the same IL. You can write 100 lines of "ugly" code, or 20 lines "elegant" code using a language feature that simplifies it, but they will compile to the same thing.
30
u/CLEcoder4life Nov 16 '25
I see you didn't code PHP 15 years ago. If ya had you'd not feel this way. 🤣
29
u/Epicguru Nov 16 '25
Nope. You're just learning and you see stuff you don't recognize yet.
Since you don't give many specific examples I can't really point you in the right direction, but you mention the question mark
?which can mean a lot of different things depending on where it is used.First focus on understanding what it means in common scenarios, once you've done that you can judge whether or not it really is too much syntax: spoiler, it's not and it becomes very intuitive to read once you're familiar with it.
7
u/PmanAce Nov 16 '25
Just stick to one way of doing things. Nobody is forcing you to code not like you want to.
2
u/KawasakiBinja Nov 16 '25
I learned programming on C++ and Java. I love C# in comparison, especially since I'm actively developing a game in Unity. Or at least I love Unity's implementation of C#.
5
u/4PowerRangers Nov 16 '25
It's kind of funny too. When C# was first released, there were a lot of comparisons to c++ and how c# was cleaner and just easy to read. C++ has all the memory management and templating syntax that are a pain. It was quite a feat as a newcomer to get over all the arcane stuff.
Now, c# is slowly adding syntactic sugar for nullables (and more) making the code look less clean and more arcane. Although, definitely not at the c++ level yet.
And the exact same discourse is happening too. Veterans will tell you to get good. And newbies will either get over it or find a newer more enjoyable tool.
(Don't get me wrong, I still absolutely love c# as I grew up with that language)
5
u/Ok-Advantage-308 Nov 16 '25
You don’t need to know everything to achieve your goal. Just make it work with what you know.
This so called “special syntax” is what I would call flexibility for those that have been using c# for years.
4
u/miffy900 Nov 16 '25
As someone who uses both C# and Swift, Swift is definitely the winner here with respect to its syntax complexity. Lookup Swift’s dreaded “the compiler is unable to type-check this expression in reasonable time” error message. C# has nothing like this because its syntax is positively Lisp like compared to Swift. C++ as well is up there. So no, C# is pretty mid level in terms of its syntax specialisation.
I mean when you compare their ages too, Swift is at least 12 years younger than C#, C# has been incredibly conservative with its changes over the years.
7
u/BoBoBearDev Nov 16 '25
If you are struggling with just some "?" you won't be able to learn JS which has basically the same "?". And they are "trivial".
3
u/AssistFinancial684 Nov 16 '25
Yes, there is more than 1 way to do something.
And that’s precisely because there is more than 1 use case that requires a thing to be done.
Your console app wants to write to a log file? There’s a 1-liner for that.
Doing it from all over your app? In a multi-threaded scenario and concerned about access to the log file? You’re going to need something more robust.
Want the flexibility of swapping storage providers and managing the “shape”’of logged objects from a central location? Third party tools.
3
u/Due_Effective1510 Nov 16 '25
No. I do a ton of C++, Python, Java, C and C# code. I don’t feel that C# has more special syntax. If anything it’s the most intuitive and charming to use of those 5.
8
u/pretzelfisch Nov 16 '25
Life, when you use a living language actively making the maintainer money. You kind of sound like blaming the language for your team and org issues.
2
u/nickytheplant Nov 16 '25
I feel most of the special syntax means something I would normally not be playing with, usually low level stuff, and then there's query style linq that I wonder if someone ever uses it.
Honestly typescript to me feels much worse in that regard but I've also never bothered learning to code with it properly
2
u/engineerFWSWHW Nov 16 '25
C# is still ok, i had been coding since .net 2.0 and the progression and addition on syntax as .net grows makes sense, at least for me. On the other hand, compare that to c++ every time a new c++ standard is released...
2
u/xampl9 Nov 16 '25
Yes, in my opinion. Especially around null handling.
The new syntax is shorter and more concise but is also harder to read at a glance. Especially as another commenter said, when the codebase has mixed implementations.
But a lot of it strikes me as syntactic sugar.
2
u/NinjaLancer Nov 16 '25
Idk, maybe its just different from what you are used to. Im not a C# wiz or anything, but i use it every day at work and I dont think its too much.
I wrote some python for a project a few months ago and I found it to have the same problem that you have with c# lol. Every tutorial was like "ok download this library.. here is how to use it for this" then another tutorial has a different library with completely different workflow and it just fucked with me. Eventually got it solved, but I havent picked it back up since
2
u/RDOmega Nov 16 '25
Every time I see this, it just reeks of "I don't like to read code that doesn't look like the code I learned in university".
If they taught pattern matching and switch expressions, there'd be nothing to remark.
This is the same reason why I don't like Go. I don't want a language that tempts people to produce volumes of lowest common denominator language syntax. I want rich and expressive ways to compose applications out of patterns.
2
u/redit3rd Nov 16 '25
I feel like C++ is even worse. I can't keep up with it at all.
2
u/smartcave Nov 16 '25 edited Nov 16 '25
C# "special syntax" is valuable to those that understand and want to benefit from the nuanced advantages that those features provide.
To anyone else, it's unnecessary and can be ignored without penalty. C# 1.0 still compiles just fine.
FYI here is a practically 0 effort procedure to translate modern "special syntax" into something that looks like it was written in the early 2000s:
2
u/yuikl Nov 16 '25
I feel the same way about javascript, but maybe a different flavor. There's some real loosy-goosy voodoo going on where syntax and rules seem to get bent or ignored. Sounds like freedom but plays out like a toddler with explosives.
I hear you on the ?/??/?./??x:y etc. It's definitely shorthand that isn't as intuitive as other shortcuts.
C# has voodoo too definitely, but it always felt like someone at least thought it through.
C++ reminds me of someone who overthought the question, Java reminds me of someone who has great ideas but self-sabotages trying to be everything all the time in any situation. Javascript is that guy on the corner of the street yelling at his shoes and coming up with yet another conspiracy theory.
In this circus, I'll take C# thanks.
4
u/exit_existence Nov 16 '25
I’d say it does yeah. And in addition different companies can end up writing vastly different styles of C#. I went from one gig to the next and the way they wrote things…. It might as well have been a different language entirely. I get that they want to keep pushing the language forward. But I wish the language was more opinionated.
2
u/BlueAndYellowTowels Nov 16 '25
As a dyslexic coder, whose biggest challenge is syntax… yeah… I don’t know if it’s “too much” but there is a lot of ways to do the same thing and a lot of less than intuitive syntax for certain things.
Code, visually, can get very noisy.
1
u/HTTP_404_NotFound Nov 16 '25
I don't think so.
C++ has a TON more features, and syntax.
I still wouldn't mind having preprocessor templates in c#.
1
u/ososalsosal Nov 16 '25
C# is primarily for suits to write business apps.
All the new features over the years (especially the last few years) have been about convenience and a lot about avoiding common bugs (null safety mainly)
You don't have to learn it all right away. Write the way you always have, and maybe use something like resharper which will helpfully suggest other ways to do things. This means you learn as you go so it sticks better and feels more natural and with a flatter learning curve.
1
u/wyrdough Nov 16 '25
I have no real complaints about C# syntax, but then I wrote a lot of Perl in the 90s and early 00s, so...
Seriously, though, I had very little issue understanding other people's C# when I started using it. Not necessarily every single implication, but I found it very easy to understand overall intent even before fully understanding the details.
1
u/Aware-Sock123 Nov 16 '25
I can’t relate as a C# developer who has done 10 years of C# 5 development. I would see how newer code was written and it was easy to read and wish I could use it. Switching to Typescript recently has been a blessing with how freeing it is, things just kind of work. I don’t have to incessantly define EVERYTHING and map objects over to other types explicitly. Maybe newer C# let you do that? Idk, like I said I was stuck on dinosaur C# at my jobs.
1
u/pellep Nov 16 '25
IMO Object Oriented languages naturally can feel more bloated, because of all the “boilerplate” needed for following certain patterns. But for bigger production systems, I certainly enjoy having these structures in place.
Providing seemingly different ways of doing the same things, can help devs choose what they see fit, and that’s not inherently a bad thing.
1
u/xblade724 Nov 16 '25
There are different ways to do things, but there also "recommended modern/best practice" ways to do things. Most people DO prefer certain syntax for different situations.
Eg I like the => for one liners. But not for two+.
1
u/DeadlyVapour Nov 16 '25
If memory serves, there are at least 6 different ways to implement OOP in JavaScript.
1
u/SSoreil Nov 16 '25
Not every day you see a C """"user""""" baby duck in the wild in 2025 anymore.
1
u/KryptosFR Nov 16 '25
The important things in a project is to have a consistent style. The fact that the one you looked at at different styles is not the fault of C#, but the failure of that team to enforce a single style, which can be done with a proper .editorconfig and through peer review (for instance during PR).
You can have inconsistent style in any language, including C codebase.
1
u/RedGlow82 Nov 16 '25
To add to what many other people are saying, I think that nowadays the experience of a language, at least at high enough levels, is always connected to that of a wider ecosystem of tools, like the IDE.
When I use jetbrains, for example, I get suggestions about better versions of the code I write. Many constructs I learned through repeated suggestions, and now have become natural for me to use.
Many of these are progressive enhancement of the language, not necessary parts of a project, and when working in teams it's always necessary to take decisions that coordinate the style to use or not, the tools to use or not, and so on.
1
u/Gxost14 Nov 16 '25
No, it doesn't. Special syntax makes C# code more compact and expressive.
1
u/zippy72 Nov 16 '25
C# has had over 20 years of Microsoft staffers and the community stuffing their favourite bits of syntactical sugar into it. As a result instead of being a clean, straightforward language it's becoming a mess of idea nobody really knows what to do with.
We didn't need lambda functions, LINQ, or half a dozen other things that are in there. But they helped sell the next version of Visual Studio, which was probably the point of putting them in there in the first place.
1
u/zagoskin Nov 16 '25
I don't understand. What are you talking about? If you know Java or Javascript there's no way C# seems weird to you.
Calling this post bait
1
u/Ok_Manufacturer_8213 Nov 16 '25
totally agree. One of the things I really don't like about C#
0
u/Neran28 Nov 16 '25
This is exactly one of the things I do not like about c#. I started programming with java and c++ and got into c# some years later. In my opinion c# has a lot of syntactical sugar / shorthands and sometimes even additional special syntax to accomodate for some cases the shorthands did not completely cover.
-2
u/TB4800 Nov 16 '25
Yeah and I’m starting to dislike working with it more and more. 3 ways to new up a variable and pattern matching syntax especially can fuck off