News for hackers. Stuff that matters.
Re:Block Comments Are a Bad Idea by chrismorgan on Wednesday October 11, 2017 @09:29AM (#15449532)
Put the comments at the end of the line, introducing line breaks if necessary:

  if (…) {
  } else if (…) {
  } else {  // description
  }
and

  void myfunc(int a,
              char *b, // optional
              ...)
I don’t program in C or C++, but when working with the Windows API I appreciate Microsoft’s source-code annotation language which leads to being able to indicate input and output parameters, and optional ones, so that you’d wind up with something like this:

  void myfunc(__in int a, __in_opt char *b, ...)
I don’t know how they’re implemented in MSVC, but I’m guessing they’re just empty #defines.
Re:Block Comments Are a Bad Idea by wruza on Wednesday October 11, 2017 @10:53AM (#15450244)
Sure, I’m aware of these methods; these are obvious. But my preference is to put else-comment that way, because its beauty makes me peaceful and calm when I look at it. At work I’ll do what PM expects, i.e. her/his [motivated] preferences, not mine (if you ask people what they’d like to do, work will be hardly a popular option at all, so no problem, it is consensus between being “busy” and having profit).