Re: folds and formatting




Bill Pursell wrote:
For several years now, "folding" has become more and more
common in text editors. That has had an affect on my
commenting style. For example, the appealing layout:

int
foo(void)
{
/** Brief explanation of foo.*/
...
}

has now changed to:
int
foo(void)
{ /** Brief explanation of foo.*/
...
}

I find the second layout ugly, but when you fold based on brackets,
the comment remains visible, while the comment in the first layout
gets hidden in the fold. Similarly,

if (expr) {
/* brief comment*/
statement;
}

Is now more convenient to write with the comment on the line with
the open brace.

I'm curious to know how folding is affecting people's sylistic
conventions.

I can't really think of where this belongs (perhaps comp.programmer),
so I'll just reply to it instead of complaining about your
offtopicness.

I have always used vi, and continue to do so. All of my folding text
editors (Notepad++ when I'm on Windows) allow me not to fold, and so I
don't. My style remains the same regardless of text editor trends.

Folding is only useful for when you need to scan for functions;
comments explaining the purpose of a function belong above the header,
and so won't be folded anyway.

.



Relevant Pages

  • Re: folds and formatting
    ... common in text editors. ... commenting style. ... My preferred convention is: ...
    (comp.lang.c)
  • Re: a question regarding
    ... I would very much like to see the ABI change happen, and the first step has been done already as part of the MAC work. ... By changing the size of a field in a data structure, you may change the layout of the structure, and hence the offset of other fields. ... On i386, the change from int to size_t doesn't modify the ABI, as both int and size_t are 32-bit. ... This is why DES and I have been discussing this change as requiring kernel compatibility code, which would provide new system calls working with the new layout, and retain old system calls working with the old layout. ...
    (freebsd-hackers)
  • Re: a question about private access
    ... > * dummy class with the same layout. ... solution will be highly specific to using BCB as the compiler. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Programming careers
    ... You seem to be saying that because editors allow free-form text, ... no defence at all for layout dependent syntax; ... The implication of your argumnent about how readable layout cannot be ... non-layout dependent programming language. ...
    (rec.arts.sf.composition)
  • Re: Defining Slide Layout in VBA using a variable
    ... You need to convert the ppLayout* constants that you get ... as string to their int values and pass it as second argument. ... attribute on my Slide node called "layout". ... For Each SlideNode In SubjNode.childNodes ...
    (microsoft.public.powerpoint)

Loading