class x is hidden by y

bearophile bearophileHUGS at lycos.com
Thu Oct 7 13:04:15 PDT 2010


Simen kjaeraas:

> Yes, if one is to slavishly follow the rules set out by someone else.
> People may have other coding standards in their own homes.

How many serious Python packages do you see around where methods are named in CamelCase? How many serious C# libraries do you see around written with lowercase methods, or lowercase class names?

The D language doesn't enforce identifiers case conventions, and in the end you are free to do what you like. But you have to push your nose a bit outside your box, when you program in Python, C#, D and so on your "home" is the community.

It's good to have basic language-wide style used by the whole community, it simplifies code written by others. Think about using CamelCase in your Python project. Then you download modules from all places from the net, and add them to your Python program (this happens often in Python). 

If one module uses names_with_underscores, another module uses camelCase, and another module uses alllowercasewithnospaces then at the end your project will look like more like an Harlequin, harder to read, confusing. But Python/C# devs are not that stupid, they follow things like the Python PEP8, that says to use class names with an Upper case starting char, methods as lower_case, and so on.

Freedom is good, but in this case its price is too much high, it's not worth it. Stick with the naming convention used by each modern language, you will have less problems in integrating code written by other people, and your code will turn up to be better and more readable by the community.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list