• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Consistant Code - Valid Request Or Violation Of Freedom?

azoundria

New Member
So after removing inactive and high risk developers, I have a few developers left.

One is very skilled and trustable, and has even contributed many insights to the project. However, we've run into a lot of friction lately because I've decided with the new version of our site to adopt a consistent coding style.

I believe I have a valid argument that consistent coding is easier to understand over the long-run. Even if you are more used to a different coding style, over time you would adapt. Rather than having to adapt to multiple coding styles, once you adapt you can understand ALL the code faster.

Yes, when I mention coding style, I am mainly talking about the whitespace in a program. I am a strong advocate of whitespace, and using it to visually group things together. For example, between a method I like two lines, to help visually distinguish between the gaps in logical groups of statements.

I also like spaces around operators (6 == 6) instead of (6==6). It's more clear that the == is one unit, as opposed to two separate equals signs. Rather than thinking 'hey is this two equals or a different operator', then ruling out the first scenario as not logically sound, you can instantly know it's the second scenario because of the spacing.

Another example, with braces, some like to put them on the next line, where they appear just as visually separate from the statement to which they belong, as the statement on the following line.
if (6 == 6) {
versus
if (6 == 6)
{
or
if (6 == 6){

There are literally hundreds of books on effective coding style, and even more websites, blogs, etc... about it. I'm not trying to say mine is the best way, and should be used for everything. It's just that I already coded 95% of the site this way.

I believe I have a valid argument for consistency. Or does someone here think that multiple developers all working in their own style, when they heavily depend on understanding the coding of others, is a good idea? What happened to the old version of the site was that even with the variance in my own coding style, it got to the point I couldn't understand it enough to make updates I needed to (and that's just with me.)

That said, I've been discussing this with the volunteer for the past 2 weeks and more. He's now highly demotivated and behind on numerous projects, including our registration system (nobody can sign up because of this), but he's still not budged. Usually I'm pretty good with human relations, but this is very frustrating.

Previously this volunteer was slated to become our head of development. This role would involve helping to supervise and organize all the development. Unfortunately, I don't see it as a good long-term strategy to ignore the issue of code style. I see a lot of head ache for a lot of developers in the future.

He has said he doesn't mind me changing all his coding into the correct format afterwards, but this turns out to take away pretty much all of the time savings in having his help. Me coding versus explaining to him everything I need, helping him learn the system (he has a fairly decent grasp now), having to fix details which are important later, bugs, adding comments, understanding, and now formatting. Yet I know that with the help of others I can do so much more on this project not limited to my own time.

I don't want to have to 'micromanage' and watch anyone to make sure they code properly. I would just like to have clean, consistent code on the site.

I want to know if I'm justified in this to feel how I do - if it's fair to expect someone to adjust their coding style. I dare say my university professors have done this to me dozens of times. And what exactly you might do in my case.
 
Last edited:
Consistent coding style is incredibly important when you have a group of developers working on something. Take THT for example, most of the coding done by Jonny/Jimmie/Kevin/myself is setup in a fairly consistent manner. Now, there are a few things that vary in this such that I can usually tell who wrote what piece of code, but I can easily look at any of the code and determine what it's purpose is very quickly. I'd say consistent style is even more important in an OOP-style environment, as everyone should be referencing classes in a consistent manner or things will get out of hand very quickly.

In addition to THT, I've found its fairly easy to adjust my coding style based on what project I'm working on for this group or that. It is not at all absurd for you to expect your developers to adapt, and if they aren't or are having trouble it is highly likely that they are being stubborn about it, if only subconsciously. It might help to let them know that this change in coding style isn't saying anything bad about them as a coder, but is a necessary thing for the good of the team. I've found that coders can be touchy people ;)
 
Last edited:
Well this is where some other things come into play. If you are the person in control, then set down rules on how you want it. Then have a system where code is review before it is integrated. Have a head programmer, who can help you make the decisions. Use a version control system. There are multiple different things you can do just some suggestions.
 
Back
Top