How do you think about the flooding of bracket?

Unknown W. Brackets unknown at simplemachines.org
Thu Jun 15 21:15:55 PDT 2006


Sometimes I have used something like this:

struct ObviouslyStaticStruct
{
static:
    // ...
}

Where everything in the struct is static.  But I don't do this often, 
mostly it's a poor man's namespace, e.g.:

struct constants
{
static:
    const int port = 21;
    const char[] name = "ftpd";
}

writefln(constants.name);

But, no, I'd not use them when it didn't apply to EVERYTHING, that's 
just too weird.  They have their uses, though, in my opinion.

-[Unknown]


> The only non-OT response, thanks!
> 
> I think this is a serious problem, a language should be helpful to produce 
> readable, maintainable codes, and,  restrict the production of non-readable, 
> non-maintainable codes.
> 
> 
> "Derek Parnell" <derek at psych.ward> 
> ??????:1simyhs9tx5zh.p1oewy5visyw$.dlg at 40tude.net...
>> On Thu, 15 Jun 2006 17:37:41 +0800, Boris Wang wrote:
>>
>>> First, now, in a function of D, we can make netsted structure, nested
>>> function and versioned code block, so much brackets, which are not code
>>> block ,in the code sequence.
>>>
>>> Second, the use of colon and bracket for private/public, static and 
>>> version
>>> keyword, make the judge of access level and storage type is difficult.
>>> ...
>>> How do you think about all these ?
>> I agree that the colon format for these qualifiers can lead to
>> hard-to-maintain code because the scope of them is not as obvious. For 
>> that
>> reason alone I avoid using them. I only use the single statement format 
>> and
>> the braced format...
>>
>>  private int someVar;
>>
>>  static {
>>     int foo;
>>     int bar;
>>  }
>>
>>
>> -- 
>> Derek
>> (skype: derek.j.parnell)
>> Melbourne, Australia
>> "Down with mediocrity!"
>> 16/06/2006 11:49:54 AM
>>
> 
> 



More information about the Digitalmars-d mailing list