Writing software is hard, but organizing and dealing with people is far harder. In every organization, there are people who make the machine run better, and those that foul it up. The secret to being a good manager is being able to figure out who’s who in a lineup that includes many, many social defects. And it’s not always as easy to see as you might expect.

In my time, I have had some doozies of people to manage. From my time working at a computer recycling center mostly staffed with ex-cons and recovered meth addicts, all the way to my current non-profit museum work, I’ve had to manage people from a rather large spectrum of humanity.

And after years of experience with both camps, I have to say, managing burned out blue-collar workers is sometimes easier than managing knowledge workers with ego problems.

As an example, I’ll tell you about Greg (not his real name). Greg was a brilliant mathematician, incredible guitarist, and a huge human being. At 6 feet 4 inches, Greg was intimidating, and resembled the sort of Russian thug you’d see in a movie that takes place in a Gulag.

But Greg had burned away a great deal of his brain with crack and methamphetamine. He worked at the computer recycling center, where he was tasked with moving large objects, pulling giant monitors and TVs out of people’s trunks, and generally being a big walking sponge of Lithium and other anti-psychotic drugs.

Greg was actually fairly easy to manage, even if he was super-high maintenance. It wasn’t the bad sort of maintenance, where you’re always coming back to scold a worker for ignoring procedures or slacking off. Rather, Greg was high maintenance because he was on so many meds that he was basically a tool you activated via voice commands, rather than a real, autonomous worker.

It was not uncommon to be laying televisions onto a pallet only to find Greg standing on said pallet, television in arms, smiling at you. “Greg, can you move so I can put this where you’re standing?”

“OK,” he would say with a smile, and move off the palette. You’d then have to say “Greg, put your TV on the palette,” and he would do it. It’d go on like this until he got the flow of what we were doing, then he’d be relatively hands-off.

Greg was much easier to manage than a knowledge worker I had to deal with at the museum a few years ago. Greg was, in fact, a cakewalk compared to this fellow. Let’s call him Cal (again, not his real name). Cal was a smart fellow who knew all about video equipment, old computer hardware, video-game history, and publicly presenting said materials.

At the video-game museum I run, Cal seemed like a godsend: a 10x’er in programming terms. But Cal was decidedly not a godsend. No, he was a Trojan horse, sent to poison the minds of other workers in the organization.

Cal was never happy. He was never able to truly follow directions, always wanting to spend money to solve problems in a cash-strapped organization where spending money was always plan J, K or L, never plan A or B.

But worse yet, Cal was constantly complaining to other volunteers, pouring poison in their ears and trying to stage a mass quitting because things weren’t run the way he thought they should be. At one point, he became snippy with a business partner that was granting us a large asset.

The final straw was when Cal sent me an angry text message stating that I was taking the credit for all of his hard work, and that I was doing it wrong. Everything.

And at the time, it felt like Cal was right. There was a huge rift in the organization, and it felt like new volunteers would show up for a few days and then run off. Even one of our longer-term, motivated and passionate volunteers stopped coming in.

After I “fired” Cal for the text message, however, every one of Cal’s complaints and my concerns about the volunteers subsided. The rift closed, and we had no more conflicts in the ranks. New volunteers started showing up more often and staying.

At the time, it felt like I was firing the most important guy on our team. But after a while, I learned that this guy was actually the worst part of the team. His toxic attitude was far more dangerous to our group than anything else we were going through, and his knowledge and skill in no way outweighed the harm he was doing to the organization.

It may seem counterintuitive, but in a market where 10x developers are worshiped like gods, just remember that no worker is worth turning your office into a toxic environment. Sometimes the guys you have to gently ride like a surfboard to get them to work are actually better overall than some ego-driven hotshot who thinks he always knows better than everyone else.