The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,808 other followers

Keep consistent formatting – via: The Oracle at Delphi: Code is the language, formatting is the dialect.

Posted by jpluimers on 2017/06/13

When this developer finally went to commit his/her changes, they had also reformatted most of the codebase into his/her preferred coding style/format. This was even for files for which no other changes had been made!Imagine the next developer coming along and pulling down the latest changes from the source control system and trying to merge them into their own local changes.

Because of all these code-format-only changes, it became nearly impossible to merge any changes without going through every conflicted file and painstakingly reconcile the changes.

I’ve seen this happen on a few projects where there have been sequential single developers some of which reformatted the whole code base within a few days of taking over.

It made it impossible to perform a “blame” or proper history tracking of feature changes.

That increased the cost of maintenance a lot.

I’ve been on several teams that enforced a pre-checkin standardised formatting of the code. Only rarely that causes problems, usually it’s a blessing to as it makes for a consistent formatting of the code-base where it is much easier to cut the crap and focus on what the real problem is.

–jeroen

Source: The Oracle at Delphi: Code is the language, formatting is the dialect.

2 Responses to “Keep consistent formatting – via: The Oracle at Delphi: Code is the language, formatting is the dialect.”

  1. Sebastian Jänicke said

    If one is not mentally capable of working with the standard formatting of a language, one has chosen the wrong profession if one is working as developer… it is as simple as this.
    I just write code automatically in nearly the same way the Delphi formatter would format it, without the need to think about it. I’m just used to it. So we can happily format whenever we want and near to nothing should change.

    Ok, we make one exception: In the days of widescreens a limit of 80 characters per line is not really useful anymore… so we use 130.

    • KMorwath said

      You may be surprised about how many developers with their own formatting styles are there. While those “deeply involved” into a language will soon gravitate towards the “standard” language formatting (although for C there is more than one, for example), those just programming for a living, if learning alone or in small, unstructured companies, will often develop their own “ugly” standards, and it may be very hard to make them adopt a company standard – there are some truly stubborn, especially when you don’t have the authority to “punish” them, and the manager which has it don’t want issues with HR and thereby leaves you to clean up the mess….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: