I spent most of my high school years living on Guam trying to stay alive long enough to leave and start a new life. It wasn’t a good time for me, and about the only good thing that came out of it was I started studying martial arts. These days I’m a lazy bastard, but back in the day I studied everything I could get my hands on. It was rough, but I came out of it fine and I’ve since used my knowledge of martial arts in just about everything I’ve done. Each one I studied taught me something different. Capoeira taught me that being balanced is more about being able to adapt and flex than root your stance. Aikido taught me that attacking a problem directly is rarely the solution. Muay Thai taught me that destroying the base will destroy the building. I studied Muay Thai, Ninjitsu, Wing Tsung, Judo, various weapons, and even spent a year getting the crap beat out of me by some rough sword fighters in the SCA. Unfortunately I never studied anything long enough to be considered very good at it. I just took what I found and moved on to the next interesting thing. What does this have to do with programming?
When I started studying Aikido I read “The Book of Five Rings” by Miyamoto Musashi about 20 times. I had a badly stained copy from walking to and from class every night in the rain. It was folded and written on as I tried to figure out what the hell he meant. I never really figured it out. I guess you had to be a Japanese Samurai from the 1700’s to figure it out. I did figure out though that Musashi was able to defeat his enemies by using unusual and revolutionary tactics. From what I understand of the history of Japanese martial arts, nobody used both swords at the same time until Musashi started doing it. They had two, they just never used them both simultaneously. Musashi was the first known man to break out both swords and defeat a very large number of people with them. He did things differently and it worked.
In Musashi’s case it wasn’t something he came up with and then developed later, but rather an accident that came out of necessity. He was apparently being attacked by a large near army of men, and in order to keep alive he took out his wakizashi to defend himself (that’s the small sword). He later developed it into a complete system, but originally it was self preservation. He also did this after spending his whole adult life studying combat, the sword, and strategy in general. Even though it came from necessity, he had the tools and training necessary to make this radical leap possible. Without this training, he probably would have been killed trying to wield two swords at once.
Later in life Musashi retired and pretty much just disappeared from the world. He taught a couple of people, but mostly his art would have died with him if he hadn’t written one very little book, “The Book of Five Rings”. In this book Musashi lays out what he knows about strategy in probably one of the most concise and best written treatise on the subject. Every other person who wrote about strategy wrote huge tomes. If you think “The Art of War” is small, keep in mind that the Chinese had a huge number of “official” texts on strategy, of which “The Art of War” was only a minor part focusing on how war fits with Chinese politics of the era. “The Book of Five Rings” was different though, it wasn’t specific to any era, it was small, it was austere, and it was like nothing before it. It was the final culmination of one man’s mastery.
After reading books on martial arts history for years, and studying everything I can, I started to see a commonly understood pattern. Almost all people considered masters of their art finally come to such a deep knowledge that they can do more with less. Rather than a flurry of complicated leaping and jumping, the master will simply step to the side and make one calculated strike. Every story about old masters is the same in that, even though they were frail and near death, their knowledge and abilities were so deep and clear that their simplest motions had the greatest power. For a master, the pompous and flowery motions were just wastes of energy.
Apparently though, these are all just stories I’d heard. Nothing more than myths and legends that I was passed from my teachers and friends. But it’s these stories that make up what we perceived as a “masterful” person.
A similar story comes from a completely different side of the world and a different era. I read a story about Mestre Bimbathe originator of modern Capoeira from Brazilwhere he fought a challenger in his 20’s. Mestre Bimba was in his 80s had limited mobility, but he still took the young buck on. The young guy started the fight by flying into the air doing this impressive flipping motion, ready to kick some ass. Mestre Bimba just rolled out in a slow cartwheel, and stuck his foot out. The hot-head, still flipping, comes out of the maneuver and right into Mestre Bimba’s steady foot, smashing himself unconscious. When he woke up he said, “What..what was that?”
“That was my foot my son,” is all Mestre Bimba said.
This kind of story is so common in the lore of the martial arts that it’s impossible to study a martial art and not hear at least one. Every teacher I’ve learned from had similar stories about their senseis, sifus, and mestres. Each one is about how some frail old man (or woman) could do amazing things with just the simplest of motions. These lessons all taught me the same thing, “A master wastes no energy. Every motion is precious.” A master makes everything look effortless. Nothing is frustrating or difficult for them because they do nothing that isn’t necessary. The master’s actions are pure and elegant.
In all my martial arts studies I’d always consider myself a novice. I never studied long enough to be an “expert”, but when I was younger I thought that I was. I studied so much that I couldn’t help being some kind of expert. I found that I could get very good at something rather quickly, but mastering something took far longer. I don’t think I’ve ever mastered anything I’ve studied. I’m just an expert, probably even less now that I don’t study regularly.
I have met quite a few false masters though. These are people who may be very good, and much better than myself. I usually took classes from them, but not because I thought they were “grand masters”, or “masters” or anything. These guys (they were always guys, women are hard to find) were flashy. They could do neat things, could teach really complex techniques, and could tell you every single thing about their martial art possible. Charging you for lesson after lesson was how they made their money after all. Teaching you movie stunt man moves was how they attracted and kept students.
Yet, none of these gentlemen were what I’d consider masters. They were great teachers, and I don’t want to insult them in any way, but none of them were masters of their art. None of them could clearly and simply explain their martial art’s concepts. When I’d ask a complicated question, they would give me a complicated answer. Sometimes their answers were just wrong. Like one guy who tried to show everyone how to break out of an arm lock by punching. He asked me to do the arm lock since I studied Judo, so I did it right and made sure that I rotated with him as he tried to punch. He kept trying to punch me, and I just kept rotating. I really wasn’t paying attention until he suddenly burst out, “Dammit stand still so I can demonstrate.” I said “sorry” but thought, “Yeah, like I’m gonna stand still.” He could have kicked my ass two ways from Sunday, but a simple arm lock frustrated him?
The main thing I noticed about the experts I’ve encountered is they are into impressing you with their abilities. They are usually incredibly good, but their need for recognition gets in the way of mastery. Everything they do is an attempt to prove themselves and in order to do this they must perform like an actor on stage. There’s nothing wrong with this, and I don’t think the expert can become a master without going through this stage in life. At some point though, the expert becomes comfortable with themselves or fed up with impressing everyone and starts to look inward to the core of their art.
I’m going to come out looking like an obnoxious pompous asshole here, but I’m not trying to be one. I’m simply trying to explain something I’ve noticed about the difference between code written by myself and that which “frustrated experts” write. I’m in no way saying that I’m some kind of grand master coder. I consider myself an advanced expert at best.
What I notice is that my peers are progressing to more and more complicated and convoluted designs. They are impressed with the flashiest APIs, the biggest buzzwords, and the most intricate of useless features. They are more than happy to write endless unit tests to test their endless refactoring all the while claiming that they follow XP’s “the simplest thing that works” mantra. I’ve actually seen a guy take a single class that did nothing more than encapsulate the addition of two strings, and somehow “refactor” it to be four classes and two interfaces. How is this improving things? How can more somehow equal simpler? This should never be the case.
These are the actions of an expert. These experts are very smart, capable, and skilled, but they are too busy impressing everyone to realize that their actions are only making things worse for themselves. In the end all of their impressive designs are doing nothing but making more work for themselves and everyone around them. It’s as if their work is only designed for getting them their next job, rather than keeping them in their current one.
I used to be this way. I used to love complicated designs and read everything I could about complicated technologies. But as I get more experienced and “older” as a programmer I find complex things just annoying. They aren’t a mental challenge to understand anymore, they are just irritating. I’ll pick apart the flashy crap, boil down the technology to its essence and then come up with a much simpler design for the task at hand almost every time.
What worries me though is how the experts react to my simplified designs. Typically they’ll say that what I’ve written is not “following best practices” or “isn’t well designed.” They’ll propose these endlessly complex designs with endlessly imagined failure scenarios, and not realize that what they are doing will be a nightmare to maintain. The experts will then saunter off to implement their Flaming Tower of Babel without any comments, horribly complex mock enabled tests, making sure EVERY SINGLE CLASS HAS AN INTERFACE, and ending every class with “Impl” because, well, that’s the best practice. After implementing it they’ll continue to complicate the design even further with endless seemingly aimless refactorings for no other reason than to refactor. And when they’re done, I’ll go in and read through their code and cry.
This is the actions of an expert. They love complexity because the art is still new to them, something which should be explored. A list is not just a container, it’s a linked list, or red-black tree, or doubly linked list. To me, it’s just a container. I realize now that they’re missing my need for simple beautiful things. They don’t love quiet elegance, and would rather shout their superiority from the top of the mountain. Meanwhile, I’m just a lazy old man who wants to get his job done and write something without any wasted energy. I want to climb the mountain with the least amount of effort and their shouting is causing an avalanche of bad code.
The Coming Professional Master
Programming is a very new discipline, so there’s not too many master programmers out there. What’s worse is that the few people I would consider masters aren’t very exemplary of the software profession and art. They are typically professors who never write anything under a deadline and are given complete artistic freedom to develop whatever they want. Take Donald Knuth, who was able to take three years off from teaching in order to complete TeX. There’s no way I could get away with telling my employer that it’ll take me three years to finish their product. Knuth is basically a “master amateur”. A guy who worked in a complete utopia and was able to hone his skills without interference. I would compare him with a man who became a master by studying at a monastery for for his entire life.
In contrast there are masters in the martial arts who learned their art as a means of survival and became masters in a realistic and hostile environment. We don’t have anyone like this in the programming profession, or at least I haven’t met any. I believe that my generation of developers will produce the kind of masters forged in the real professional world. (Yes, sorry professors, if you can’t get fired for missing a deadline then you aren’t a real programmer working in the real world.) Hopefully software development will continue as a profession and we’ll see a crop of master programmers emerge from industry to challenge the existing amateur masters. But, if the current experts continue to push for ever more complicated, convoluted, involved, and “impressive” designs and ideas then we’re in for a world of hurt.
So my final plea for all my fellow experts out there: Can we please start pushing the art and science of software development toward the austere? I’d love someday to hear a young coder tell a story about someone they idolized like, “There was this guy I worked with who once optimized a complicated red- black tree getting 300% performance boost. I was baffled and ask, ‘How’d you do that? That’s impossible.’ To which he responded…”
“‘That’s my linked list my son.'”