Don't plan to throw one away, you'll do it anyway


I am pretty convinced that is common wisdom to plan to throw one away, since you'll do it anyway (Fred. Brooks). But, in real life, it is better not to plan it, but to struggle hard with your first idea, and push it to the limits.

All begun with a strange idea

I may have been quite trollish when proposing this to the python ideas mailing list. But, I soon begun to build VectorDict

My plan was even bigger than that : trying to make computer specialists acknowledge of the need of algebraic rules for the common operators.

I can even acknowledge that my plan was (maybe is still) leading without me realising it to reimplement in a subset of python an inefficient and slow LISP (see Greenspun's tenth rule). Well follow the idea :
  • algebrae and dict as (fractal) vector leads to matrices,
  • matrices applies on vector and transform vector in vector,
  • therefore I am mostly planning to transform trees in trees, thus I am trying to reinvent a poor inefficient LISP as a subset of python
I packaged it, and pushed it on pypi, expecting to see early adopters giving feedbacks, I wrote a documentation with sphinx expecting people to find a use for this package and give me advices.

But none of this happened.

I wrote an actual practical use case, thinking people would  look the code and understand the API.

But none of this happened. 

Road to failure

Believing in your ideas and coding, advocating, thinking you are right.

That seems mean, but it is true, it is the road to failure. The road to failure is not about believing and working, it is all about not being able or wishing to communicate. I was thinking at that time that since I don't know how to code, I would present a consistent API with unit testing, and that people would understand the idea, steal it, and would make a correct implementation. And, then,  I would have something working because I saw a lot of use for this.

But I can't code it properly since I know nothing. I can't communicate since I don't know the right words. The truth is most time I have heard «singleton, design patterns, abstract class, OOP, frameworks...» coming from the mouth of a fellow coder, it was to just a way to be obscure to appear profound. So I have a profound dislike for these words and those who pronounce them. All the same goes for ring, and all mathematical terms. I only have my math books from university and 13 rules I know linear algebrae should enforce (like a+b=b+a, a+neutral = a , a-a = 0 ....). So I thought following the book would be enough (since I have an IQ far below average), and since people are smarter than I they would understand. I myself have a background and believe in :
  • not using recursion, since stack can explode
  • not using multiple inheritance since it is «evil»©®
So I did not planned to throw my vectordict, I became an obnoxious salesman of my solution, saying it would be great for map reduce, and made a word counter in map reduce with multiprocessing. And it worked. But no one cared, even though there were blogs everywhere talking about map reduce for big data.

But no one listened. I was talking the wrong dialect at the wrong place.

Becoming yourself

Well, I am old, and I was grown up with the idea that you cannot be smarter and more creative than in your twenties, and I have always been a slacker. At that time, I was attending IRC since 3 months as the obnoxious salesman I became.

To have more friendly reaction, my nick was even one of a girl. And, I lost months, days, hours attending IRC. #python, #python-fr, #freebsd-fr, I was just lost, and an annoying pain in the ass.

But, one day, someone asked me what would be the use of my package and as I reinstalled my (crashed) server, I decided to give it a go on apache log combined parsing.

And one awesome person (bmispelon) did not let me code my own way. He challenged me to do better, faster, more logical code, and to benchmark my code.

What benchmarking learnt me was :
  • that my first code (of a not really good developer) was not that bad, because I could understand and modify it ;
  • that my idea was freakingly efficient;
  • that I should throw it away because its structure was unclean

When to throw your code

The moment to throw your code is not when you know it is dirty, but when you : on one hand begin to understand why it is cool, on the other hand you become limited in your progression by all the things you made wrongly.

Thanks to this experience, I now have became a better coder (I must admit that answering and listening on IRC about others common mistakes helped me a lot).

Failure is cool : it is the road for learning

One does not learn from his success but from  his mistakes

Without me noticing by working hard, failing, I learnt from my mistakes. I could only learn from my mistakes because I involved myself much. Had I thrown away VectorDict too soon, I would have not been able to resurrect it in the new package to come : archery. And I learnt, I needed to be part of a community to interact with it. 

To be honest that is the only reason to be of this blog. 

PS : Merci Baptiste :) 

No comments: