Hacker News new | ask | show | jobs
by avgDev 1197 days ago
I found myself stuck in analysis paralysis and fear of not creating a perfect app. I became my worst enemy. My app was praised by VP, managers and staff using it, yet I saw it as a pile of garbage.

Then I realized it doesn't have to be perfectly DRY, it could technically just be spaghetti. It isn't spaghetti but some things could be improved. While, better designed apps are easier to work with sometimes there are situation where it is impossible to create a formal design document, so you just need to 'send it'.

The next iteration will improve many things, but if were to do those things initially the app would be in development for years, and now it is running a business.

4 comments

With time I've progressively become less concerned with staying DRY, which perhaps counterintuitively has made it easier to avoid spaghetti problems. It's easier to keep things clean with a handful of near-duplicates that are tailored to the needs of their call sites than it is with a single trying to do everything.

It's a bit more work to keep behavior consistent across duplicates but I'll take it if it means less untangling work for myself in the future.

I’ve found the same, and have leaned more into patterns and proximity as guides. Find good patterns that can be repeated easily and predictably. Also, keep related code close together so it’s easy to find and copy somewhere else. Often times there are higher level abstractions that emerge which can then be “dry”ed out, but trying to do that too early creates more problems than it solves.
Garbage that shipped and has customers and a purpose (and maybe makes money, if your company is interested in that) is called Legacy. Perfect code that never shipped doesn't have a name.

Worst case, your garbage code gets you 6-12 months with customers and it has to be thrown away. No big deal, you said it was garbage and now you've got 6-12 months of actual knowledge of what your customers need and want, instead of what you thought they would need. You can make new legacy garbage that's much better than the first version now.

When I have analysis paralysis and feel my app is a pile of garbage, I identify which part of the code I am most afraid of and then rewrite it and put tests around it, whatever it takes to become super confident that that one part I was afraid of is now working correctly.
I think of building software kind of like making pottery or sculpting in general. I just get something useful working to start with, it doesn't matter what the structure is. It's a lump of clay to be refined.