You are not your code.
I'm a lousy programmer. However, I am less lousy than I was last year, and significantly less lousy than I was 20 years ago. Even still, there's a lot of crap on my GitHub and Bitbucket repos - but I'm totally OK with it.
I am not my code.
Yes, it's a reflection of me, but just as I am not my 8th grade English paper or my college entrance scores, I am not the code I wrote last year. Feel free to tear it apart. I will be better this year.
Your code does affect your reputation, truly. It is possible that you are a bad programmer. You'll never know until someone better sees it. Sharing your code may find you a mentor, or get a teacher's critical eye and help fixing it. Pull requests can't happen until you've shared your code.
steal clone David Copeland's summary of this week's "social coding scandal."
So, someone shared some code on Github and some classic developer snark rolled in. And then there were some apologies about it.
The irony is, of course, that the code in question was actually rather useful, didn't require idiomatic command line knowledge, and, most importantly solved someone's problem.
Don't let any of internet drama stop you from writing on your blog or from contributing to open source. In fact, I would encourage you to release some source code right now. Go find some, I'll wait.
Have a code garage sale. One person's junk is another person's treasure.
"I can't believe I found code that does exactly what I needed."
"Wow, I learned a lot from that algorithm."
Feel free to share some of your lousy code in the comments, and we all promise not to judge you. Feel free also to share some awesome code if that makes you happy, as long as you share.
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
We are not our code, but like life we can only improve when others show us how we can through humility and kindness.
I saw David Copeland's post yesterday and after reading it, I started thinking on getting all my old code and posting it to GitHub just for the fun of... sharing!
There are a lot of us out here who are slogging along every day, writing code that no one necessarily sees. Our code probably isn't terrible, but is it the most beautiful, elegant, best-practices-using stuff? No.
But we attend the conferences and the code camps and lurk in the online debates about the "right" way to do things. And then we look over our current code and think "Oh dear. This isn't very good." And then we encounter code we wrote 2 years ago and we hang our heads in shame.
Contribute to open source? Sounds good in theory. Sounds terrifying in practice.
But I love your statement: "One person's junk is another person's treasure."
This is the most positive thing I've read on the internet all month. Thanks.
I look back at code I wrote and alternately think that parts are great ("Wow. Did *I* write that?") and awful ("OMG. Did **I** write THAT??!")
Yes mutton chops were allowed because I was in high school, but I still don't really like looking at the yearbook.
You could write another one for the public entitled "You are not your phone OS."
Bad code can still solve problems. If you keep a good attitude and don't ever get complacent, you'll be fine.
Avonelle - It's so important to learn to have thick skin. But, for those with some "influence" it's important to learn to truly give constructive feedback.
"It's so important to learn to have thick skin."
This is certainly true. But I think the risk/rewards ratio has to be worth it. Right now, the potential risk (ie getting publicly ridiculed for your code) is high and the potential rewards may not be. That depends on the individual. I've been freelancing for 10 years now, and my customers aren't people who hang out on GitHub or coding blogs, so my risk/reward ratio would be different than that of other people.
Of course there are other rewards than finding employment and I don't mean to minimize them. But those rewards are a bit less concrete.
For the user, the program is a solution to a problem they have. How it is written, how it is designed (architecture), they really do not care. All they care about is solving the specific problem at hand and/or making their life a bit easier.
We all have bad code lying around somewhere. Sometimes it is because we were learning a new technology and sometimes it was because of budget and time constraints, and sometimes it was because we were just plain lazy. (we are humans after all).
Having said that, I think it is important as a programmer to constantly try to improve yourself - well, not just as a programmer, but as a human being too. That's what evolves us and just as you seek to be a better human a year from today, you seek to be a better programmer too.
As long as we accept that this is a constant struggle to do better, then I think it is easier to accept the code we have written in the past... and of course, to re-factor it whenever we have the opportunity and not do the same mistakes when starting a new project. But then again, this really applies to life and not just code, doesn't it?
I am a totally self-taught, "enthusiast" developer, and it is hugely important to me to write my stuff up for my cute little blog. I get it wrong as often as I get it right, and really enjoy the constructive critics. Even more, I enjoy those moments where someone says "nicely done" or even "Thanks! Just what I needed." Most importantly, I learn the most simply by trying to write it up.
I've done some (Many) things I thought were truly naive - a while back I undertook to write a project which would interrogate a database schema, and build out all the basic CRUD classes, as well as generate separate SQL scripts for each CRUD function for each class. I knew at the time that there were existing tools to do all this, and that nothing I could write had a hope in hell of being any good. But I learned a LOT from doing it.
Come to find out, a few years later I was checking out code from some notable ORM/Database utilities. My basic architecture, code, and most of my basic concepts were right on the money with work done by pro's who really know what they are doing.
Lately I am considering pulling out a bunch of my old garbage, and doing a series on what was wrong with it, how I would do it differently, and what I think I had RIGHT. Call it an extension of your "Code Garage Sale" concept. "From the Boneyard" or something. I have enough crappy, learning-as-I-go type code to stretch that on for a while!
Thanks for the great post.
Thanks, as always, for the perspective.
Have a great one!
-Mark Pesce, The Executable Dreamtime
My attempts to construct a theory of everything have so far yielded one algorithm, Algorithm Alpha, which I published in prose form, in May 2010: http://joshmaurice.livejournal.com/19048.html
I've posted some further thoughts on the subject at http://joshmaurice.livejournal.com and at http://jmmsynch.blogspot.com.
Anyone who has never written bad code, please raise their hand. Even the greatest geniuses in software started somewhere, and it's helpful to remember that.
I have written some absolutely atrocious code in my time, especially in the beginning. And even after a decade of doing it I'm still learning every day, and I still whip things together to get a job done that are far less than perfect. I judge my self worth as a programmer by the amount of people I help and the amount of problems I solve, not my line count.
Coders should be problem solvers first, and coders second. This person solved her problem and there doesn't seem to be an ill effects from this, plus she put it out there in case it may help others. Why should anyone take issue with that? And can we really judge her skills and overall value as a programmer by a one code snippet she posted to Github 2 years ago? Of course not.
Again, nice post Scott. It's good to see a respected coder with a big audience stand up and say this. We should be pulling people into our profession/hobby not pushing them out.
Scott, you don't really identify as a programmer. That's fine, but I think that gives you some distance from your code. You don't define yourself by your code, so you can claim that of others. You define yourself as a technologist.
It is the same as saying you are not your blog posts, or you are not your opinions on technology.
We are who we are, not who we were.
By no means lousy but I have an open source project to help others and for someone else to learn.
Here http://win8rssreader.codeplex.com, oh it just made its way to Windows Store too http://bit.ly/V9NhGi
I write very bad code and public github, bitbucket and some videos on YouTube, I believe that the only way you can really learn and evolve with the criticism of others and I learn a lot! And it's very graticante when someone likes your code!
Sorry for my bad English!
I started to share old projects on github only recently. A friend needed some help on the basics of a compiler, so I started to push there all the old compiler code that was sitting on my drive.
So, I accept your "challenge" :)
Here is some ugly,and perhaps unuseful, code to write intellisense plugins for vs2008. It is outdate,as 2 generations of Ides passed by,but helped my friend to understand how to use a parser,and how to design an application that did the same thing: highlight keywords,recognize patterns,autocomplete based on context. Even the most obsolete and obscure code may have a life we didn't expect.
My share for today: github.org/ldematte/BlenXVSP
I have a some pretty terrible code on github. I try to respect the code others share. Sharing can be scary, so we should applaud those who do it. I love to pair because I learn the most rapidly that way even though someone gets to watch me make mistakes all day long. It's sad when people forget we are all trying and we are all learning . The best code I could write at some point in the past isn't as good as my average code now and my best code now isn't as good as some other developers' average code today. I hope my code in the future is better than what I can create now, but I won't get there without help and that includes constructive criticism.
I am utterly terrified to share it with world + dog. I haven't even put it up in my Github scraps repo yet.
Although I'm not religious, I think the Golden Rule is still a good mantra to live by. Don't do onto others what you wouldn't want done to you.
I even have a post-mortem for the project here to document some of the architecture/design decisions I have made: http://sietch.net/ViewNewsItem.aspx?NewsItemID=195
Shame I love programming too much to care.
Great timely post. The sad and honest truth is that it's very very common to be in an environment where the "fore fathers" of the environment--typically no longer there--are belittled because of how bad the code is.
It is often true -- "the legacy codes suck". And I believe false harmony is wrong... that complaining is an important part of the process to get better. But it's important to direct the complaining at the code, not the author. In this exact context complaining about old bad code could be helpful.
But in the scenario you describe, a public snark at public code published by one developer is wrong. It is the definition of mean. I read the apology and I think that's important for the perpetrator as it helps him establish that he's not "always a d***."
But unfortunately the damage is done and can't be undone by an apology. Hopefully the programmer who got bashed has more self confidence then to give a crap what some jerk said off the cuff.
It's better to have contributed open source and have been snarked then to never have contributed at all.
Again, good post Scott.
Linus could easily have used different wording to make his point but not been mean.
Tech Talk: Linus Torvalds on git
I am accountable for my code, but only in front of my client, and more importantly, myself.
I really love this post!
With every year like you said, we get better (most of us anyway) and we learn new ways to do things either through conferences or just by programming, it is hard for me to commit to SVN or deploy to a production environment knowing some aspect of the project (no matter how large it is) isn't up to my current standards. I guess it doesn't help I've been with the same company for the last 6 years, interacting daily with not only the code I wrote back in 2007, but others from that far back that were coded very sloppy (that's the nicest way to put it).
It's come to the point some times where I will spend a weekend reworking a large project from work or a personnel project I did 1, 2, 5+ years ago to match my current practices. The question I have, does that feeling/urge ever stop?
On an unrelated note, the post's title and sentiment remind me of a wonderful India.Arie song.
I know a lot of us deal with personal issues of depression, anxiety, and low self-esteem. Programmers are nerds. A lot of us probably dealt with ostracization and bullying when we were younger. Why do we now do the same to each other?
I've been pushing for more responsible dialogue in technical circles -- mailing lists, forums, Twitter, Reddit, Hacker News and the like. A gentle calling out of someone being a jerk can sometimes make them realize how awful their words sounded. Like the guy I saw the other day throwing accusations at a group of developers of being "moronic idiots always high on drugs". Completely ridiculous and doesn't belong in any reasonable discussion, yet developers feel free to throw those types of insults at each other. Why? What the hell are they accomplishing? It's completely non-constructive.
Can't we bring each other up and be happy together rather than tearing each other down? I don't have the urge to insult anyone. Sometimes I get the urge to say some code is "bad" but there are constructive ways to do so without hurting anyone's feelings.
Why would it be a bad thing to avoid being prickish?
I don't know much about C++, but wanted to play with C++11 and Qt5. Indeed I was slightly worried about people criticising, but thought the project might be useful maybe, so decided to release it.
Feedback welcome. :) Both positive and negative - I'm actually kind of disappointed by lack of responses like feature requests.
Sure, it could be made cleaner, more modular, <insert one of many "right ways" here>, but what would the benefit be? Do we need to write all of our personal code so that it can be expanded to an os?
That being said, I feel a bit convicted about this subject because my singular venture into published open source work has actually had a surprising amount of interest (nothing huge, but a lot more than I expected when I published it out a couple of years ago http://xnastoryboard.codeplex.com/)
Makes me think I should do more; just because I don't think it's "up to snuff" doesn't mean someone else might not find it useful, and certainly doesn't mean that putting it out there can't serve as a means of getting better myself.
Thanks for all these great comments, everyone!
Brian - Everyone feels like a phony. http://www.hanselman.com/blog/ImAPhonyAreYou.aspx
What's considered idiomatic today might not be tomorrow. I've seen many idioms evolve of the years in different languages.
I have some terrible code on github and some good code. What matters is that we produce code and learn from our mistakes. Fork away.
Code Review to as many people as possible, if it sucks you will learn!
Reminds me to clean up that follower list ;)
On January 29, 2012, I wrote my very first blog post. Although, I wasn't sure if I'm doing the right thing, since I knew a lot of people that were way better programmers than me, I decided to do it anyway. One year later, i.e. today :), I have received the first comment on my blog, and it was some guy who said "thanks for this code". I was very excited and even now I know I still write lousy code I'm ready to improve myself to be better in any way.
Thank you for this great blog post and a lots of others that certainly inspire people to achieve good things.
It removes user names and servers from SSMS's connection dialog.
I haven't released it b4 because I was waiting to clean it up... which will never happen!
Just be sure and keep perspective. Learn from those better than you, but understand where you are coming from and what you have accomplished.
As you get better your standards for your own performance will continue to improve because what was once difficult will become easy, freeing up brain cells to focus on even more challenging coding problems. And the cycle repeats...
BTW, I'm a 41 year old with no programming experience. I've been in finance my entire professional career. But I want to learn to code. I've published one WP app and am almost done with my second. My point is that even old dogs can learn to code. Just keep plugging away and don't give up.
You've achieved a certain level. Be proud of it for the moment. But don't be forever. Continue to work at it, and eventually you'd be confused why you were proud of it.
Comments are closed.