Posterous theme by Cory Watilo

On Deleting Code

I think it takes both courage and self control for a developer to simply delete code.

Usually, developers prefer to comment out code rather than delete it. I see this a lot, both while pair programming and while reading other people's code.

I have nothing against comments per se, or against commenting out code when you know you're going to need it a bit later. What ticks me off is when I devs comment out a whole block of code because they're about to rewrite it. And then they just leave it there. Forever.

That's a problem because when someone else comes in and reads the codebase, they see the comments and they have to read those too. Because, hey, if the commented code would be useless, then it would have been deleted, right? Therefore, this code is just as valuable and important as the uncommented code.

Pah!

Another scenario occurs with shotgun coders. You know them and you've worked with them. They don't really know the API so the hack at the examples and you could swear that you can read their thoughs when you watch them try out different API calls: "Maybe this will work." -- "OK, maybe this?" -- "This?"

They comment out each try, leaving a trail of failed trials in their wake. And when -- as if by miracle -- they do get the damn thing working, they quickly close the file. Yes, comments left untouched. Like a trophy of cool code and of their great effort.

Pah!

It takes courage to delete code, it seems. You first need to understand what the code you're deleting is doing. People don't like to invest time in that kind of stuff. They'd much rather have the old code right there in case they screw up.

Deleting code is like making a promise. You give your word that you are going to write better code that will replace and maybe extend the old one. This means the old code will be obsolete. And in the words of the late George Carlin, here's what I like to do with obsolete code: delete the fuck! I do have git to take care of old versions of the codebase so I don't have to, right?

The next time you comment out some code trying to fix a bug, remember that and delete it when you're done.

Take some responsibility. Make a promise. Delete code.

 

 

Stop Asking Developers If Something is Possible

Because developers know and believe that everything is possible. Yes, any feautre can be done, any request can be met -- but that's not the right question.
The right question is:

How hard would it be?

Or, if you like your questions to me marketing-staff-readable: how big is the risk?

This scenario rarely happens in the real world, where people decide an app needs a feature and just open a task and they expect it to be done asap.
Yes, you may think you app needs a feature, but is it really worth its cost? 

Also, don't ask a developer how long would it take, because we should all know that developers cannot estimate time.

Protips: Giving a Presentation Off Your Laptop

 

Here's a list of things to keep in mind when you're giving a presentation off your laptop and a projector.

1. Turn off power saving features.

You're going to be talking a lot, hopefully. This means that the computer will be become idle, for as long as 10 minutes at times. It really sucks if your laptop's display dims and the room is left with a blank projector screen after 1 minute of talking. It's not that we need 15 minutes to read the slide, it's just that having the projector screen turn blank catches the eye and breaks focus. You also suck more if you keep touching the touchpad to bring the display back up. If it dies, leave it be until the next slide.

2. Make sure your battery is up for the task

I hope I don't have to stress this, but you should never-ever run out of battery after 5 minutes of your 20 minutes presentation. Still, if you do, at least have your charger at the ready. Or at least with you. Otherwise, you're using your audience's attention to ask around for a charger, rather than telling them something useful.

3. Clean up your desktop

Because nobody cares to see all your application shortcuts and nobody cares to see your family photo wallpaper. Your dog might be acceptable, but do make sure your desktop is appropriate for your audience. You get bonus points if you're running a pirated copy of Windows and the GWA notice comes up.

 

I don't know about you, but these three really tick me off. Especially if I see them all in one conference.

Got your own favorite?

Image source.