News for hackers. Stuff that matters.
Re:Anime is booming, so why are animators living in poverty? by Jasper_ on Friday February 26, 2021 @11:02AM (#26276125)
Let me offer you some advice, based on a few years in the games industry: I think every other industry's approach to code cleanliness breaks down for complex, intertwined simulations with strict performance requirements.

If Google cared at all about the targets that game developers cared about, my Gmail wouldn't take 10 seconds to load and run at 2FPS once the page is there.

I've read some of the best code I've ever seen, written by programmers in the games space. Code with very few tests, heavy intertwined behavior, wide-reaching global effects, and lots and lots of state.

Ultimately, treat the code as an artifact of the project: make it as clean as you need to get the game done, but any extra scaffolding you add will only come back to bite you later once you want to change how something is wired. From that end, all the usual suspects apply: make code easy to delete, make it have clearly-defined boundaries, and depend on other code as little as possible. Push yourself to use copy/paste more than you think you should, you'll be surprised how easy it is to delete wild experiments if you don't have to untangle the web of dependencies.

Re:Anime is booming, so why are animators living in poverty? by munificent on Friday February 26, 2021 @12:50PM (#26277590)
I worked at EA for eight years and have worked at Google for the past ten. Google and the GMail team most certainly understand how to write performance critical code. Your favorite game would take 10 seconds to load and run at 2FPS too if it had to be pushed over the Internet every time it started up and run inside any of a few only mostly-compatible VMs for a dynamically-typed scripting language never designed for anything more important than making buttons light up when you hover over them.

You're correct that optimized code is generally harder to maintain. Optimization often requires punching through abstraction layers or calcifying certain constraints or assumptions in the code.

Re:Anime is booming, so why are animators living in poverty? by souprock on Saturday February 27, 2021 @02:46AM (#26283383)
If the GMail team understands how to write performance critical code, then there must be something else to explain why they no longer do. Hmmm... by making old hardware unusable, they cause hardware upgrades, and somehow that drives licensing? The simpler explanation, fitting Occam's razor, is that the GMail team does not understand how to write performance critical code.

FYI, about a dozen years ago I comfortably used GMail on a 450 MHz PowerPC with 512 MiB of RAM. The javascript ran without a JIT, completely interpreted. It all ran just fine. Now here I am, on a multi-GHz multi-core box with gigabytes of RAM and a JIT, and I have to keep GMail in HTML-only mode. I simply can't run the javascript and still operate my computer. Mail is piling up because I can no longer select lots of email for deletion; it isn't practical to click every single item.

Re:Anime is booming, so why are animators living in poverty? by Jasper_ on Friday February 26, 2021 @01:26PM (#26278015)
I'm a game dev, and I work on high-performance websites in my spare time (e.g. https://noclip.website/#mkwii/beginner_course ). It's actually possible to make stuff that runs fast in "mostly-compatible VMs for a dynamically-typed scripting language never designed for anything more important than making buttons light up when you hover over them" if you actually try. But Google does not, so we end up with gmail.
Re:Anime is booming, so why are animators living in poverty? by bluefirebrand on Friday February 26, 2021 @11:23AM (#26276429)
Thank you for the advice. :)
Re:Anime is booming, so why are animators living in poverty? by katbyte on Friday February 26, 2021 @11:35AM (#26276579)
over DRY code is the bane of my existence