Working, directly & small

Omar Rizwan recollects that one of the original selling points of React was that you could consolidate all the HTML, CSS, and JS for a single component in one file. No navigating across large directory trees to find the one line of code that implements the behavior you want. Far less worrying “if I change this am I unwinding a ball of yarn that I will regret?”

(Side note: one of the most powerful tools programmers have is scope. Most things are easier when you’re working in smaller and more local scopes. If your HTML/CSS/JS only applies to the file you’re looking at, many things are easy or possible.)

I’d forgotten about this selling point and wish things had evolved differently to support it. In the large, many programming techniques don’t work and this one is no exception. But in the small, how wonderful would it be to express everything about an idea you’re trying to build in just one place?

Lately, I’m finding that my prototypes and weekend hacks are most successful when I don’t try to get “too serious” about them too early. Adding type checkers, linters, even switching contexts to write automated tests are all “too serious”. If I give myself a little freedom to work messy and concentrate on the idea, not the code, things go better.

I suspect there’s a connection between working messy, generating ideas, and using a framework that doesn’t punish/forbid throwing all your code into one file.

By Adam Keys

Telling a joke. Typing.