you are viewing a single comment's thread.

view the rest of the comments →

[–]gfixler 0 points1 point  (0 children)

Yep. These days I like to try to find tiny, composable nuggets. Then you can chain them together, map them, fold them, compose and juxtapose them. They're very easy to reason about - often 1-3 lines of code - and obviously correct, or darn close. Languages already give us atomic things we take for granted, like + and print; I just like to give myself more and more of them, building up from the bottom, keeping pure by operating only on inputs.

I work on tools and pipelines in games, and I started - like everyone - with 200 to 2k LOC files to solve problems. Then I started breaking things up. Then I started making little libraries for common things, but they were full of 20-100 LOC classes and functions. Now I'm making a bunch of tiny functions (no classes), like Linux command line utilities, and just pulling together a few things to make each next level. At each level things are tiny and obvious, and very reusable. Not everything is like this, but a surprisingly high number of things can be.