4 ms·
I love .NET. It is highly productive, reasonably performant and you can competently write any kind of software using it beside systems programming. It is an exc
by DeathArrow 5y ago
I love .NET. It is highly productive, reasonably performant and you can competently write any kind of software using it beside systems programming. It is an excellent jack of all trades, and you can move with ease from game programming, to web applications, to desktop software, to small glue programs and utilities, to mobile apps, to web frontend and what not.
In the future even systems programming might be possible with push towards native apps and direct memory access. If at some point it will be possible to disable the garbage collector and manually manage memory, .NET could be used for everything.
For a company investing in .NET is a good idea since you can move with ease a developer from one role to another. And even if you don't move the developer, having a mobile developer who can read and understand the code for the backend APIs can be quite beneficial.
For me, personally, working with .NET was quite a win. I moved from desktop apps to web, then, when I got bored I moved to the gaming industry as a game developer and now I am again a happy web developer writing microservice based web apps. Meanwhile I also developed a few mobile apps for myself.
- throwuxiytayq 5y ago> If at some point it will be possible to disable the garbage collector and manually manage memory, .NET could be used for everything. While I haven't seen anyone disable the GC completely, plenty of people avoid using it in the Unity/gamedev world. You simply avoid allocating memory (outside of loading) and the GC isn't a problem when it has no work to do. Making sure none of your code allocates at runtime is only difficult if you "don't optimize prematurely" (write shit code without any understanding or regard for performance).
- mapmap 5y agoWhat is the technique to do this? Object pools?
- throwuxiytayq 5y agoIn case of Unity specifically, yes, re-using entire GameObjects whenever possible goes a long way. In game code, you can use structs instead of managed objects to avoid touching the GC. Unity provides NativeCollections, which are some standard collection data structures that can be used to store structs outside managed memory (which lets you avoid the GC). In real life it's next to impossible to avoid GC completely (especially if you rely on assets/libraries/even built-in engine features), but that isn't the goal - it's enough that you avoid allocating managed objects during gameplay simulation. GC can do its thing during level loading, cutscenes, in UI, etc.
- hackerfromthefu 5y agoYes, also know as Flyweight pattern from GOF. Used in latency sensitive systems like trading engines.
- hackerfromthefu 5y agoBeing able to disable GC would be great for WASM clients! Would solve the Blazor WASM perf issue. .NET was already used for systems level programming, you can read about an operating system build in it called Midori, by MS for research. While slower for some things it was actually faster for other things due to being able to make smarter runtime analysis than VMless code.. there's a fascinating series of articles about it floating around online.