News for hackers. Stuff that matters.
Re:Unity plan pricing and packaging updates by matt3210 on Tuesday September 12, 2023 @11:43AM (#37482993)
C++ is a much better language than c#, what’s your reasoning here?
Re:Unity plan pricing and packaging updates by bilekas on Tuesday September 12, 2023 @12:31PM (#37483781)
Better is relative. And it's just a different type of tool. To be honest I know many more better engineers who primarily work with dotnet over CPP. The learning curve for CPP is higher because the ability to shoot yourself in the foot with CPP is higher. It's neither better or worse. Just a different tool in a toolbox.
Re:Unity plan pricing and packaging updates by fnordpiglet on Tuesday September 12, 2023 @12:01PM (#37483296)
I think a lot of people find the learning curve of c++ fairly extreme, especially when considering the amount of knowledge to do idiomatic programming in c++ required to “do things elegantly.” C# and related languages tend to have idioms baked in closer to the syntax and grammar. My view of c++ after 30 years of it is it’s great if you’ve got 10 years experience programming it within a team of seasoned c++ programmers who shows you the ropes. Even then I think rust is the language I wished for all these years (albeit not for game dev yet). Finally, for the reasons rust isn’t great for game dev, c# and ilk generally have excellent reflective and dynamic natures making them sort of the sweatpants and old T-shirt language for game programming.

That said, it locks you into using stuff like mono and stuff for cross platform which makes me a sad.

Re:Unity plan pricing and packaging updates by whoisthemachine on Tuesday September 12, 2023 @02:17PM (#37485226)
> That said, it locks you into using stuff like mono and stuff for cross platform which makes me a sad.

Microsoft's .Net Core runtime (now just .Net) has supported Linux and MacOS since 2016, so this information has been out of date for 7+ years.

https://devblogs.microsoft.com/dotnet/announcing-net-core-1-...

Re:Unity plan pricing and packaging updates by fnordpiglet on Tuesday September 12, 2023 @04:05PM (#37487340)
Oh thanks! I stand corrected. Good to see.
Re:Unity plan pricing and packaging updates by TylerE on Wednesday September 13, 2023 @11:23AM (#37497996)
But that does NOT include WinForms.
Re:Unity plan pricing and packaging updates by Qwertious on Tuesday September 12, 2023 @12:04PM (#37483343)
Define "better language". If you don't need performance then C# can make your life much easier.
Re:Unity plan pricing and packaging updates by kroltan on Tuesday September 12, 2023 @12:33PM (#37483804)
The new versions of C# can compile ahead-of-time, and have expanding support for value types and pointer-like semantics, so you're not stuck with the Java-y OOP For Everything paradigm if it doesn't fit your requirements.

The standard libraries are still an allocation party, of course, but that can be supplemented in an engine context.

Re:Unity plan pricing and packaging updates by Thaxll on Tuesday September 12, 2023 @01:26PM (#37484548)
Famous last words, even with the optimization in the latests net core clr, it's nowhere close to C++.
Re:Unity plan pricing and packaging updates by sha90 on Tuesday September 12, 2023 @02:22PM (#37485278)
Citation needed? Raw speed is likely similar; the cost overhead comes from GC cycles and the general approach to managing memory primarily in the heap vs stack, although C# can stackalloc if you're really diligent. Note that this is the same problem that blazing fast alternatives like Go have at competing with C/C++. These languages are mostly equivalent to C/C++ in speed, but lose the benchmark shootouts because of GC.
Re:Unity plan pricing and packaging updates by neonsunset on Tuesday September 12, 2023 @07:38PM (#37490183)
Calling Go blazing fast would be a stretch at best...the path to performance in C# is same as in Rust or C++: struct generics (aka templates), as short hot paths as possible, static partitioning of the work, sometimes hands on memory management and minimization of locking.
Re:Unity plan pricing and packaging updates by kevingadd on Tuesday September 12, 2023 @03:54PM (#37487126)
This is a pretty wild generalization to make. It's not hard to contrive scenarios where C++ with its notoriously slow stdlib (despised by game developers) is going to be slower than C# with its JIT doing runtime optimizations like guarded devirtualization.
Re:Unity plan pricing and packaging updates by dagw on Wednesday September 13, 2023 @07:40AM (#37495397)
C++ written by people who really good at writing fast C++ is faster than C#. Naive and readable C++ written by average programmers wanting to solve a problem in the obvious way on the whole isn't faster than C#
Re:Unity plan pricing and packaging updates by sha90 on Tuesday September 12, 2023 @02:29PM (#37485398)
Keep in mind that in addition to the "learning curve" arguments, there is also the functional developer ergonomics of things like live reload (where you can maintain memory state) that are simply not possible to do with C++ without heavy limitations or customized tooling.

Being able to fix a bug without resetting memory state is a huge ergonomic advantage in game development where generating the right memory state can be incredibly complex and depend on a ton of very specific and hard-to-reproduce factors. Not to mention incredibly slow.

Re:Unity plan pricing and packaging updates by fxtentacle on Tuesday September 12, 2023 @03:00PM (#37486093)
"Being able to fix a bug without resetting memory state is a huge ergonomic advantage in game development"

Visual Studio works with UE and calls that "Edit and Continue" and it works in C++, too.

Re:Unity plan pricing and packaging updates by sha90 on Tuesday September 12, 2023 @03:54PM (#37487109)
Yes, but it has many known limitations and isn't nearly as reliable as a runtime that has a full GC and virtualization optionality, which you really need in order to fully track what state can be evicted and what needs to stay.
Re:Unity plan pricing and packaging updates by johnnyanmac on Wednesday September 13, 2023 @12:52AM (#37492341)
Game devs want fast iterations above everything else, with performance being a close second. c++'s "toolchain" makes those iterations prohibitively impossible, even with decades of workarounds with hot reloading and extravagant methods to keep compilation times down.

If you're a AAA dev you give up a lot of that iteration because performance overtakes you, but there's little reason some indie 2d platformer will want to deal with even 30 second iteration times (which would be blazing quick for a AAA setup). C# is a mature, familiar environment for devs with similar syntax to C++ that can get decent performance as long as you maintain some discipline (for starters, no LINQ)