
Code Shame: Sharing your embarrassing code - bbody
https://www.brendonbody.com/2020/01/31/code-shy/
======
thinkingkong
If you're constantly getting better at what you do then you'll always look
back at your old work with a unique perspective. To some, that might take the
form of embarrassment, humiliation, etc. But put in a more positive light, you
can look at your work and know how far you've come.

I think we should all behave more like the later; appreciate your growth
mindset, and remember 5 years from know whatever you're doing now might be
unrecognizable.

~~~
bbody
Exactly, agree with you 100%. However I think when we start our careers there
is a resistance to put ourselves out there.

------
tobr
There’s an unfortunate productization that happens when you put some code
publicly on GitHub. There seems to be a culture that you should make the repo
look attractive even if it’s just some off the cuff experiment no-one ever
tried to run in production.

I’m certainly not against doing your work in public if that works for you, but
I wish GitHub were better at encouraging people to label their half finished
experiments as half finished experiments.

~~~
_bxg1
There's this: [http://unmaintained.tech/](http://unmaintained.tech/)

~~~
notduncansmith
There’s also the Archive Repository feature, which can help:
[https://help.github.com/en/github/creating-cloning-and-
archi...](https://help.github.com/en/github/creating-cloning-and-archiving-
repositories/archiving-repositories)

------
bovermyer
I really, really wish that I had the source code I wrote back before Github
was a thing. Most of that, though, was never in version control, and I have
long since lost the floppies it was stored on.

This post is inspiring me to go clean up my old repos on Github, and perhaps
wax nostalgic about my previous works, even the awful ones.

~~~
icedchai
I have stuff I wrote in the mid 90's. Mostly C code. It's horrible to look at.

I wish I kept the earlier stuff from my Amiga days.

~~~
sofaofthedamned
Same! Best programming I ever did was on the ST and Amiga.

~~~
tclancy
Any reason why? I tried to do a bit on our C64 as a kid but . . . well, it's
amazing I wound up as a developer after that experience.

~~~
icedchai
You had to be very careful programming the Amiga. There was multitasking, but
no memory protection. If you wrote to a bad address (like a null pointer), you
were staring at a "Guru Meditation" screen followed by a reboot.

------
zadkey
At my very first coding job, I was hired to update the design of a .net
webforms website. My academic background was in java. There was no on the job
training. It was just me, 2 C# books, and stackoverflow.

I remember writing monolith methods/functions with 1000+ lines of code.

I remember manually generating SQL as a string for ado.net. I also remember
being unaware of stringbuilder and doing tons on += on strings and wondering
why the application was slow.

Looking back now at my first time, it seems funny more than embarrassing. I
remember it fondly.

------
HoppedUpMenace
Here's a pretty embarrassing one ;):

int index = 0; while (!element.equals(sortedList.get(index)) &&
sortedList.size() > ++index); return index < sortedList.size() ? index : -1;

~~~
robodale
Asking for the sortedList size with every iteration of that loop. haha, ouch!
:)

------
waterhouse
The CRAPL is somewhat related:
[http://matt.might.net/articles/crapl/](http://matt.might.net/articles/crapl/)
,
[https://news.ycombinator.com/item?id=9670497](https://news.ycombinator.com/item?id=9670497)

------
l0b0
I thought this was just going to be another humblebrag like all that
cringeworthy impostor syndrome stuff last year, but this has some good advice.
If it did something useful, then certainly someone else can learn from it and
you can be proud of it, no matter how far it is from what you do nowadays.

~~~
bbody
Thank you for the feedback, I am glad you interpreted what I wrote that way. I
was trying to essentially take my conversation with my friend, take the advice
I gave to him and add some self-reflection.

------
mdonahoe
I enjoyed the "impressive feet" typo in the first sentence.

(First time I've ever seen that word pairing!)

~~~
bbody
Thanks for pointing out the typo, it has been fixed. I guess it is a phrase I
heard more than I read/wrote.

~~~
mdonahoe
No worries!

I also enjoy the opposite: when people pronounce words incorrectly because
they've never heard them aloud, only in writing.

I've embarrassed myself several times in this regard.

~~~
bbody
I always thought "force of habit" was "forcive habit".

------
rafaelvasco
I just put everything on Github, good or bad. I always try to keep code smell
at a minimum, but I can't even recognize my earlier code anymore, like ten
years ago. Doesn't look like I coded it at all.

~~~
nomel
What would you say the biggest difference is?

For me, the amount of magic in my code has been significantly reduced.

~~~
rafaelvasco
Mostly two big changes that I got with experience: Code architecture and
organization in general. You make more modular code, minimize code coupling
etc. And another big change is in optimization. You learn to better optimize
your code, avoid too much allocations, performance tricks, etc. That depends
on the language to an extent, but several things are global to all programming
languages; I mostly code in C# and Javascript these days. Game development and
game tools;

------
lbj
Certainly I would want upcoming developers to share as much as possible, to
get as much help and as many pointers as possible. But personally, I want to
see your best. In the authors case, he's seemingly improved a lot since
writing the early code, so I see no harm in taking it down/replacing it.

But in general, share what you can. Don be embarrassed, even a stern code
review will help you improve, but I very rarely see 'stern reviews' outside of
Linux Kernel development :)

~~~
bbody
Author here, with regard to "taking it down/replacing it", I found a middle
ground. I moved all those repositories to another organization (that I
control), so my profile is clean and if I need/want to see that code I can go
there.

------
olliej
There were some old assignments I wrote at university that I really wish I
could find (my favorite “real” one being a catastrophically insecure
implementation of RSA)

------
santa_boy
I kinda fear this as I am working on my startup. I am sure that the code needs
a lot of refinement but I am often pleased that it does the job that I set out
to achieve.

I am not quite sure how this is going to work out as I am self-taught coder
.... [https://blog.mypad.in/](https://blog.mypad.in/)

