:: Re: [DNG] Starting outline for the …
Top Pagina
Delete this message
Reply to this message
Auteur: tito
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Starting outline for the DNG Safe Programmer Certificate
On Sun, 1 Aug 2021 07:56:18 -0400
Hendrik Boom <hendrik@???> wrote:

> On Fri, Jul 30, 2021 at 01:49:46PM -0400, Steve Litt wrote:
> > Josef Grosch via Dng said on Thu, 29 Jul 2021 15:32:05 -0700
> >
> >
> > >Another suggestion I have is to use the variable and method naming
> > >convention that java uses. I like the way it looks and I think camel
> > >case is more readable than snake case.
> >
> > This reminds me of something not yet in the outline. The originating
> > author should place, in comments, near the top, his or her syntax
> > conventions including naming conventions, brace placements if not
> > Python, spaces or tabs.
> >
> > I'm hidiously guilty of using violating my own conventions (or not
> > having any), so I should make that document at the start of a project.
> > Matter of fact, I should make it BEFORE my next project. Naturally, one
> > such stylesheet must be made for Python, another for C, etc.
> >
> > In an ideal world, here's how I'd do C blocks:
> >
> > if(mybool)
> >    {
> >    do_my_stuff()
> >    }

>
> I tend to use
> if(mybool)
>   { do_my_stuff();
>     do_other_stuff);
>   }


Hi,
I really prefer

if (mybool) {
do_my_stuff();
do_other_stuff);
}

for the rule of least vertical screen usage (same as yours)
and the brace and the if on the same indentation level
make it clear where the conditional block of code stops.
Also for one liners this form saves space

if (mybool) { do_my_stuff(); }

but keep the braces if you or others need to add more code
later.

Just my 2 cents
Tito

>
> I really believe matching braces should be on the same line, or,
> failing that, at the same level of indentation; i.e., above one
> another.
>
> And I'd like the compile to warn me of deviations from that.
>
> -- hendrik
>
> >
> > However, I do it the way Vim preformats for me, to make my life easier:
> >
> > if(mybool){
> >    do_my_stuff()
> > }

> >
> > #ifndef AUTHOR
> >    char * AUTHOR = "SteveT"
> > #endif

> >
> > AUTHOR
> >
> > Steve Litt
> > Spring 2021 featured book: Troubleshooting Techniques of the Successful
> > Technologist http://www.troubleshooters.com/techniques
> > _______________________________________________
> > Dng mailing list
> > Dng@???
> > https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng