Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Last active March 2, 2022 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coolaj86/f6850feb950365fa8f15df7a77092944 to your computer and use it in GitHub Desktop.
Save coolaj86/f6850feb950365fa8f15df7a77092944 to your computer and use it in GitHub Desktop.

K&R Style

  • Required (but not enforced) for JavaScript
  • Required AND enforced for Go
function kr() {
  // foo
}

Allman Style

NOT SAFE FOR JAVASCRIPT

function allman()
{
  // foo
}
function allman()
{
  return // implicit ;
  {
    // Automatic Semicolon Insertion has failed you!
  };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment