Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consistency vs Design Guidelines

Tags:

coding-style

Lets say that you get involved in the development of a large project that is already in development for a long period ( more than one year ). The projects follows some of the current design guidelines, but also has a few different, that are currently discouraged ( mostly at naming guidelines ).

Supposing that you can't/aren't allowed to change the whole project:

What should be more important, consistency, follow the existing ones and defy current guidelines or the usage of the guidelines, creating differences between modules of the same project ?

Thanks.

like image 719
Adrian Fâciu Avatar asked Jan 22 '23 03:01

Adrian Fâciu


1 Answers

Generally, I would favour consistency. But sometimes there are strong reasons for preferring the evolved style. Perhaps the initial standards were found to be ineffective, or simply imposed too great an overhead. It may be excessive to go back and retrofit the changes but to continue to follow what is now known to be a bad practice in the name of consistency I see as a bad decision.

A specific example: 30 person, three year project. Our standards sai to put some particualr documentation before each method (don't remember the details, think it was a list of messages that could be logged or some such.) This was found to be a lot of work to maintain and was never used, because we had a code munger to produce the definitive list of message origins. We simply stopped adding the information to new methods, no time to got and tidy the entirity of the code base.

like image 53
djna Avatar answered Jan 30 '23 13:01

djna