Saturday, May 19, 2012

Rewriting Things

In the life of every nontrivial project, there is a point where you look back and ask yourself: "How did we get here? What a tangled web we have weaved! Can we ever recover? If we push ahead, are we digging ourselves into a deeper hole, or is there a light at the other end?"

I'd like to offer some personal advice.

If you look at your code base and say "There is so much that's right, even if it's really messy and has some serious bugs." then you should keep going, especially if other people are involved in the project. If you look at your code and say "Actually, no one is really using this yet, and if I switch things around before people have to deal with it, they'll thank me later." then you should head back. Start over. Get it right from the beginning while you have a chance, or it's really going to hurt later.

You'll know when it's ok to start over, because you won't be too worried about it. You won't deliberate very long, the choice will be pretty obvious.

But if there is some turmoil in your heart, you need to step back and get some perspective. If it's taking you weeks or months to figure out what to do, don't give up. The answer is that you need to work through it. You need to spend that time reflecting on exactly what is wrong, and what you can do about it. If you get abandon all your work at that point, you're going to regret it later. Especially if you divide the community that is contributing to it, they'll end up duplicating their effort just to learn the same lessons.

Take OpenCV as an example. The C interface was a solid backbone for thousands of developers, but the community got to a point where it needed to work past the limitations of that language. C++ looked incredibly appealing, but it would required some significant changes to how OpenCV works in order to support those features. What did they do? They didn't rewrite OpenCV from scratch, but they started building a new foundation by reflecting on what worked and what didn't work in the original interface. They took the whole community along with them and now OpenCV 2 is strong and better than ever. One of the most important things is that a lot of the same people are involved. If there was a fork, or someone decided to start from scratch, then nothing learned during the development of OpenCV 1 would be completely applied to OpenCV 2. Some of the same paradigms might be there, but a complete, continuous understanding would be missing.

On the other hand, look at pd and Max. They could have combined efforts, and learned from each other in a more direct way. But now we have two slightly different environments that are each missing features of the other.

This might all sound unnecessarily verbose for such a simple message. But that's because this is actually a metaphor for something completely unrelated to software development.

Not the Best

I want to be the best, in everything that I do. I try to always push myself, which is great, but this competitive spirit isn't always a good thing. I've been learning recently that an unbalanced competitive spirit can have a bunch of terrible side effects. It can cause:

  • Jealousy for the success of others.
  • A tendency to seek disadvantages for others.
  • Condescending behavior in order to discourage others.
  • Unnecessary frustration when you're not at your best.

All of these things can also lead to passive aggressive behavior. Passive aggression is a way of internalizing these effects, sinking deeper into them, while putting up a front of being above them. Passive aggressive behavior puts you on a pedestal, by acknowledging that you could sink to jealousy, or frustration, or anything else — but you're "better than that". If you can actually rise above these things, there is no need to explicitly acknowledge your progress.

A great example of passive aggressive behavior is providing positive sentiments after a negative statement. Telling someone you would appreciate it if they changed their behavior, and following it up with "thanks!" is one way of pushing the point that you're "better than that," and you're not "really frustrated," when in fact you're trying to mask your frustration. Better responses include: not saying anything and letting it go, or stating clearly, without any masking, how you feel. If it feels like you're exposed and your frustration is out in the open, you're probably doing it right.

An unbalanced desire to "be the best" can also cause an unwillingness towards empathic behavior. In order to have empathy for others, you need to join them where they are, and relate to their state of mind. This requires a loss of ego, and a loss of pride. Instead, the oposite behavior is chosen: the competitive person becomes sarcastic, or offers outlandish advice, or attempts to make the problem seem insignificant or trivial. I don't think I'm very sarcastic, but I regularly offer outlandish advice when people come to me with problems. Sometimes it's an effective for dealing with your own problems, but it doesn't always mean the same thing in the form of advice.

Sarcasm is maybe the most dangerous of these responses. When someone hears sarcasm, the first reaction is disbelief; that the statement sounds ridiculous. Then, they're forced into a reversal of their understanding, where they accept the true intention of the speaker. Sarcasm forces the person hearing it into the mindset of the person speaking it. This is key: sarcasm is a shield against empathy. With sarcasm, you reject the validity of another person's situation and instead force them to empathize with you.

I'm still learning these lessons, but right now they're informed by a healthy dose of criticism from a variety of open source software developers, and exactly one failed romance.