I've noticed that developers are good at identifying and learning best practices. I've also noticed that they're equally good at coming up with reasons why the best practices don't apply in some particular case they're working on.
If that's you, don't worry. I'm not here to slam you. In fact, I think it's something that we all wrestle with daily. We know the ideal, but we often want to bend the rules. Why is that?
Prototypes and Proofs-of-Concept
Well, sometimes we don't know if something is possible. For example, if we're integrating with a third party SaaS solution, we've gotta write some code to learn their API and figure out how to get it to do what we want. When we're writing prototypes and proofs-of-concept, we wanna go. We wanna move fast. We wanna figure out as much as we can, as fast as we can... without having to burden ourselves with the added effort required to follow best practices.
I think there's a legitimate case, here. If you're building nothing more than a proof-of-concept, practices like Test-Driven Development might have very little pay-off. Best practices are investments -- they take more effort up front, and they pay back that effort in spades as the application grows. But if the goal of your code is simply to prove something, or to demonstrate something, you might not need the long-term benefits that best practices provide.
Artists don't create masterpieces every time. Sometimes they just want to sketch out a few ideas to see what works.
Prototype != Production
Where we get into trouble is when we write code to prototype or prove something within a code base that will eventually go to production. We never intend for it to go live, of course. But if it's not entirely in its own ecosystem, it's likely that the proof-of-concept will end up going live, possibly in order to accommodate a demanding project schedule.
It's Tempting
I'll admit that the phrase "I just want to see if this works" goes through my mind frequently, even when I'm working on non-prototype code. It takes wisdom to know when you should give in, and it takes discipline to stand up to it when you shouldn't.
No comments:
Post a Comment