Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
What I find fascinating about this trilogy is that C, C++, and C# didn't simply replace one another. Each made a different trade-off between control, performance, safety, and developer productivity.
But here's a question:
If you were starting a completely new project today, would you choose C for maximum control, C++ for zero-cost abstractions, or C# for developer productivity?
And more importantly, what would make you choose one over the other?
I'd love to hear some real-world reasoning, not just language preferences! π
(Also: this is my first post under DEVengers, hope it resonates with you all!)
Senior Full-Stack Developer and a Community Curator on DEV!
"α΄ κ±α΄α΄α΄α΄Κ κ±α΄α΄ Ι΄α΄α΄ α΄Κ α΄α΄α΄ α΄ α΄ κ±α΄ΙͺΚΚα΄α΄ κ±α΄ΙͺΚα΄Κ" - κ°Κα΄Ι΄α΄ΚΙͺΙ΄ α΄ . Κα΄α΄κ±α΄α΄ α΄Κα΄
A good reminder of C, C# and C++. New information for me surprisingly, so it's good to see the history behind it.
I think it's also leave noting about the security aspects of it such as various attacks if you didn't write "correctly". For example, the most common is overflow attack if you written "C" in an un-optimized way.
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Really enjoyed this, Dhruv. I donβt code in C, C++ or C#, so I never knew the history behind them until today. I didnβt know C# came about because Microsoft walked away from Java after the Sun lawsuit, or that C++ started as βC with Classesβ at the same Bell Labs where C was made. Such an educative post, thanks for sharing!
Backend engineer exploring distributed systems, AI, developer tools, and security. I build things to test ideas and write about what worked, what failed, and what I learned.
Great read! I think Ken Thompson and Unix deserve a mention here too. Rewriting Unix in C was a huge step in making operating systems portable. Maurice J. Bach's The Design of the UNIX Operating System is also worth mentioning. It goes pretty deep into System V and shows how many of those early design ideas around processes, memory and file systems are still relevant today.
The framing of each language as a different trade-off rather than a ranking is what makes this work. If I had to pick one for a brand-new project tomorrow, I would take C#: the managed runtime and garbage collector remove the whole class of memory bugs that C leaves on the developer, and for most web or app work that safety is worth more than the raw control C offers. The RAII section was the clearest explanation of why C++ still earns its place in game engines and browsers, though β that part alone made the history worth reading.
The lineage is a useful reminder that languages carry trade-offs forward, not just syntax. It would be interesting to map one recurring boundaryβmemory ownership, abstraction cost, or interoperabilityβacross all three ecosystems. That makes the historical connection actionable for someone choosing where safety or control should live in a new system.
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Interesting read, and a nice framing. Iβll answer your question from a slightly odd seat, though, because I donβt write any of the three. I run things written in them.
From that side, the decision isnβt about memory safety at all. Itβs about what the build produces. A C or C++ binary drops into a scratch or distroless image with almost nothing around it, so the only patch surface is my own code. A C# service ships a runtime, and that runtime is its own patch surface, its own cold start and its own memory floor before my application has done a thing.
So my pick would be C#, for the reason your post doesnβt quite reach: Iβd rather carry the runtime and take the productivity, because the operational cost of a runtime is predictable and the cost of a memory bug in production isnβt.
Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
The three still meet at one seam worth testing: P/Invoke. C#'s bool marshals as a 4-byte Win32 BOOL by default, so a callee declared as C _Bool reads the low byte and the rest is whatever the register held -- declare the parameter byte or [MarshalAs(UnmanagedType.U1)] before you lose an afternoon to it. Same reason a std::string cannot cross: neither C++ nor .NET ships a standard ABI, so the portable seam is extern "C" with char* plus an explicit length on one side and IntPtr + Marshal.PtrToStringUTF8 on the other. First move on any such bug is sizeof the struct on both sides and compare, not step through a debugger.
This is great, I know how we started from C in 1st year to C# in 3rd year. But still since I'm using java for competitive programming I got used to it and never returned to C family!
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Cool, nothing wrong in it! I've always seen C# completing all needs that Java has and Cpp didn't. And somehow you know I got my 1st internship and some months later a job in .NET. So, I'm used to this family!π
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Upcoming Trainee Engineer @ Simform π
Building, experimenting, and writing my way through tech.
AI β’ Web β’ Open Source β’ Challenges
If I find something interesting, I'll probably write about it. π
Great Di, Actually as I said earlier game dev sounds very tempting to me but I went through some tutorials on codecademy and realized its not for meπ .
But hats off to you! I'd love to try out your work!π
We're a place where coders share, stay up-to-date and grow their careers.
π¬ Let's make this interesting!
What I find fascinating about this trilogy is that C, C++, and C# didn't simply replace one another. Each made a different trade-off between control, performance, safety, and developer productivity.
But here's a question:
If you were starting a completely new project today, would you choose C for maximum control, C++ for zero-cost abstractions, or C# for developer productivity?
And more importantly, what would make you choose one over the other?
I'd love to hear some real-world reasoning, not just language preferences! π
(Also: this is my first post under DEVengers, hope it resonates with you all!)
This is awesome Dhruv! First DEVenger post!
A good reminder of C, C# and C++. New information for me surprisingly, so it's good to see the history behind it.
I think it's also leave noting about the security aspects of it such as various attacks if you didn't write "correctly". For example, the most common is overflow attack if you written "C" in an un-optimized way.
Otherwise, a good introduction! Good work :)
That's the thing with C that Denis Ritchhie trusted devs that they'll do their job properly!π
One of my experiment is back to the C vibeing instead of rust
Sir, we'd like to hear more about your experiment!
Will be soon around Nov 25. A vim like linux markdown first CLI editor.
Looking forward to it Sir!
Have A Great Day!
Really enjoyed this, Dhruv. I donβt code in C, C++ or C#, so I never knew the history behind them until today. I didnβt know C# came about because Microsoft walked away from Java after the Sun lawsuit, or that C++ started as βC with Classesβ at the same Bell Labs where C was made. Such an educative post, thanks for sharing!
Great read! I think Ken Thompson and Unix deserve a mention here too. Rewriting Unix in C was a huge step in making operating systems portable. Maurice J. Bach's The Design of the UNIX Operating System is also worth mentioning. It goes pretty deep into System V and shows how many of those early design ideas around processes, memory and file systems are still relevant today.
The framing of each language as a different trade-off rather than a ranking is what makes this work. If I had to pick one for a brand-new project tomorrow, I would take C#: the managed runtime and garbage collector remove the whole class of memory bugs that C leaves on the developer, and for most web or app work that safety is worth more than the raw control C offers. The RAII section was the clearest explanation of why C++ still earns its place in game engines and browsers, though β that part alone made the history worth reading.
The lineage is a useful reminder that languages carry trade-offs forward, not just syntax. It would be interesting to map one recurring boundaryβmemory ownership, abstraction cost, or interoperabilityβacross all three ecosystems. That makes the historical connection actionable for someone choosing where safety or control should live in a new system.
Sure Sir, that'd make it more helpful and interesting but I wrote this with my knowledge as a student!π
Clean architecture is easy to maintain in a slide deck; the real test is how gracefully the system degrades under cascading production failures.
Minimizing abstraction layers and owning your critical runtime path will always outperform adding more third-party glue.
Interesting read, and a nice framing. Iβll answer your question from a slightly odd seat, though, because I donβt write any of the three. I run things written in them.
From that side, the decision isnβt about memory safety at all. Itβs about what the build produces. A C or C++ binary drops into a scratch or distroless image with almost nothing around it, so the only patch surface is my own code. A C# service ships a runtime, and that runtime is its own patch surface, its own cold start and its own memory floor before my application has done a thing.
So my pick would be C#, for the reason your post doesnβt quite reach: Iβd rather carry the runtime and take the productivity, because the operational cost of a runtime is predictable and the cost of a memory bug in production isnβt.
The three still meet at one seam worth testing: P/Invoke. C#'s bool marshals as a 4-byte Win32 BOOL by default, so a callee declared as C _Bool reads the low byte and the rest is whatever the register held -- declare the parameter byte or [MarshalAs(UnmanagedType.U1)] before you lose an afternoon to it. Same reason a std::string cannot cross: neither C++ nor .NET ships a standard ABI, so the portable seam is extern "C" with char* plus an explicit length on one side and IntPtr + Marshal.PtrToStringUTF8 on the other. First move on any such bug is sizeof the struct on both sides and compare, not step through a debugger.
This is great, I know how we started from C in 1st year to C# in 3rd year. But still since I'm using java for competitive programming I got used to it and never returned to C family!
Cool, nothing wrong in it! I've always seen C# completing all needs that Java has and Cpp didn't. And somehow you know I got my 1st internship and some months later a job in .NET. So, I'm used to this family!π
Also, bro good for you joining DEVengers!
Thanks bro!
Pretty cool! Reminds me of my college days :) Currently using C++ for game dev!
Great Di, Actually as I said earlier game dev sounds very tempting to me but I went through some tutorials on codecademy and realized its not for meπ .
But hats off to you! I'd love to try out your work!π