4 ms·
Many people in this thread are saying they are surprised by their own shitty code, 6 month ago. I read this everywhere on the Web. It's like I should myself be
by jraph 5y ago
Many people in this thread are saying they are surprised by their own shitty code, 6 month ago. I read this everywhere on the Web. It's like I should myself be finding my code from 6 months ago horrible.
I don't know. I tend to remember what code I wrote, and recognize my own code when seeing it, even years later.
My code from 6 months ago looks good to me. My code from 10 years ago looks "reasonable, if a bit messy". I remember what I was trying to achieve with what level of knowledge I had, and often what I had in mind at this moment (sometimes including unrelated feelings).
I'd probably write this code differently today and it's clear I learned things in the meantime, but a little bit of linting helps turn this code into "reasonable, if a bit less messy" (mainly limiting line length). I definitely find my way in this code and even find it kind of enjoyable. Sure, there are some details I don't remember but things are mostly here.
Do I have an exceptional memory, an exceptional tolerance to execrable code or both?
Re: the article, I've definitely felt "who wrote this shit" but I'm past it. Most surprising things have an explanation and this explanation should be sought before the final verdict… which is often not needed anyway. It's just a negative feeling that achieves nothing.
- michaelt 5y agoI suspect everyone was writing badly informed code at one point - just for some of us it was a long time ago, and we were young. For example, I wrote a javascript image editor that stored images as hex strings internally, and saved them to file by screenshotting them. Completely mad design. But that was ~23 years ago, long forgotten by everyone except me, and I was age 14 at the time. This is a young and growing industry; someone who coded like a 14-year-old ten years ago might simply be a 24 year old today.
- CrimsonRain 5y agoYou're not alone. I feel the same except when I wrote something that I didn't care about much. Those, I forget.
- TameAntelope 5y agoIf I felt my code from a year ago was still good, I'd be worried I've stopped learning and growing.
- jraph 5y agoI still don't get this. Not knowing everything I've learned for the past year did not prevent me to write clear code back then. I hope I'm writing better code now because I actively reflect on how to write correctly, but that does not prevent my old code to be reasonable. If I found my code from a year ago bad despite all these years of programming, I'd be worried I'm not in fact any good. The whole point of taking care to write good code is that it will still be readable and maintainable (i.e., good) in a year and more, and I'm sure I can achieve this, and could back then. I'm also able to recognize good code from other people from years ago, if I systematically thought my code from one year ago was bad, that would mean I'm consistently bad too. It just does not compute.
- TameAntelope 5y agoI was "not any good" relative to how much better I am now. I'm happy and fortunate that trajectory is continuing. Thirteen years and counting, in fact. Who knows, maybe you're a better coder than I am and you just "got" it instantly! It's immensely important for me to keep growing, so I guess it's a good thing I may be so much worse than you?
- jraph 5y agoI'm not sure I'm above average and would not assume to be better than you, but you could be more self-critical than me. Few more years than you (it depends when to start counting), definitively in the same range.
- blub 5y agoThis only makes sense if one is junior or is learning a new programming language. If one can’t write good code after several years of experience, then they’re in the wrong profession.
- tclancy 5y agoIt's a bit of confirmation bias though: code you wrote well is less likely to come back and bite you in the ass. 20 years on, I still feel the 6 months ago thing.
- Izkata 5y agoI have both experiences. Very broadly speaking, it's code I write for work where I have the "this is terrible" experience (twice something has annoyed me so much I trash-talked it in the team chat, then ran "svn blame" and found I'd written it ~4 years prior), while code for personal projects in general I don't. I suspect it's having to work around teammates' styles and integrate it my own into it that causes friction at the edges, but I'm not really sure.