Who Wrote This Crap?

Everybody’s always blaming me, it ain’t fair. I am not the Administrator you’re looking for. That code was checked in by the Administrator next to me, while he was impersonating me.

Nice to see that everyone will have to use Visual Studio 2008 as Administrator, just like Visual Studio 2005, just like Visual Studio .Net, just like Visual Studio 6.

Who codes as “Administrator” on your project ? And when is your blog engine coming out ?

I usually have a clearcase version tree open at the same time i have code open. Anyone know if there is a blame like substitute for clearcase ?

James Justin Harrell:
So you’re wondering if a feature of Visual Studio… is tied to Visual Studio?

Nefarious.

But all seriousness aside, if you meant to say “I hope it’s not tied to Visual SourceSafe,” then I’m right with you. It would be nice to use this feature with SVN.

taryn: "Well Mike, if Jeff hadn’t written “…finally delivers a feature I’ve wanted for years…”, most of these comments wouldn’t have said, “Gee Jeff, you coulda had it decades ago if you’d been paying attention.”

Well, Taryn, if you had paid attention, Jeff said “in Visual Studio”. So those other posters can’t read any better than you. :slight_smile:

It might be handy to tell who changed a particular line last, but that will rarely tell you who actually introduced a bug. Even if it throws an exception on line 10, the problem may be with something that happens on line 5 that fiddles with the structure, but does it without throwing an exception.

I prefer to spend my time figuring out WHY something doesn’t work than running around figuring out WHO to blame for it.

Like the old NBC slogan, “If you haven’t seen it, it’s new to you.”

Chubber:
I think you and a few others are missing the point here. The easiest way to understand a section of code is to have the original developer explain it to you. Or better yet, you should have that original developer fix their own mistakes. You’re much more likely to make a bollocks of your “fix” if the code is strange to you.

This feature just facilitates the process.

…and don’t tell me you’ve never wondered “Who wrote this crap?”

If you say to a piece of code, “who wrote this @#$#@% crap”, and then later found it was none other than YOU, then you’ve been working too long at this company and it’s time to quit and join another company!

If you say “Who wrote this crap”, then also make the initiative to “change this crap”. If you can’t, then you have accepted to “live with this crap”, and therefore the developer who “wrote this crap” and all other subsequent developers who “lived with this crap” are all equally responsible for “this crap”.

:slight_smile:

This would be an interesting blog post:

Supposed you were hired at a new company.

The software you would be working on is about 10 years old.

After a few weeks on the job, you found the whole software was a fucking piece of mess, and it had too much crap. It was written by a developer just out of college using every feature of a relatively new language. It was unmaintainable, hard to understand, small changes took a long time to integrate. Because it was written in the 90s, it had a really old debugger and compiler, and tools were very lack-luster. You can’t use any of the new tools today.

Problem? You can’t change it, because the company has thousands of customers already using the software. The founders or original ‘designers’ of the software are still onboard as “Chief Architects”, so they won’t listen to critism and “who wrote this crap” is very sensitive.

So what do you do:

a) Quit and find another job

b) Continue working with this crappy software

c) Complain, yell, and do nothing, but say the software sucks.

d) Kill yourself

I’ve read so many design pattern books that I can no longer write good code. My sense of code smell is greater then my skill.

On topic. One reason I like features like this is it has potential to help Junior developers. If a senior member of a team sees some “wacky code” written by a Junior, the more experienced Dev can use that as an teaching tool.

Secret answer D) all of the above in the following order B for a cupple months C) immediatly followed by A

I have a small script to do this in Perforce (called p4blame :slight_smile: and have imported it as a custom tool into VS2005. Team System? Who cares - we’ve been using Perforce for almost 10 years and it’s amazing.

In emacs this is ctrl-x v g

It also has neat features like highlighting changes in the last 3, 30, 90, etc days only.

http://www.emacswiki.org/cgi-bin/emacs-en/VersionControl
http://www.emacswiki.org/cgi-bin/emacs/vc.el

Brief history: VC mode was created by Eric S Raymond in 1992. So this might be a 15 year old feature for emacs :slight_smile:

//unix snob off
and to be honest I only found out about this feature in the last year :slight_smile:

(noticed that the emacs comment had already been made by Richie Bielak – I’m going to pretend I still added value because I tracked it down to 1992)

@Mac:
“We don’t live in a perfect world. And there is no reason to ask ‘who wrote this crap’, like the borg say, it’s [irrelevant].
Why? Because A, you, yes, YOU have to fix, modify, replace or whatever to it. B, even if you know who wrote this crap chances are very good that they are slightly less than useless to you for fixing, modifying, etc. because of the 6 month rule.”

Nope. I’ve been using an IDE with built-in SVN support (Green Hills’ MULTI) for a year-ish now, and it’s amazingly useful, just as Jeff says. In big software projects, it’s almost never the case that “you, yes, YOU” have to fix something on your own. Your job is to figure out how to fix things without breaking other things that depend on it. If you see some crap code, you can’t just barge in and remove it until you understand all the dependencies… and the best way to learn about the code is to talk to the programmer who wrote it originally.

“svn blame” is the way to find out who that original programmer is. GUI support for SVN just speeds up that finding-out process.

Non-usage scenario: “Hmm, this code looks wrong. I’ll change it… yep, it passes all our validation tests. Commit away!”

Usage scenario 1: “Hey, Bob, it looks to me like that (i = 0) on line 6235 should be (i = 1). I ran a couple of tests and I think I’m right, but since you wrote the original code, can you take a look and tell me if you agree?”

Usage scenario 2: “Actually, never mind, Bob. I looked at the commit log from when you committed that code, and I see that you mentioned bug report #7726. Indeed, that test case breaks if I change the code. I guess I didn’t understand the code as well as I should have.”

The blame function of svn is great. Often I’ll look at something and go “who wrote this crap?”, look it up in svn via blame, and find out that it was me.

Yep, this is a cool feature. However, we’ve had a working equivalent for years: “Who’s the last contractor who worked on the project, and since left?” “X” “It’s X’s fault!”

As a former contract programmer, I can say with pride: that’s just one of the valuable serivces we provide our client.

Hell is other people’s code.

I don’t even “blame” anymore, I just assume it’s me :wink: