Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you follow the naming convention of the original programmer?

If you take over a project from someone to do simple updates do you follow their naming convention? I just received a project where the previous programmer used Hungarian Notation everywhere. Our core product has a naming standard, but we've had a lot of people do custom reporting over the years and do whatever they felt like.

I do not have time to change all of the variable names already in the code though.

I'm inclined for readablity just to continue with their naming convention.

like image 216
wonderchook Avatar asked Nov 12 '08 14:11

wonderchook


2 Answers

Yes, I do. It makes it easier to follow by the people who inherit it after you. I do try and clean up the code a little to make it more readable if it's really difficult to understand.

like image 115
kemiller2002 Avatar answered Sep 20 '22 13:09

kemiller2002


I agree suggest that leaving the code as the author wrote it is fine as long as that code is internally consistent. If the code is difficult to follow because of inconsistency, you have a responsibility to the future maintainer (probably you) to make it clearer.

If you spend 40 hours figuring out what a function does because it uses poorly named variables, etc., you should refactor/rename for clarity/add commentary/do whatever is appropriate for the situation.

That said, if the only issue is that the mostly consistent style that the author used is different from the company standard or what you're used to, I think you're wasting your time renaming everything. Also, you may loose a source of expertise if the original author is still available for questions because he won't recognize the code anymore.

like image 26
Jonathan Adelson Avatar answered Sep 19 '22 13:09

Jonathan Adelson