Scott Hanselman

You are not your code.

January 25, 2013 Comment on this post [60] Posted in Musings
Sponsored By

Photo by Ed Yourdon used under CC http://flic.kr/p/55YkTjI'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.

I'll 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.

About Scott

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.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
January 25, 2013 3:00
Great post! I'm shocked at the snobbishness of people. Granted, I love good, clean code but meeting something with snarkiness or condescension has never produced good. If you feel that someone could benefit from your knowledge, then why not provide constructive criticism? We are not our code, but like life we can only improve when others show us how we can through humility and kindness.
January 25, 2013 3:02
Love this:


We are not our code, but like life we can only improve when others show us how we can through humility and kindness.
January 25, 2013 3:07
This is exactly why I think Twitter is a HORRIBLE medium for communication, especially technical communication. It's impossible to justify your opinions in 140 characters and without justification any criticism comes off as snarky, horrible and... well... unjustified.
January 25, 2013 3:22
Really well put Scott!!!

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!
January 25, 2013 3:22
I really appreciate this sentiment from "programmer celebrities" (if there is such a thing) like yourself.

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.
January 25, 2013 3:22
Good one, Scott.

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."
January 25, 2013 3:25
In 2004 I wrote a program to help coordinate LAN Parties and open sourced it for others to use. It was some of the worst code I've ever written, but it solved a problem and solved it fairly well. I learned a lot writing it and (to my surprise) 8 years later it's still in use.

Bad code can still solve problems. If you keep a good attitude and don't ever get complacent, you'll be fine.
January 25, 2013 3:33
Well said, Zach!

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.
January 25, 2013 3:36
Great post! I try to share anything I come up with that others might find useful.
January 25, 2013 3:37
I.Dispose() therefore I.Am();
January 25, 2013 3:38
I would go even further. For me it's embarrassing to look back on my own code. In larger projects I would really like to recode the complete project after a specific time, although all works perfect. - But I hate the code - it's so inelegant... ugly...
January 25, 2013 3:47
Scott -

"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.
January 25, 2013 4:08
What we need to remember is that the code we write, all the architecture decisions, unit tests etc. are for us - so we can maintain the code going forward. The user, does not care. (who here cares how the chips are designed or built in their laptops or how the fuel injection system is designed in their cars?)

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?
January 25, 2013 4:40
Nice post, Scott!

Also, @TJ Gokcen - well said!
January 25, 2013 4:47
I firmly believe in the "thick skin" school of thought. No matter what the industry, there are those who seek to inflate their own self-worth by mocking the efforts of others. They can be ignored.

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.
January 25, 2013 4:56
This has gotten exponentially worse on StackOverflow. I've posted some good (and bad) questions that have been met with a ton of cynicism, and arrogance. I remember when SO started, it was a way better community.
January 25, 2013 5:04
Okay, Scott. You've finally pushed me into posting some of my utilities, classes and powershell scripts. I'll put them together over the weekend and feed the sharks with the hope that someone can use something I've done.

Thanks, as always, for the perspective.

Have a great one!
January 25, 2013 5:06
A forthcoming "Theory of Everything" won't be a formula; it will be a program, a series of linguistic statements, which, like the words in a sentence, describe the execution of reality.
-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.
January 25, 2013 5:46
For each @harthur, you have a dozen http://thedailywtf.com/Articles/Equals.aspx , http://thedailywtf.com/Articles/Classic-WTF-We-Use-BobX.aspx , or http://thedailywtf.com/Articles/SQL-Splits.aspx
K
January 25, 2013 5:50
Great post, Scott.

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.
January 25, 2013 6:29
I am my code. I'm just not my code then. I am my code now.

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.
January 25, 2013 6:45
Nice post,

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
January 25, 2013 7:33
Funny, one of the guys that wrote these tweets actually has a site full of hippie-lets-hold-hands-and-code-together bs. The best lesson he could get would be nobody showing up at his talks. There are so many humble and talented developers out there really deserve our attention. Following these other kind of people is just wasteful. Thank you for putting your voice in this matter.
January 25, 2013 8:31
I'm actually a fan of yours!
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!
January 25, 2013 9:44
My code isn't mine. It belongs to the client who hires a company. Or it is the employer's. Unless I license the use of my work. But then that rarely happens with web dev or C# dev. So no, I am not my code either. I am a resource who is needed to make something useful.
January 25, 2013 11:10
Great post Scott. Helps putting it all in perspective. Still, you have to admit that developers are always afraid/ashamed to show their code. Because now we would do it better. Because employers, especially future ones, can judge you from that code. It needs maturity and experience to understand that code is Always valuable!
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
January 25, 2013 11:26
+1

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.
January 25, 2013 13:46
Inspirational, here's some of my stuff.
January 25, 2013 14:34
I have some Java code that "reverses" a hibernate mapping by turning an object mapped via hibernate into a Map implementation, where the key is the column name and the value is the original value. The code was for a very specific use case where the original column names matched up about 80% with defined keywords in an ANTLR grammar.

I am utterly terrified to share it with world + dog. I haven't even put it up in my Github scraps repo yet.
January 25, 2013 16:57
I think Twitter is an easy medium to get carried away with. Those guys making the comment probably were "trending" on each other and didn't stop to realize that that were attacking someone who had done something they want everyone else to do: contribute to the community in some tangible way.

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.
January 25, 2013 17:04
So anyone willing to review my Visual Brainfuck for Windows Phone?

