logoalt Hacker News

nlawalkertoday at 4:20 PM5 repliesview on HN

This reminds me of a portion of a talk Jonathan Blow gave[1], where he justifies this from a productivity angle. He explains how his initial implementation for virtually everything in Braid used arrays of records, and only after finding bottlenecks did he make changes, because if he had approached every technical challenge by trying to find the optimal data structure and algorithm he would never have shipped.

"There's a third thing [beyond speed and memory] that you might want to optimize for which is much more important than either of these, which is years of your life required per program implementation." This is of course from the perspective of a solo indie game developer, but it's a good and interesting perspective to consider.

[1] https://www.youtube.com/watch?v=JjDsP5n2kSM


Replies

dgb23today at 4:52 PM

It's also notable that video games are programs that run for hours and iterate over large sets of very similar entities at 60 frames or more per second repeatedly and often do very similar operations on each of the entities.

That also means that "just do an array of flat records" is a very sane default even if it seems brutish at first.

show 1 reply
Insanitytoday at 4:23 PM

It's easy to see this outside of the perspective of a solo game developer. We all have deadlines to manage even in the regular 'corporate world'. And engineering time spent on a problem also translates to an actual cost.

It's a good consideration tbh.

skeeter2020today at 5:00 PM

I'd be careful extending learnings from games (solo or team efforts) to general programming as the needs and intent seem to be so different. We rarely see much code re-use in games outside of core, special-purpose buy largely isolated components and assets. Outside of games there's a much bigger emphasis on the data IME, and performance is often a nice-to-have.

show 1 reply
Fraterkestoday at 7:04 PM

This is slightly surprising to me, since Braid is kinda infamous for being in development for a pretty long time for a puzzle platformer

show 1 reply
suzzer99today at 6:54 PM

> how his initial implementation for virtually everything in Braid used arrays of records

This is me with hash maps.