Lurker News
And what made it so good?

Was there someone enforcing good practices top down? Just being in a group of great engineers? Or something else?

Comments (454) 104 threads

Earlier comments
jhon-crypt#
The best codebase I've ever worked on was when I started software development officially, I had zero knowledge of the stack for real, the codebase was run by just 5 mid level engineers, but based on how well structured and understandable it was, i was able to pick up the stack without reading a tutorial or a documentation, i would later read up on it when i started doing complicating stuff tho, but it's important for engineers to write good code to the extent that another person reading it does not have to look up something just to understand why this does that, and how stuff works in the code
somenameforme1 reply#
Unreal Engine, by far.

It's not only just extremely well written in general (with your only chance of 'really' learning the engine to go through it, read comments, and the like) but it also defies the wisdom 'everybody knows.' That wisdom being that premature optimization is the root of all evil - like we're supposed to just benchmark things, see where the bottleneck is and then try to work on optimizing spots like that.
Unreal doesn't do this. There are countless thousands of micro-optimizations everywhere. For one striking example there's even a fairly substantial system in place that cache the conversion between a quaternion and a euler rotation. This would never, in a zillion years, be even close to a bottleneck. But with thousands of these little micro-optimizations everywhere you get a final system that just runs dramatically better than any comparable engine.
In more general terms, they've also taken advantage of the 'idiomatic flexibility' that C++ offers to create a sort of Unreal C++ language that is also just lovely to use and feels much closer to something like C# in terms of luxuries like the lack of manual memory management, garbage collection, reflection (!!), and so on. The downsides are that compile times are horrible (even though a cached compile might only take 10 or 15 seconds, it feels like forever when trying to work out one specific issue) and C++ intellisense, especially in a preprocessor heavy environment, is pretty mehhhh.

01HNNWZ0MV43FF1 reply#
> there's even a fairly substantial system in place that cache the conversion between a quaternion and a euler rotation

I hope that does show up on a benchmark though, cause that sounds complex

somenameforme#
It definitely would not. The rotation either way is a mixture of up to ~20-30 primitive basic floating point operations, and a few geometric (sin/cos/etc) operations, and you only need to do it in the cases where you're actually going between both systems, and more than once. It's difficult to even ballpark, but it's highly likely that the caching gives anymore than a fraction of a percent of performance boost, like 0.5% or whatever. But now multiply that over hundreds to thousands of similar little 'premature' optimizations.
noelwelsh#
My open source projects. One in particular I've been working on for about 10 years. The code is consistent and always getting better, even though there is a lot more work that could be done.

Load more comments