0

Some background info

Prior to my employment, two people worked in my position previously. One of them wasn't liked very much and the other wasn't very good at his job (as stated by my supervisor and other employees). They were tasked with developing a new website for the office. They never quite finished the project before leaving to go to college.

A couple months later, enter me. I'm tasked with "cleaning" up the code. It took approximately 2 minutes to realize this wasn't going to be an easy task. The code was horribly written. We're talking random tabs and spaces in places they don't belong, hundreds of lines of CSS code embedded in the HTML files instead of being put in separate stylesheets. Poor and confusing naming conventions and confusing folder structure.

I decided to back up all the contents in to a single folder and start rebuilding it from scratch. I did this for about a week so I had a presentable project (trying to keep everything as close to the original as possible) before asking my supervisor which version they liked more. They very much approved of my version after inspecting both for some time and I was now tasked with developing the new website based on my version.


The Dilemma

We're now nearing the release of the website to the public. I've written thousands of lines of code from the ground up keeping only what was necessary from the original. I was told I could comment crediting myself as author in the files I wrote.

Today I was told that one of the previous employees would be coming back for the summer and I need to remove all the comments crediting myself as author in my code not to upset this returning employee. I don't agree with this but obviously complied anyways as I'm in no position to challenge the decision.

Should I be allowed to leave the comments crediting myself for my work?

closed as off-topic by IDrinkandIKnowThings, JasonJ, gnat, Draken, Chris E Apr 21 '17 at 13:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking advice on company-specific regulations, agreements, or policies should be directed to your manager or HR department. Questions that address only a specific company or position are of limited use to future visitors. Questions seeking legal advice should be directed to legal professionals. For more information, click here." – IDrinkandIKnowThings, gnat, Draken, Chris E
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 12
    No. If you're doing work for the company, no one should be writing comments taking "credit" for any particular files. – Brandin Apr 19 '17 at 17:34
  • 1
    Are you really willing to risk your job or your review over this? – IDrinkandIKnowThings Apr 19 '17 at 17:37
  • 11
    Never, ever, ever, ever have I left anything more than a modification timestamp (and not by choice then) with my name on it in a piece of code. If it's "Don't change this or it'll explode -- @Jake" then yes, it's a good comment. If it's "Created and Written by @Jake" then no. Never. Nu0uh. Mainly because someone is going to edit that in the future, then you're taking credit for work that isn't yours. Secondly, it's just personal ego-massaging. You work for someone, the product is theirs, your contribution was already noted by you getting paid for it. – SliderBlackrose Apr 19 '17 at 17:45
  • 5
    When I'm writing code, I'll usually put my initials on it but that's not for "credit". I put a modification date, my initials and (if necessary) a reason for the change I've made. That's only to help whoever comes behind me. If you're using source control like you should, attribution of that nature is unnecessary – Chris E Apr 19 '17 at 17:54
  • "random tabs and spaces in places they don't belong, hundreds of lines of CSS code embedded in the HTML files". It should take you about a day to fix those problems in an app thousands of lines long. – DJClayworth Apr 19 '17 at 18:18
16

You do what your boss says. Author comments are only used for "Blame" anyway.

You should be using a version control system, and the logs of the VCS will show everything everyone did, anyway. There are more tools to parse VCS logs out there than you can shake a stick at.

And if this kid is coming back for the summer - Who cares? They'll see what you did, and your comments should explain why. The fact you were assigned to clean it up indicates that your management already respects your judgment over theirs.

The fact that your manager cares means this is more political than practical, so you probably want to just go along with this.

When the kid comes back, just go over the changes, and explain why it is the way it is, now. Don't deride what they did. Just explain why you did it your way, and ask if they need any help "working within the system." Keep any emotion out of it.

Remember - we ALL wrote terrible code when we started out. You're just further down the road.

  • 5
    Remember - we ALL wrote terrible code when we started out Nonsense. All my code was perfectly formed, as if immaculate conception took place! Snicker – SliderBlackrose Apr 19 '17 at 19:38
8

"Author" comments in source code are truly a real waste of time in a team setting where lots of hands are going to be modifying the code. In a professional setting, the source control system tags who's done what. For a web site, the end-user doesn't care who wrote the code, but only that it works to satisfaction.

In the long run, it's probably best to put ego and getting credit (smile) aside and focus on what actually makes money for the business. If you're writing great code, nobody is going to question who's doing what, because the work will speak for itself.

3

I guess to find a final answer, you would need to have a lawyer look into your contract.

But assuming it's not different from 99% of the other contracts, then "credit" is just a nice thing to say. The code your wrote on company time belongs to your employer. Nobody else. Your name on it is purely cosmetically and probably only allowed inside your company anyway.

From a company perspective, having your or your colleagues name on it is both equally superfluous. So "should you be allowed" is something that your manager can have an opinion on. Like "should he get a cookie" or "should I smile". In the end, it's meaningless. Your manager will probably weight your unhappiness against the other guys unhappiness and make a decision that's in the company's best interest.

3

You have been clearly told to remove the comments, so whether we think it should be "allowed" is immaterial. If you have concerns about your name being removed from the comments, you should raise them with your manager. If you comply with what they ask of you without saying a word, they wouldn't know (or at least they can pretend to not know) of your concerns.

If you decide to take this up with your manager, focus on how this affects you (for example, how your efforts may not be easily visible), or even better, how it affects the project (for example, people having questions will contact the other person who has to bear the additional overhead of redirecting to you). You should not ever badmouth the other person to have your way.

2

Should I be allowed to leave the comments crediting myself for my work?

You could ask, but that's not your decision to make. You don't own the code - your company does.

If you had written the code on your own, and then sold it to your company, you could have sprinkled the comments with your name as many times as you might like.

But this code was written for your company, and they get to decide what to do with the comments, and any other part of it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.