Ayende @ Rahien

Unnatural acts on source code

Things that scares me

I had run into something today that I have no idea how to respond to. I was working with someone and at one point I did a WAIT A MINUTE, What Just Happened?!

He then proudly showed me how he improved his daily work flow. He has modified the VS #region template so he was able to select a piece of code, hit a few keys, and get the following:

 #region old
/*

selected code...

*/
#endregion

You can guess how the code base looks like, I assume, which this technique in place.

Comments

Steven Harman
07/10/2007 08:33 PM by
Steven Harman

Yikes!

After picking your jaw back up off the floor I assume you explained to him that things like that should be left to the version control system, right? :)

Moran
07/10/2007 08:53 PM by
Moran

This thing hites too close to home. After I calmed down I implemented the DELETE button repeatedly until it was dead, dead, dead.

Tom Opgenorth
07/10/2007 08:59 PM by
Tom Opgenorth

I'm confused, why didn't he just delete the code if he was going to comment it out? Isn't that less effort that tweaking a template?

Nick Aceves
07/10/2007 10:00 PM by
Nick Aceves

I remember doing things like that when I was a budding programmer. I had no concept of what source control was, so I would routinely take "snapshots" (i.e., I copied all of my files into a zip archive with the date as the filename) of my projects then delete all the stuff with /* OLD */ around it.

Wow, I hated doing that. I'm so glad I have source control.

Joseph Holsten
07/10/2007 10:07 PM by
Joseph Holsten

I had run into something today that I have no idea how to respond to.

Buy him the subversion book.

Ayende Rahien
07/11/2007 02:57 AM by
Ayende Rahien

Steven,

Would it explain it better if I said that the last commit was two months ago?

Michael Hawksworth
07/11/2007 07:43 AM by
Michael Hawksworth

Look at it this way...

He's now a better developer

now all you need to worry about is how many of the others are doing similar things....

To be fair he was probably doing as good a job at minimising problems as he knew how so at least he is conscientious and that isn't a bad thing.

Jon Limjap
07/11/2007 09:46 AM by
Jon Limjap

Don't worry, I feel your pain... I just deleted a few thousand lines of commented code out of an application that was going to go through a new iteration.

Thing is some of the code were whole files, e.g., whole Classes, that were commented out but not removed from the source control.

I'm sure my Delete button (and Ctrl-L) got bruised that night.

Carl
07/11/2007 02:42 PM by
Carl

Maybe he was using SourceSafe for version control - in which case he probably trusted regions more than SC?

flukus
07/17/2007 05:04 AM by
flukus

I hate regions. I used to work with a guy that used them for his monolothic code gen nightmare. The problem is it screws up vis studios auto collapse.

Comments have been closed on this topic.