Hacker News new | comments | ask | show | jobs | submit login

semi-off topic, but the guy who wrote the style guide needs a little more experience in the real world. Not using braces is an accident waiting to happen.

https://github.com/flutter/engine/blob/master/sky/specs/styl...

if a flow control structure's statement is one line long, then don't use braces around it, unless it's part of an "if" chain and any of the other blocks have more than one line. (Keeping the code free of boilerplate or redundant punctuation keeps it concise and readable.)

For example,

  if (children != null) {
    for (RenderBox child in children)
      add(child);
  }
...rather than:

  if (children != null) {
    for (RenderBox child in children) {
      add(child);
    }
  }



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

Search: