Hi,
I just had a quick search of C coding styles and found where I picked up that style …
https://en.wikipedia.org/wiki/Indentation_style
Whitesmiths.
I spent some of my early career tutoring students in embedded programming classes using C
and assembler. We used the Whitesmiths
cross compiler for the 8080. I ported bits of a C library from somewhere, prolly
fragrantly disregarding copyright, and we had students
writing C code on Intel development boards. Interrupts, basic device drivers, semaphores
and in the end a basic real time executive.
On 23 Jun 2025, at 12:06 pm, Larry McVoy
<lm(a)mcvoy.com> wrote:
On Mon, Jun 23, 2025 at 11:52:02AM +1000, Peter Yardley wrote:
Yes,
I hate the dangling brace I line my braces up with the associated code block ???
if (???)
{
blah blah blah;
}
I personally hate that, not sure if you are demonstrating how not to do it or
what?
I do
if (whatever) stmt;
or
if (whatever that is more complex) {
stmt;
stmt;
stmt;
}
I also do
if ((whatever is complex) || (or even more complex) ||
(something that wouldn't fit in 80 columns) {
stmt;
stmt;
stmt;
}
I've mapped ^A in vi to be that 4 space indent, for 4 decades.
The
if (whatever)
{
stmt;
}
is, I believe, GNU style and it just sucks. GNU C is awful. But when I
did the df/du/ls -h stuff I wrote it in that style, it's their house,
you abide by their rules. Fun fact, Stallman hated me so much he rewrote
that stuff so I wasn't in their version history.
.1.3.6.1.4.1.8852.4.2
Peter Yardley
peter.martin.yardley(a)gmail.com