Jump to content
  • Advertisement
Sign in to follow this  
IceCave

Unity Why C# all of a sudden?

Recommended Posts

For 20 years C++ was the recommended standard language, especially in the gaming industry. Mostly because it is fast and powerful, inheriting most programming language standards you can possibly think of.

There were a lot of languages to come and go, and some stayed.

 

I.e. Java, since 1995 the most hated of them all (at least how I experienced it).

Considered really slow, JIT is shit and its strong OOP rules and type safety is disabling the programmer or for whatever reasons. Causing (among others) a lot of religion flame wars between believers.

 

C# is basically a Java copy but with some changes to the base architecture like support for pointers, tuples, structs and more, extending the idea of Java.

Now this isn't a Java/C# comparison or discussion! C# wasn't "well" received at the beginning, either.

However, in the last two/four years I noticed that in general and in this forum C# suddenly got a big popularity boost, including but not limited to gaming industry.

 

I am neither against nor for C#, I get paid for writing code in a lot of languages, but

What changed? Why is C# or JITs (or for whatever reason Java and C# were hated) acceptable, now?

 

 

 

My personal interpretation for a very long time was Unity and possibly the name "C"# causing a popularity boost among young programming beginners causing old hands to rethink their stance.

Or is it just computers getting more powerful?

Edited by IceCave

Share this post


Link to post
Share on other sites
Advertisement

I.e. Java, since 1995 the most hated of them all (at least how I experienced it). Considered really slow, JIT is shit and its strong OOP rules and type safety is disabling the programmer or for whatever reasons. Causing (among others) a lot of religion flame wars between believers.

 

Java is a memory managed language, very similar (nearly identical) to C#, but has been poorly implemented, not just performance of its memory manager, but even actual bugging of it, such as memory acumulation over time, uneffective or even absent memory moving and pooling, too long sweep visits of manager etc.

 

Is it over? Do not know and I do not think.

 

On the other hand, C# has been an extremly well implemented mem-managed language on Windows NT platform.

C# applications will even outperform C++ aplications 90% of time, since C# will move memory, while static fixed heap allocations of a c++ process will never do so.

In other words, you will have to write top professional c++ aplication to outperform C#, while it is true that ideal c++ will outperform C# clone of instructions always.

 

C# is thus very popular in game development, it is performative, production safe (c++ can couse leak bugs that can even dump entire projects), fast to work, and it is popular even over the difficulty in actual game development it has, since DX has to be wrapped to be used safely in C#, as GPU can be accessed only thrugh c++ libraries (there are already C#/CLI modules that does the wrap, even official ones such as XNA, but XNA dated out with income of newer DXes).

 

CLI is the actual bridge between memory unsafe and memory safe modules of a process- what you have stated about pointers in C#, is not entirely true, pointers are in CLI, or unsafe blocks in C# that are not reccomended.

 

So yes, C# is so great that even gamedev industry desires for it, even if it has the one (difficult) obstacle mentioned.

Share this post


Link to post
Share on other sites

When it comes to tools work I've seen Java stuff since it was introduced around 1995,

I too have cried why Java did not shine over. Not even JASP -java active simple pages (as http active serving documents), are not coded at all! Through willigant atempts.

 

But, I accepted it, Linux is a free, and for free, you cannot get service, maintenance, support, guarentees..... etc. But I still thank to working Linux still, it just cannot compete with payed players :) !

Share this post


Link to post
Share on other sites

Unity and XNA and now Monogame are probably the big pulls for C# (And mono, Unity is technically some old decrepit version of Mono).  It's also a delightful language to program in compared to C++, depending on what you're doing, of  course.  At my day job, we use it for all our unit tests, because it's much faster to write, and cleaner than C++, so it's easier to write unit tests and easier to grok what the the unit test is supposed to be testing.

Share this post


Link to post
Share on other sites

Outside of games: You're late. C# has seen widespread use in client software development for a long time.


Not just client. It's been popular in server side for at least 10 years now (between "web methods", WCF, and lately ASP.net web APIs).

Share this post


Link to post
Share on other sites

The C# language is also fast moving, while it started as a poor mans Java in C#1 it has grown and now Java is trying to play catch up (Apart from the huge drag that Oracle owning it causes). C#6 was a great improvement and added some nice language features and C#7 brings proper tuple manipulation and some basic pattern matching. Even the introduction of Linq raised it far above Java. Most people see Linq as about enumerable types but the reality is that it is more like the computational blocks in F# and can be used for any type that provides a Select/SelectMany pair of functions (Bind and Map in other languages)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!