This past year has seen an enormous amount of attention paid to the toxic divide between police departments and the poor, black communities they serve. One thing we’ve learned is that tribal loyalty often prevents police officers from criticizing each other or their departments publicly—and at least sometimes, they lie when one of their own faces charges of misconduct. That’s why the recent emergence of Michael Wood Jr., a retired Baltimore cop, as a critic of law enforcement culture landed with impact: His voice was the relatively rare one that spoke with the knowledge of an insider but the unforgiving skepticism of an outsider.
In this video, you’ll meet Wood while he drives the streets of the city where he served as a police officer for 11 years, and hear him lay out his conception of what’s going wrong in the world of policing and how it could be made right.
Goodbye, Clean Code
It’s a Phase
Obsessing with “clean code” and removing duplication is a phase many of us go through. When we don’t feel confident in our code, it is tempting to attach our sense of self-worth and professional pride to something that can be measured. A set of strict lint rules, a naming schema, a file structure, a lack of duplication.
You can’t automate removing duplication, but it does get easier with practice. You can usually tell whether there’s less or more of it after every change. As a result, removing duplication feels like improving some objective metric about the code. Worse, it messes with people’s sense of identity: “I’m the kind of person who writes clean code”. It’s as powerful as any sort of self-deception.
Once we learn how to create abstractions, it is tempting to get high on that ability, and pull abstractions out of thin air whenever we see repetitive code. After a few years of coding, we see repetition everywhere — and abstracting is our new superpower. If someone tells us that abstraction is a virtue, we’ll eat it. And we’ll start judging other people for not worshipping “cleanliness”.
I see now that my “refactoring” was a disaster in two ways:
Firstly, I didn’t talk to the person who wrote it. I rewrote the code and checked it in without their input. Even if it was an improvement (which I don’t believe anymore), this is a terrible way to go about it. A healthy engineering team is constantly building trust. Rewriting your teammate’s code without a discussion is a huge blow to your ability to effectively collaborate on a codebase together.
Secondly, nothing is free. My code traded the ability to change requirements for reduced duplication, and it was not a good trade. For example, we later needed many special cases and behaviors for different handles on different shapes. My abstraction would have to become several times more convoluted to afford that, whereas with the original “messy” version such changes stayed easy as cake.
Am I saying that you should write “dirty” code? No. I suggest to think deeply about what you mean when you say “clean” or “dirty”. Do you get a feeling of revolt? Righteousness? Beauty? Elegance? How sure are you that you can name the concrete engineering outcomes corresponding to those qualities? How exactly do they affect the way the code is written and modified?
I sure didn’t think deeply about any of those things. I thought a lot about how the code looked — but not about how it evolved with a team of squishy humans.
Coding is a journey. Think how far you came from your first line of code to where you are now. I reckon it was a joy to see for the first time how extracting a function or refactoring a class can make convoluted code simple. If you find pride in your craft, it is tempting to pursue cleanliness in code. Do it for a while.
But don’t stop there. Don’t be a clean code zealot. Clean code is not a goal. It’s an attempt to make some sense out of the immense complexity of systems we’re dealing with. It’s a defense mechanism when you’re not yet sure how a change would affect the codebase but you need guidance in a sea of unknows.
Let clean code guide you. Then let it go.
Ryte: Website Analysis
Improve your performance online with the Ryte suite
Monitor, analyze and optimize the key elements of your website efficiently with one tool.
How smooth jazz took over the ‘90s
Smooth jazz seemed like it would dominate forever.But then, everything changed.In the early 2000’s Arbitron, the firm that measures audiences, introduced a new technology,The Purple People Eater —I’m sorry I meant to say the “Portable People Meter.”It’s this little beeper — people believe it killed smooth jazz.PPM, which is still in use today – is an electronic beeper that captures audio tones masked inthe signal of radio broadcasts. Basically, it picks up audience listenership automatically.It replaced a decades-long practice of using paper diary entries to measure audiences.“People would write down for a week what they listened to and they would turn it in. Very easy for people to do.”“It went from that to,what we want to ask you to do is wear this on your belt all dayand we want you to do this for a year.”But it often didn’t work with smooth jazz.The format’s soft, ambient sound didn’t allow for the signal to be consistently maskedin the music without being discernable to listeners – if the signal wasn’t embedded,the beeper just couldn’t register it.Polling site Fivethirtyeight tracked the number of six large-market smooth jazz stationsbefore and after PPM – in each instance they either changed formats or shutdown entirely.But it might not have been all PPM’s fault“I think it’s a reflection of what our economy did.Our station went off the air when everything crashed.”Smooth jazz radio was music for ordinary, everyday people trying to get through theirday stress-free.It certainly never cared about critics during its solid 20 year run, and unlikestraight-ahead jazz, it didn’t care so much about challenging the listener either.And it’s why from the 1960s to the ’90sanything written about the music looked like this:But dig deep into smooth jazz’s history and you’ll find some really exciting music.“There was an album Herbie Hancock did call the “New Standard.”“Oh man that was good.I’d come off there talking about that.”“I was like, Oh this is what this is why I’m doing what I’m doing.”Or go even further back to Grover Washington Jr.’s “Winelight.”“And just listen to it as you’re cooking dinner or something.”“It’s just chill, man. And it’ll give you a feeling for why people fell in love with this music.For such a long time.”