Hacker News new | ask | show | jobs
by socialist_coder 4604 days ago
I mostly program C# inside of Unity. What are some of the newer C# language features that it's missing that you think are pretty cool?

I have my game server as a C# MVC app as well (latest .NET running on Windows, not Mono/Linux) and the only things new that I seem to be using are the async and await keywords. But you don't need them inside of Unity since they have Coroutines and yield.

1 comments

I can't speak directly to the differences with Unity, but comparing C# from .NET 2.0 to the latest you're missing: LINQ, dynamic data types, extension methods, optional and named method parameters, covariance and contravariance, async and await... and a whole bunch I'm probably forgetting. It's a lot more flexible now and lets you take advantage of dynamic/functional code. After coding in 4/4.5 for awhile, I certainly wouldn't want to go back to a 2.0 ecosystem.
Extension methods work (I use those all the time), and async and await are unnecessary because Unity gives you coroutines and yield.

The rest of that stuff seems cool though. Oh well =\