http://bfforwp.codeplex.com/

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
January 25, 2013 17:10
I can't believe it, I just blogged about a Validation library I created and got burned on twitter for it.

Shame I love programming too much to care.
January 25, 2013 18:07
Scott -

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.
January 25, 2013 18:23
Scott - this is an example of walking the line (not blaming individuals) but it's probably mean.

Linus could easily have used different wording to make his point but not been mean.

Tech Talk: Linus Torvalds on git
http://www.youtube.com/watch?v=4XpnKHJAok8
January 25, 2013 19:52
As for me, I am my code. My code of last year was what I was last year, and my code of today is what I am today. The code of today is probably better, but it's because last year's code taught me something. The same way myself is taught lessons from my past.

I am accountable for my code, but only in front of my client, and more importantly, myself.

I really love this post!
January 25, 2013 19:55
I whole heartedly agree as programmers we evolve and yeah code I wrote 12 years ago I have to scratch my head at with astonishment (why I didn't make a class there or why did I put that conditional in that loop, etc..).

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?
January 25, 2013 20:05
Nicely said, Scott. I wrote about my own experience with this idea last month:
http://sstephenson.us/posts/you-are-not-your-code
January 25, 2013 21:54
Nice post.

On an unrelated note, the post's title and sentiment remind me of a wonderful India.Arie song.

Joseph
January 25, 2013 22:32
Great post. I've been thinking about something similar lately -- developers, security researchers, technologists, and internet users writ large can be pretty rude.

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?
January 25, 2013 22:38
I've written some, probably lousy, C++ last weekend - Zeal (documentation browser)

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.
January 25, 2013 22:58
in ORM I used context<Customer>().ToList () :) and put the filter after "ToList"
Sam
January 26, 2013 0:15
Looking at the code, I don't see what's all that terrible. It looks like the code of a, small, one off type, easy to use, project.

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?
January 26, 2013 0:16
As usual, you make some really good points, Scott. Despite being the "go to guy" for code questions around my office, I often feel like a fraud because I know my understanding can't match the guys I follow on the web.

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.
January 26, 2013 0:19
Joseph - A classic. That album was my jam for like 18 months. I met her at LAX a few months back. Super cool.

Thanks for all these great comments, everyone!

Brian - Everyone feels like a phony. http://www.hanselman.com/blog/ImAPhonyAreYou.aspx
January 26, 2013 0:52
Agreed, but we still need to own our code to a certain extent.
January 26, 2013 1:35
I like this. People need to realize that whenever someone does diss your code, it's usually because they found some small part of it that they understand a better way of doing. It doesn't automatically mean they're a better programmer overall even if they happen to be right about that one thing they found. Your self esteem shouldn't be lowered, especially because that issue with your code they just told you about is now *your* knowledge too. So you've evened out :)

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.
January 26, 2013 10:52
It wasn't easy for non-native English speaker, but your posts inspired me to write my first blog entry:

http://tagcsharp.blogspot.com/2013/01/linq-shuffle-and-thread-safe.html
January 26, 2013 15:10
You gave me a lot of Hope of becoming a better programmer. I've appreciated very much your sincere post. Thank you very much

Alessandro.
January 26, 2013 20:57
I am proud to have written bad code. I am proud because I have learned something from it. I think one of factors that seperate the average from the great, is what you learn along the way. More often than not, the brightest programmer in the room, is the one that made the most mistakes. The best programmers tend to be their own worst critics as well, because of Scott Hanselman conciders himself "a lousy programmer".......I pray for my end users.
January 27, 2013 22:08
Completely agree.

Code Review to as many people as possible, if it sucks you will learn!
January 28, 2013 21:15
The worst is that these people don't even explain their point, they just throw all the shity critics at you, rather than elaborate and explain how to improve.
January 29, 2013 15:26
Wonder if Heather Arthur got his apology if the comments didn't attract that much attention.

Reminds me to clean up that follower list ;)
January 29, 2013 17:35
Hi Scott,

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.
January 30, 2013 5:45
OK, you've inspired me. I've dipped my toe in the open source water by releasing some ugly code that does a simple but (judging by some comments I got on StackOverflow) useful (for some) job.

ssmsmru.codeplex.com

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!

Thanks Scott!

February 01, 2013 14:41
Nice Post

Thanks Scott
February 02, 2013 5:18
I think it's also important to remember that "better" is relative. I may be better than last year, which to me is awesome, but to someone with 20 years of full-time coding experience my "better" looks like a 5 year old's watercolor hand painting.

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.
February 03, 2013 10:44
Very well Said Scott!!. We are not our code. I face some kind of criticism for my blog some time. But I learnt from that and continue writing. I am what I am I will not change myself but rather I will learnt from this mistake and improve my self.
February 08, 2013 20:42
Always been a little fearful of putting my code out into the open, but this has inspired me. First commit is up.

https://github.com/GunnerMichael/ServantSoftware
February 09, 2013 4:25
The only way to know you've improved well is to look at your past year's work and feel disgusted. This holds true to a lot of performances in life.

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.
July 09, 2013 8:14
Putting your code to open source community needs courage, it's not easy to hear criticism, which is most likely to occur, when you share your code to all over the world.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.