“Using singletons is bad. Don’t do it, ever.”
“Don’t micro optimize your code! It’s pointless!”
“Don’t worry about performance until you have performance problems.”
“100% code coverage is necessary for your unit tests.”
You’re writing a PHP application. You know you need to write tests. Tests aren’t something that comes naturally to you yet; you’re still working on learning the ins and outs of PHPUnit (the default standard framework). But you know that right now, your app isn’t testable. What can you do to make it testable?
The single most important thing you can do to make your app testable
Bad code. You’re stuck with it. Lots of it. Over time, one small hack has led to many. Before you know it the technical debt in your application is stacked to the ceiling. It’s hard to make heads or tails out of things. How can you fix it? What can you do?
Over the past few days I’ve been working on fixing small bits of applications from years past. Though none of them are what I’d consider “horrible legacy code”, all of them are neglected but critical aspects of our product delivery cycle. One app in particular showed signs of the times it was written: in a time before PDO, before object oriented PHP, before the mysql_* group of functions was deprecated.
You’ve been learning object oriented programming. But there are certain things you don’t grasp. No matter what, you have questions that you can’t answer. Wouldn’t it be great if you could ask someone directly?
You’re in luck!
I know most developers like you love to learn new things. They thrive on conquering new challenges and learning new techniques. Many people learn new languages just for the challenge. After all, why would anyone ever write a Brainfuck interpreter in the first place?
Many of us receive our training through our employers. We expect and accept that our employers will offer us continuing growth opportunities to boost our skills. But this creates a problem for us as our careers go on. How can you effectively train yourself for the skills you’ll need in your next job?
You’ve worked hard. You’re ready. Your product is awesome. You’re geared up. It’s time. You launch.
You check your email. The first order comes in. Then the next. Pretty soon it’s a flood. You beat your single day goal. You beat your strech goal. This is awesome! You’re excited. You go out to dinner, order champagne. Sales roll in overnight.
By the time you wake up the next morning (probably with a hangover), your excitement has truly built to almost an unbearable level. But then the inevitable happens: your sales slow down to a small stream. Then a trickle. Then to almost nothing.