Archive

Archive for the ‘Announcements’ Category

Get rewarded for your gnarly source code.

October 22nd, 2009 Casey No comments
VN:R_U [1.6.3_896]
Rating: 5.0/5 (1 vote cast)

What up, everybody?

You may have noticed a row of stars at the top and bottom of each post.  You can use these stars to rate content submitted by other users.  Before you ask, no, you can’t rate your own posts and no, you can’t vote for the same post twice.  Nice try.

In the next couple of months we’re going to be rolling out a contest based on these ratings.  The highest rated user at the end of each month will have their name posted prominently on the site and will get some cool swag, courtesy of WriteThisNotThat.com.  For right now I think we’ll probably be doing t-shirts but we are in the process of courting some sponsors so we can toss in some books, development tools, etc.

Next time that you find some particularly fugly source code, share it with us!  There could be a little something in it for you.

Remember, in order to post, you’ll need to register first.  Don’t worry, we promise not to share your information with anyone.  If you don’t believe me, take a look at our privacy policy.

As always, if you like this site, please don’t keep it a secret!

VN:R_U [1.6.3_896]
Rating: 5.0/5 (1 vote cast)

Categories: Announcements Tags:

Welcome.

October 3rd, 2009 Casey 3 comments
VN:R_U [1.6.3_896]
Rating: 3.7/5 (3 votes cast)

You see it everyday.  Ugly code.  It’s the code that keeps you awake at night.  It’s that 700-line-long method that makes you vomit in your mouth a little bit every time you think about it.  It’s the code that technically works as designed but should, in a perfect world, cost someone their job.  They don’t teach you about this code in a classroom and you can’t learn about it from any book.  You learn about it from experience.  Once you learn to spot it, all that you want to do is fix it.

The purpose of this site is to build a dictionary of good coding practices by examining and analyzing the ugly ones.  By sharing these experiences with the community, you’re helping someone else, be they a junior developer right out of college or a seasoned professional, build better software.  This site is dedicated to just that — building better software.

In order to fully illustrate my point, let’s take a look at an example in C#.  I actually ran across this little gem a few days ago.

try
{
   // Do something important.
}
catch
{
   throw;
}
finally
{
   // Clean-up something important.
}

Of course, I’ve removed some of the meat from this code block, but you get the picture.  We’re doing something important and, afterward, we need to guarantee that some important clean up works gets done.  But, what’s up with the catch block?  It sticks out like a sore thumb.  All it’s doing is re-throwing the exception.  It’s a common misconception that a catch block is always required.  In C#, you can have a catch block, a finally block or both.  So, let’s improve it.

try
{
   // Do something important.
}
finally
{
   // Clean-up something important.
}

Ah, that’s much better.  Of course, if we had some work we actually needed to do in the catch block, we could have left it there, but, for our needs, this is much better.  Someone else may run across your code later and tell themselves “I didn’t know that you could do that.”  As a matter of fact, that’s how I learned most of what I know about building software.  That’s the point of this site.  My goal is to bring that internal dialogue to a global scale and to teach the things that it takes most developers several years out in the real world to really grasp.  There are some things that you can only learn from talking to the guys that have been there and being exposed to the good, the bad and the ugly.

I realize that there are a ton of sites out there dedicated to helping developers build better software, but this site is the site that I’ve always wanted.  I’ve often posted ugly source code to my personal blog or showed it to someone else in the hopes that it could help to teach someone else.  That’s what I want to create here.  The more knowledge we can share, the better a resource we can be.

Jump in.  Help us get this project started.  If you like the it, please don’t keep it a secret.  It doesn’t matter if you’re into C#, Ruby, Perl or anything else.  It doesn’t matter if you’ve been building enterprise applications for years or if you’re just now starting to get your feet wet.  We want to hear from you.

Please keep in mind that this site is very, very beta.  I’m sure that you’ll run across some bugs and, when you do, please let me know about them.  This site is still evolving but, especially at this point, that’s a really good thing.  I want you guys to help mold this site into what it should be.

If you have any questions, please check here first, or feel free to drop me a line.

Welcome.  I look forward to building this with you guys.

Casey.

VN:R_U [1.6.3_896]
Rating: 3.7/5 (3 votes cast)

Categories: Announcements, C# Tags: