Skip to content

Comment on Ask HN: Cowboy vs. disciplined coding in startups?

Comments

The only discipline I truly push for when asked this question is Test Driven Development. Reasons:

1) You can still code pretty fast (trust me on this, code moves only a tiny bit slower and then gains heavily when it comes to debugging even while coding).

2) You tend to think smarter. Stuff that escaped you in your hastily done whiteboard/skype meetings will show itself when writing quick test cases.

3) Your code gets partially arranged at least thanks to TDD. You can skip the refactoring after passing tests, but when technical debt catches up to you (and it will), you'll be ready because your tests will tell you where you broke stuff.

I look at TDD as a great foundation to build any crap on. At the end of the day, it tells you if your features are working. So even if the features are implemented with crap code, you can rest easy knowing that there's something watching out to tell you if you broke anything while redoing stuff.

For me, everything without TDD feels like a cowboy

PS - My experience in this. I've coded full on idiot style. No tests, no design, just code. It's only caused me grief when I look at things 6 months later. I've worked with a company coding full on idiot style. Most miserable time ever. I've coded again in my next company as a smarter person but without any tests. Ok design, no tests, still made my life miserable 8 months later. And then I've coded a full blown system using TDD and meh-ish design. Over time, I've updated the design and I continue to love working on this system. I really do. I look forward to getting back from work and coding on it. Where I work right now, I'm looking at very advanced OOP but no tests. It's ok-ish when someone explains it to you, but it's still really scary to even think of making changes in there.

So to sum up: my own idiotic coding, someone else's idiotic coding, my own ok design, someone else's advanced super disciplined design, and my meh-ish design backed by TDD. TDD wins. Rawr!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.