Taking out code



  • I was adding a feature that affected one of our calculations, so I looked for where the calculation is made to make the change. That was simple enough - simply perform a Find All References on one of the fields that take part in it, and go there. What I found, unfortunately, was that this calculation was done in two places. In two completely different ways, which both seem like they would make sense, but only one can be correct - whichever one's results matches [vendor]'s numbers.

    Since I know the current state of affairs was correct in a specific control, I located where that control's calculation was done - it was in that control's .xaml.cs file. The other place the calculation was made, in a class that was made entirely for that calculation and in the business logic layer, was only called in one place called. Tracking that class down, I found it was part of our mountains of uncalled code.

    I then made a mistake: I told the PM I'm taking the code out. I should have just done it. But I told him first. And he said "sure, just leave it commented out." After a heated discussion I decided to spend my time doing something more productive (e.g. reading what's new on Google+), and give up on the silliness. I commented the code out, and everything I could find that was directly related to it and not needed any more.

    During code review (which is done here in person, before checking in code), the reviewer asked me why I commented that code out and didn't delete it. I explained that the PM said so. He immediately got up and went to speak to the PM. 20 minutes later, he got back and said to leave it commented out. My other colleagues, who overheard, also spoke to the PM, but couldn't change his mind.

    Us: Why leave it commented out? We have source control?
    PM: We might need it some day.
    Us: The code is already wrong, will immediately become even wronger (with my new change), and doesn't help at all.
    PM: But we might need it some day, so we better keep it. When the time comes, we change whatever's wrong.
    Us: Every single line is bad.
    PM: We can use it as a template for the new code that might replace it.
    Us: Why not use source control?
    PM: It's hard to find code there.
    Us: There's a commit message that explicitly says we're taking out that code
    PM: Yeah, but nobody here knows how to find that.

    The code is now commented out. Odds that code like it will need to be written: 1 in 10. Odds that the commented out code will even be found: 1 in 1000. Odds that it will be helpful: 0.



  • @configurator said:

    PM: Yeah, but nobody here knows how to find that.
     

    You: So let's determine who can't use the search facility in our source control system and teach them...

    I've no idea why the PM needs to be concerned with such details. If he asked "do you lot know how to get it back if we delete it?" and received favourable answers, simply drop the code.



  • Glad I don't work for him.



  •  Now, this might be a difference in terminology, but over here we've got a PM and a technical architect. The PM is in charge of functional parts. A question like this, we wouldn't even have him in the loop.



  • @PleegWat said:

    The PM is in charge of functional parts. A question like this, we wouldn't even have him in the loop.
     

    I read "PM" as "Project Manager". The parts of the loop that would affect him are time, costs, benefits, drawbacks. I don't think he would be bothered with the question, just appraised of the answer.



  • @Cassidy said:

    Project Manager

    Indeed. But this is the project manager that wrote the original version of the software, alone, only to be promoted into the job. He still interferes with handles some of the technical aspects.



  •  Sound like Peter's principle in action. Judging by the other posts you made today you need to talk to this guy less. In my team the project manager isn't involved in low level technical decisions such as these.



  • Ah the standard idiot who doesn't understand how source control really works, and is too lazy to learn.



  • @configurator said:

    I then made a mistake: I told the PM I'm taking the code out. I should have just done it.

    ... as I'm sure everybody on your team except the PHB^H^HM would instantly agree. So what needs to happen now is the creation of a ghostly new developer called Peter Gibbons, whose login credentials are known to the entire team except the PM, and whose sole job it is to comb your tree for commented-out code, get rid of it, and check the changes back into the VCS at three in the morning. Because the anger that the PM will undoubtedly feel if he ever notices that some of his precious commented-out code has gone missing might induce him to learn how to read a commit log.



  • @configurator said:

    only to be promoted into the job.
     

    .. has he had any formal PM training? It sounds like he's having difficulty cutting the apron strings.



  • My response would be "Look, you're a PM. This doesn't affect your estimates or deliveries - but insisting on trying to tell us how to do our own jobs (wholly unconnected with your own) will.".

    If that doesn't work, dig out the felt tips and "amend" his Gantt charts until he gets the message...


  • Discourse touched me in a no-no place

    @Cassidy said:

    @configurator said:

    PM: Yeah, but nobody here knows how to find that.
     

    You: So let's determine who can't use the search facility in our source control system and teach them...

    I've no idea why the PM needs to be concerned with such details.

    Because that's what PMs do. I had one once that would list graphs in his weekly reports, showing % completion, % uncompleted, and another graph adding %completed and %uncompleted, so everyone knew that, I don't know, those two numbers added to 100%.



  • @Cassidy said:

    formal PM training?

    Hehehe, you have such a brilliant since of humor. Or naïveté.



  • @flabdablet said:

    @configurator said:
    I then made a mistake: I told the PM I'm taking the code out. I should have just done it.

    ... as I'm sure everybody on your team except the PHB^H^HM would instantly agree. So what needs to happen now is the creation of a ghostly new developer called Peter Gibbons, whose login credentials are known to the entire team except the PM, and whose sole job it is to comb your tree for commented-out code, get rid of it, and check the changes back into the VCS at three in the morning. Because the anger that the PM will undoubtedly feel if he ever notices that some of his precious commented-out code has gone missing might induce him to learn how to read a commit log.

    I was thinking of the exact same thing...What a twisted world we both live in!



  • @FrostCat said:

    @Cassidy said:

    @configurator said:

    PM: Yeah, but nobody here knows how to find that.
     

    You: So let's determine who can't use the search facility in our source control system and teach them...

    I've no idea why the PM needs to be concerned with such details.

    Because that's what PMs do. I had one once that would list graphs in his weekly reports, showing % completion, % uncompleted, and another graph adding %completed and %uncompleted, so everyone knew that, I don't know, those two numbers added to 100%.

    Perhaps taking out the code would reduce the line count to his boss, and then he'd get into trouble for low-productivity. He's probably just protecting his coders so cut him some slack!



  • @FrostCat said:

    @Cassidy said:

    @configurator said:

    PM: Yeah, but nobody here knows how to find that.
     

    You: So let's determine who can't use the search facility in our source control system and teach them...

    I've no idea why the PM needs to be concerned with such details.

    Because that's what PMs do.

     

    What - search for annotation in a source control system? Bit out of scope for managing a project, ain't it?

     



  • @configurator said:

    @Cassidy said:
    formal PM training?

    Hehehe, you have such a brilliant since of humor. Or naïveté.
     

    Yeah, I'm hoping that those mandated to fulfil a particular role may actually have had some training in it.

    I know, perfect world and all that. 


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.