Thank you for the question! I have chosen to answer this with a large part of my life story :P
TL;DR: Quite a long time. See the last paragraph for actual numbers.
During university, I learned that "number of lines" was not a good metric for code, so my next metric for quality became performance. I was just about to read the original Gang of Four book when a professor told me to get Martin Fowler's book Refactoring instead. When I read about refactoring and started viewing code itself as something that could be manipulated, my mind was blown. As I shifted my focus towards provably bug-free code using functional programming and type theory, I always kept looking at code as something "moldable" through refactoring.
By the end of my uni years, I also started hosting two-hour tech talks every Friday, each time on a new topic. Which meant I quickly ran out of things I knew in advance and had to speed-learn a lot of new concepts. Shortly after I graduated I was talking to my best friend, and he asked if I could improvise a talk like those. I opened my computer and started typing and implemented the game that is in the book. I then said, let's try to make it better. I didn't want to explain the concepts of "code smells" so I instead I came up with rules that had the same effect. The five lines rule was the first.
All in all, that means I did seven years of "kids-programming", then five years of web, then five years of uni before I came up with the first rule. But really, the rules were already there in the form of "code smells", I only came up with an idea to make them easier to learn, and make them applicable from day one. Refactoring changed my life, so I wanted to make it as widely available -- and as easily digestible -- as possible.
I hope that answered your question.
posted 1 month ago
That was an interesting back story.
I asked because everybody sort of goes through the same steps of- Learn to code, get it to compile, just get it working ,make it better...
Thank you Christian.
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled