Jul 13, 2008

Code policies?

I was thinking the other day about how much efforts does it take to strictly follow your company code policies.
They are saving time for sure, but they are also wasting time.

First of all the developer needs to think about the policies all the time. This districts him/her from the real problems.
Second - after the task is completed the developer again needs to check if his / her code follows the code policies.
Third - if there is a code review - the code reviewer will also need to check if there isn't a problem with those code policies, class by class, member by member.

Some of the rules are very very foundamental as for example not to reference the DataAccess Layer from the User Interface Layer.
Other are company level rules - such as
naming conventions, using some classes on some places and not using some classes on some places. Also - using your project util classes instead implementing the same functionality in your class.

While some of the things aren't very easy to note in a code, other are obvious. And while some of the things aren't very easy to automate via AddIn or external program, other can be easilly automated.

In my opinion the developer should be focussed develop some more useful functionality, instead thinking about which rule will he / she broke.
Please note that by writing the above sentence I am not saying - "Drop the code policies!", but "Automate the code policies!". If I had some tool to check if I violate a rule while writing code, I will rewrite my code in order to satisfy this rule. But after I don't have I need to think about those rules while developing, which districts me from what I need to achieve.

I would really appreciate if you drop a comment on the following question(s):

"Does the code policy bother you? Does it take from your time? Does it districts you?"

Thanks in advance!

2 comments:

Veselin Kolev said...

In my opinion the good code convensions are a good thing - the only way more than one developer to work on one project and the code to look as it is written by only one guy. This helps everybody which are supposed to understand this code (i.e. the devs from this company) to understand it easily. A good code convension should be an inspiration and not a problem for the good developer because it should try to make the developer's code more readable, extensive, matching the current best practices, etc. And yes - there is an overhead while one gets to the new practice, but the benefits are much much more.

A good topic!

Павелъ Дончевъ said...

Thanks, Vesko!

I am really sorry that only me and you participate in this discussion. My blog is not very famous so for now it will be this way :).

I have another post for you on this topic
here.