Thursday, August 8, 2013

Writing Small Methods... No, I Mean Really Small Methods

Mouse and Elephant

Like many programmers, I've typically aimed to keep my methods small. On average, my methods have been probably around 8-12 lines long. But lately, I've had a blast

Wednesday, June 26, 2013

Unit Testing: What's a Unit?

We all know that we should be writing unit tests, but have you ever thought about what a unit is, exactly? Most definitions out there, including the one on Wikipedia, describe it as the smallest piece of code that can be tested.

But what does that mean? The answer to that question will

Friday, May 31, 2013

My Favorite Presentations from RailsConf 2013

Confreaks has been busy over the past few weeks, putting together the videos from RailsConf 2013. Now that they've posted over 90% of the presentations, you've got

Tuesday, May 21, 2013

3½ Ways to Reuse Code in ColdFusion Components

Programming languages give us a variety of options for sharing code among multiple classes. In this article, let's look at the 3½ ways that ColdFusion allows us to get code reuse in our components.

Let's start with a problem – we've got two

Monday, May 6, 2013

RailsConf 2013 Highlights

Last week, I had the privilege of attending RailsConf up in Portland. With about 1500 attendees, 4 days of sessions, about 3-4 session options to choose from at any time, and a set of about 40 lightning talks, there was

Thursday, April 25, 2013

Extra Git Merge Commits: Merge branch 'master' of github.com:owner/repo

As I've been working with some friends on a GitHub-hosted project lately, I've seen tons of seemingly extraneous merge commits in our master branch that look something like this:

Merge branch 'master' of github.com:owner/repo

This can seem confusing, especially to those coming from a subversion paradigm, for a few reasons:

  1. You see it when you're working on master. If there's no branching happening, why is there a merge?
  2. The merge commit includes changes that have already been committed, so it looks like they're happening twice.

What Causes This?

When you're

Wednesday, March 27, 2013

A Quick Look at SourceTree for Windows

Atlassian recently released a beta version of SourceTree for Windows, their graphical Git client, which was previously only available on Mac. Since BitBucket kept telling me to give it a try, I gave in and snagged a copy.

Now, I gotta say, the Git CLI is amazing. I mean, you can do some crazy stuff in a simple terminal window. Tasks like interactive rebasing and cherry picking hunks of changes work surprisingly well on the command line. But there are also tons of features of Git that would lend themselves well to a GUI. So let's peek in on SourceTree to see what it provides.

Wednesday, March 20, 2013

Book Review: Effective C# by Bill Wagner; Addison-Wesley

This review covers Effective C#: 50 Specific Ways to Improve Your C# (Second Edition) by Bill Wagner, published by Addison-Wesley. You can pick it up from Amazon or InformIT.

Bill Wagner's book, Effective C#, 2nd Edition delivers fifty easily-digested best practices to take your C# to the next level, covering a variety of topics from language idioms to dynamic programming and beyond. There are roughly 300 pages that are packed with content, striking an excellent balance of code and prose.

As a professional programmer who has

Thursday, March 14, 2013

Time to Restructure!

I love greenfield projects! They're a chance to start with a clean slate. A chance to do things right. After maintaining our existing apps for so long, we're keenly aware of everything that we'd do to fix them. A fresh start is a golden opportunity to take all those lessons we've learned and apply them in order to build a shiny, pristine code base that we can be proud of.

The New Project Rush

New projects are also usually a bit of a rush. The business team wants to make sure you can deliver by a certain date, so things

Thursday, March 7, 2013

Are You a Programming Newbie?

We were all coding noobs at one point or another. Here's my list of the top ten things that I hope you don't do anymore.

You might be a programming newbie if...

  1. You put all of your variables in the global scope
  2. You've got a conditional with half a dozen expressions
  3. All of your variables names have

Wednesday, February 27, 2013

Best Practices vs. Prototypes

I've noticed that developers are good at identifying and learning best practices. I've also noticed that they're equally good at coming up with reasons why the best practices don't apply in some particular case they're working on.

If that's you, don't worry. I'm not here to slam you. In fact, I think it's something that we all wrestle with daily. We know the

Thursday, February 21, 2013

Code Review Best Practices - Use Code Review Software

Although you can get by doing live code reviews, I've found that using code review software has generally made my code reviews much more productive. There aren't a ton of code review software packages out there, but some of them are outstanding.

If you're

Wednesday, February 13, 2013

HTML5 Date Pickers and JavaScript Date Objects

HTML5 date picker elements have a lot of potential. After all, there are tons of apps out there that need a control for choosing a date. The number of browsers that support them is gradually growing, but not as quickly as you'd expect. Here's what it looks like in your browser -- it might just be a text box if your browser doesn't yet support date pickers:

Because of the lack of support in some browsers and the simple implementation in others, many developers still end up going with jQuery UI to render their date pickers.

If you choose to go with the native HTML5 control, you might notice a problem when

Friday, February 8, 2013

Code Review Presentation Slides

For those who attended this week's Nashville Java Users' Group and were interested in reviewing the slides from my lightning talk on Code Reviews, I put them up on SlideShare. For convenience, I'm also embedding the presentation here.

While preparing for that presentation, I also realized that I've got a few gaps to fill in from the initial series on code reviews, so I'll be adding to that series over the coming weeks.

Monday, January 28, 2013

What vs. How

Have you ever had this happen to you? -- You're wading through code, analyzing one expression after another. After getting forty lines into the method, you pause and ask yourself, "Wait, what is this method supposed to do again?" It's easy to miss the forest for the trees.

This happens a lot when the code is

Thursday, January 17, 2013

How to Sell Them on Your Design

So, you've been tasked with restructuring your object model. After hours of thinking through the implications of each design decision, you've sketched up your new object model in a UML class diagram. You're ready to present it to your peers! Now, how are you going to sell them on it?

Take a look at

Wednesday, January 9, 2013

Speak to Me, UML!

I don't know about you, but when I first learned about UML, I was ecstatic! I was just so excited to have a standard way to represent my object model in class diagrams in ways that were easy to sketch and understandable by others. I created diagrams every chance I got.

Here's an example of what my class diagrams looked like back then:

Very detailed UML diagram

Yep, that's what they looked like, except with about three or four times the number of classes as we see here. Sure, they were factually correct, but they were also so doggone verbose that they were only good for stuff like auto-generating stubbed out classes.

Reading a diagram like that is a bit like

Tuesday, January 1, 2013

Goal-Setting Tips for Programmers

We all know that goal setting is important, and the beginning of the year is a great time to recalibrate your compass! So to start your year off right, here are a few tips for goal-setting, from a programmer's perspective.

Profile Picture
Dave Leeds
My Hobbies:
  • Programming
  • Cartooning
  • Music Writing
Full Profile