Fatal flaw in D design which is holding back widespread adoption

bearophile bearophileHUGS at lycos.com
Tue Mar 30 14:59:34 PDT 2010


Steven Schveighoffer:

>For instance, all my C# (and D) code uses lowerCamelCase for methods and properties.<

That's OK for D code, but I can assure you people will not appreciate your C# code, you will find people that complain if you want to give/share/show them your C# code (probably they will not complain a lot because their IDEs are able to convert your wrongly formatted C# code back to the standard way in a short enough time).


>I think it is important that the same style be kept within a project,<
>Let's not make this into a big deal, unified style is not that important in the grand scheme of things.<

You have missed an essential detail of my post. D and Python have modules. A well designed module system allows something very important, that's mostly absent in units of C/C++ code.

If you go here  http://pypi.python.org/pypi  you can find tons of Python libraries, they are often single modules, and other times they are packages. The success of languages like Python partially comes from the fact that you can take one of those modules (or packages) and put it into your project, and often it just works and looks almost like a part of it.

If everybody writes Python code following a common style, then the "project" becomes the whole ecosystem of the language, and not just your project. You need less time to read code written by other people, you save the time needed adapt yourself to their style, and when you compose a python project assembling modules and packages taken from (for example) pypi, your resulting project doesn't look like a patchwork of different styles!

So having a common style has some importance in the grand scheme of things for a language with modules that hopes to build a community of shared modules. If you think some more about it I think you will agree with me. This is something that Guido Van Rossum has understood lot of time ago (and I think Walter can agree).

A shared style is not necessary to build a healthy community of shared modules (see Perl CPAN, where coding style is not so uniform), but it helps.

Bye,
bearophile



More information about the Digitalmars-d mailing list