Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

About the C++ version: You have to be an absolute weirdo to (sometimes) put the opening brace of functions on the same line, but on the next line for if and for bodies.




I think there was a name for that brace style? It seems silly, but leaving c++ development after decades for a variety of reasons, it turned out a standard formatting tool was one of my favorite features.

For mixing styles like that?

  int myFunc(int foo){
      if (foo > 42)
      {
          frobnicate();
      }
  }

I was getting it confused with gnu style, which indents braces for control flow but not functions



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: