Why Would I Ever Pick C#

Tags: webpage, development, technology, C#, java

The Current state of Web

I’m in the business of making web sites. I’ve made a lot of react websites a few Angular sites, I tried Vue, tried HTMX, Svelte kit the whole kit and kaboodle. I’ve seen things.

I started my life as a programmer doing web sites using jQuery and the backend was C# .NET.

In those days was like the .NET framework like 3.5 or 4-something - it was always some combination of those words dot net framework web MVC or some other hodgepodge. I remember those days thinking that, it was very convenient, it was a very cool tool and it made a lot of sense to use it back then.

If I do a retrospective, which I didn’t do at the time, the other kinds of technologies that were out there were like low level Java. I don’t really think Spring and Spring boot were in vogue then (they were brand new). You had PHP for everyone to have a single unified platform (bad). And some people were doing were doing express and JavaScript on the back end and they were thought of as the prototype / hacker guys. The guys who really working on stuff that hadn’t been proven yet. It hadn’t!

In that context .NET and other server side languages made a lot of sense.

Nowadays, you have a lot of options. The web boom happened. We never really stopped making back end technologies never really stopped making backend frameworks.

In the current climate of mass frontend languages, frameworks, and libraries you can pick from a lot of it is going to come down to what you’re already using.

Why use C# now?

The question I had looking back at .NET was why would I ever pick it now?

If you have a great answer to this email me and I’ll write a follow-up synthesizing your info.

Say you have a totally greenfield project; no backward dependencies, nothing you have to support. Say you have that and you want to build a website that does something. You have some data that like a database and presumably a web server that delivers an API.

What would you pick to do that?

Again, the options are pretty limitless. You can go for all JavaScript; front to back end to all the way to the ORM. I guess you could even have a JavaScript based up database - I’m not sure you should do that. But you could have all the layers written in the same language.

That was kind of the nice thing about PHP back in the day; the language for your server back end was the language that your website was written in.

You know sans some JavaScript because if you want to have some interactivity with out rendering you needed JavaScript. Even then.

We also have a whole lot of new languages: we have go, Rust, and Zig. Google invented go to replace C++ on the back end and to have something fast built for the web. There’s a lot of frameworks that use go and the template language to create web services. It’s custom built for the web and it’s known to be decently performant.

Java has the Spring Boot system and at the other main thing with that is that in the database world often times you’re gonna be using Oracle DB. Java works pretty well for that… if you can get over the licensing costs.

And so we kind of get to C# and I think it’s in the same spot as Java.

Why Would you Pick C#?

The only reason you pick C# is if you already know the language, if you’ve been using it for a long time, and if you have to connect to an MSSQL database. Otherwise, why would anyone pick C# or java for their back end?

The argument can be made you might need to run a bunch of different servers. Both of these languages are interpreted languages. To be more precise Java and C# both use an intermediate step just called different things. C# uses intermediate language and Java uses byte code; both get sent to an interpreter that converts it to real computer code that can execute.

At least from a technological standpoint both are equivalently portable.

Express (JS) also happens to be decently portable. I’m not saying that there aren’t any differences between the Windows server stuff that happens with express and the Linux stuff. But what tends to happen is you tend to ship it as a docker container - so nowadays you’re developing and running on Linux no matter what you’re doing.

PHP the whole selling point is Laravel at this point. Most people aren’t using PHP how it was used back in it’s heyday. I think it’s relegated to PHP programmers and people who really know the ecosystem, so it’s the same argument.

Why Bother

The reason i ask this question is because, if you’re going to start a new project there is a compelling reason to use Javascript on both sides (that being, everything is in one language, 0 overhead from language switching).

Using Express you’re saying that you don’t need the maximum level of performance. Node is not the most performant for a lot of things. It’s decently good, but you’ll probably notice that the teams who are doing the most complex and computationally expensive things aren’t using it. They probably ran into those performance bottlenecks already.

If that’s you why are you reading this to begin with?! You already know what you have to do!

But if that’s not your problem then you might be inclined to only use one language for your entire project so it’s easier to read your code! So there’s at least 1 good reason to not pick Java or C#.

Food for thought.

My Restated Question

So if you’re a C# developer or a Java developer I’ve really been looking for the answer to this:

Why should I use Java or C# as a platform.

I can’t think of any significant reason that you would say you can’t use Express, but you could you C# and Java to host your back end. Essentially I’m not looking for these answers: “I already knew the language,” “It’s portable,” “I have to connect to an Oracle DB / MSSQL DB,” “It’s Object Oriented.” These are all weak answers, and it may be that there’s no strong answer!

This is an open call to any C# developers or Java Developers. If you want to send me an email I don’t really have a good way to chat with you but some you know I can post the response to this and we can talk candidly.

But it seems like these technologies aren’t inherently helpful, they just are situationaly helpful. By the way,

I feel like that’s not right, and I feel like I’m missing something. But I’ve been looking for a couple of a months now and I can’t find anything compelling.

JavaScript is also not inherently helpful, but it happens to be the common language of the web, so it has that quality.

Thoughts about the Two

I think of the two Spring Boot is more compelling who is in terms of popularity of feels like Spring Boot is more compelling and the only reason that C# exists is that it was good in the day and it hasn’t gone away. Microsoft kinda supports it and keeps it alive. C# development is tightly bound up with Microsoft, which to avoid a secondary rant I will consider a bad thing. Oracle is tightly bound to Java, but at least their tooling is so bad that most non-corpo java devs I know roll their own environments and actually don’t have to pay the Oracle Tax; Java is better for building things for yourself.

You compare blazer to React and Solid.js, and it feels bad to use it. And you’re not getting the benefits of having one language on both sides, so what’s the point? (and it’s slow)

I think technically C# is probably a better language, that’s fair but damn you don’t need C# to run the web been you need JavaScript.

That maybe an unfortunate thing to hear (considering how javascript is), but it’s true.

You don’t need C#, you don’t need Java, you don’t need PHP.

You could also argue don’t need JavaScript, in that case though what you’re dealing with is what we are currently looking at it as an interesting revolution which kind of nullifies this whole discussion: in that case go with HTMX and maybe use Go or Rust. Because they have the speed and they’re lean. They solve the problem without loading you up with all his other stuff that comes along with these platforms

That’s all for this rant-y post!