Indenting standards religions K&R, whitesmiths etc

Cecil Ward cecil at cecilward.com
Thu Jun 1 14:22:57 UTC 2023


On Thursday, 1 June 2023 at 09:37:43 UTC, Dukc wrote:
> On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote:
>> I wanted to ask how some of the leaders of our group feel 
>> about D indentation standards. `i realise that this causes 
>> some religious fervour in C. I could be in trouble here 
>> because in all my years at work, we never used K & R ‘one true 
>> brace style’ indenting, with the house style I’m used to being 
>> more like whitesmiths. Wikipedia explains this better. 
>> Something like the following below.
>>
>> So my question: would I get lynched for the following? (below)
>
> Check out this module from me: 
> https://github.com/dukc/nuklearbrowser/blob/master/source/nuklearbrowser.d
>
> Plus similar style in most of my posts and bug reports. I'm 
> still alive :D.
>
> Your code is your code. There, you may do as you wish. You have 
> to aknowledge that an esoteric style may make it more difficult 
> to read for some, but we're not lynching people for other 
> factors of code readability either. Brace style is no different.
>
> Plus, what brace style is considered readable by the majority 
> is a culture issue. There has to be some way to challege the 
> established culture. If you don't exercise your power to code 
> as you wish, someone will make your choice for you. Coding 
> culture, or even culture in general, cannot develop if people 
> never challege the present status quo.
>
> When you're coding with others, though, then you should obey 
> the style guideline of that project if there is one. Even there 
> you're as entitled as anyone for an opinion what the style 
> policy should be (and to whether there should be style policy 
> at all), but you then should (usually) obey the decision 
> regardless whether it's the one you were advocating for.

Agree completely. You are not a criminal though because your 
closing braces are not indented out with the block they’re 
closing as I do.

I find K&R hard to read even though we see it everywhere, or 
variants of it. I do wonder if my style in that earlier post 
hurts normal people’s eyeballs a lot. ;-)

I’m told that Irish speakers can’t understand Scottish Gaelic on 
the radio a native speaker said to me that ‘it’s just a noise’. 
But as a ScG learner myself I can understand some spoken Irish 
even though I’ve never really studied the modern language (only 
the stuff of more that 1100 yrs ago.) So the pain isn’t 
symmetrical.


More information about the Digitalmars-d-learn mailing list