Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the strangest coding standard rule that you were forced to follow? [closed]

Tags:

coding-style

People also ask

Are coding standards necessary?

Coding standards are important for software developers for several reasons: 40% - 80% of the total cost of software is spent on its maintenance. Software is almost never fully supported by its original author. Coding standards improve software readability by allowing developers to understand new code faster and better.


I hate it when the use of multiple returns is banned.


reverse indentation. For example:

    for(int i = 0; i < 10; i++)
        {
myFunc();
        }

and:

    if(something)
        {
// do A
        }
    else
        {
// do B
    }

Maybe not the most outlandish one you'll get, but I really really hate when I have to preface database table names with 'tbl'


Almost any kind of hungarian notation.

The problem with hungarian notation is that it is very often misunderstood. The original idea was to prefix the variable so that the meaning was clear. For example:

int appCount = 0; // Number of apples.
int pearCount = 0; // Number of pears.

But most people use it to determine the type.

int iAppleCount = 0; // Number of apples.
int iPearCount = 0;  // Number of pears.

This is confusing, because although both numbers are integers, everybody knows, you can't compare apples with pears.


No ternary operator allowed where I currently work:

int value = (a < b) ? a : b;

... because not everyone "gets it". If you told me, "Don't use it because we've had to rewrite them when the structures get too complicated" (nested ternary operators, anyone?), then I'd understand. But when you tell me that some developers don't understand them... um... Sure.