It’s 8:01 AM. Your boss says you’re late. He wants the code built that you were working on the other day. (You don’t do continuous anything there except whine about your job for not having any tools.) He said the testers need your latest build. He’s pissed. He always seems pissed though.
He’s married to a real bitch, a beautiful bitch who rocks his world (she’s read Fifty Shades of Grey, twice), however, so it’s all worth it he thinks. When they were courting, to win her heart he had to promise her a comfy republican lifestyle, which he later delivered on.
He also had to promise her dad a 40 acre parcel of land that the dad wanted to use as a hobby farm. His wife can never find out though because she is a modern woman (she just read Lean In) and would be furious if she knew her father and husband made a gentleman’s agreement.
Your wife, however, is really sweet, so life is good for you other than your boss and not having any tools at work. (You’re lucky because your father-in-law didn’t require a parcel of land – or a cow.) You tell your boss you added just a bit more code the other day, and you’ll compile it now.
Wrong! Tell the asshat to wait. You need to review your code before you compile. Tell him it’s a practice that is commonly recommended by some of the greats in programming and software process. Mention Watts Humphrey who developed the Personal Software Process (PSP) – among many other software process ideas – who was a software process leader from Carnegie Mellon University.
He will have never heard of this person, of course. See, the manager only golfs on weekends and watches the sports channel, NASCAR and lots of Fox News. His wife is always at the spa or on an expensive shopping spree, so he often has lots of downtime on the weekend.
But he still hasn’t picked up a book about software in 21 years. That’s when he read the first edition of Code Complete. A lot has changed since then like there’s Agile and Scrum and other process goodness and the second edition of Code Complete. He’s never visited a software blog, either.
See, I once worked at a ginormous company that had two camps when it came to doing a code review before compiling. We would have rancorous debates about it – no shanks were ever pulled though. Then a high-level manager would walk by and we would say, “Reviewing code before compiling is the booooomb – we love it fearless leader.”
Yet you think it sucks eggs. The first camp was the managers. They all thought it was the cat’s meow. If Watts Humphrey recommended it, they said it was an edict, a must. It became codified in the software process.
You do realize when you become a manager there is one person that manages and a whole team of management cronies that are “yes men and women to the big dog.” (Management sheeple, I call them.)
Well, the other camp was all the working bees, the grunts. Or what I like to call the cubicle-bound indentured servants who have sold their souls to a greedy evil company controlled by Wall Street pigs – you know, the evil one percenters we all love to bash, until we become one percenters, too.
They thought the practice of doing a code review before compiling was plain stupid. They would argue why do what the compiler can do easily for you – find common syntax errors.
Of course, doesn’t that mean you are using the compiler as a crutch though. I was torn. Higher-ups wanted this to be a best practice that we had to take like caster oil. But the peons were revolting. I was a peon being groomed for leadership. They gave me a catalog from the BMW dealership for when I finished my master’s. I was going to get the red one as my wife is a bit of a ginger.
At the time I straddled the fence. I guess I was more of a politician – the perfect fence sitter. (A cross between a Blue Dog and a RINO. Can you tell the mid-terms are approaching, and I’m also a politics wonk?) I have since decided it is best to do a code review before. I admit I often don’t though. I love the immediacy of seeing the compiler tell me how stupid I am.
Sometimes I use different compilers to get different people – I mean compilers – to tell me how stupid I am. Clang is very clear and meaningful about my stupidity. GCC leaves me wondering if it was an insult or a compliment. A bit cryptic in the error message department, wouldn’t you say? I can almost hear Richard Stallman lambasting me for thinking I’m smart enough to use his compiler.
See, I formed this new opinion after studying math at a deeper level. When you study math, such as doing derivations and proofs, you quickly learn the value of scrutinizing over your notation and symbols – the totality of the proof. It is more like doing an inspection than a mere review. Yet, that is the only way I’ve ever been able to do math proofs and ensure they are correct.
If the compiler tells me it passed compilation and gives me an executable. I’m like great. Where are the balloons or where’s my BMW? Let’s run it “bitches.” (I watch too much reality TV.) But what the hell am I running. Most likely something that isn’t what I intended.
Without doing a review before compiling, I likely will have code that compiles that is simply not what I intended. Hence, I get a false warm and fuzzy feeling only to run it and get a stack fault. Oops, my bad. Worse yet, not get a stack fault and inject a frigging bug that is very intermittent and ends up shipping to the customers since it was never detected.
So in the same way that I used to review my exams in college before submitting them to the math professor with his amazing footlong beard, reviewing code before compiling makes sense, too.
(A note to men with awesome beards: some wives won’t let us have beards, so you’re killing us with jealousy. When you stroke your beard, do you realize you are rubbing this in, and we hate you for it? Stop it.)
Yeah, but what do I know? I only have a master’s in software engineering and was a disciple of Watts (maybe I’m biased because of that, however). I’m PSP certified from Carnegie Mellon and the Software Engineering Institute with a former employer – no, I didn’t say certifiable or am I? Doing three weeks of intensive software metrics analysis as part of the certification though may make you certifiable.