Today I saw this tweet:
Proposing a game to cheer up our programming newbies: Experienced coders, let's share code snippets we wrote after half a year of coding.
— Lena Herrmann (@kilaulena) November 26, 2013
And it took me back ...
2000, I was attending YAPC. I had been doing Perl stuff for several years at that point, and had written, among other things, a web calendar app called Hypercal. Calendar math was something I was very interested in at the time - particularly non-Gregorian calendars.
While at YAPC, I had several conversations with people about calendrical calculations, and on improving the core Perl date/time libraries. It was, in fact, immediately after one of these conversations that I attended a talk titled something like "how not to program", which featured spectacularly bad code examples from published works. I *think* that the speaker was MJD, but this was a long time ago.
As I watched the speaker expound on the horrors of the code he had found, I gradually realized that this was MY code that he was lambasting. As it happens, an early version of Hypercal had been used as an example in a Japanese book on CGI programming. I still have a copy of it somewhere, I'm sure, but I expect it's out of print now. But, there it was, on the big screen, for everyone to see.
It was truly awful code, and it could have been a truly humiliating experience, had I not, by that time, progressed a ways past my early errors. What's amazing was that, at the time, there were few enough people producing Open Source web apps that my dreadful code ended up being an example worth putting in print.
I often think of that incident when helping beginners. It's good to remember that 1) everyone you meet knows how to do something you don't, and 2) no matter where you are now, at one point you were a clueless beginner.