# HG changeset patch # User Rob Landley # Date 1400541875 18000 # Node ID 00938a3d095501bd6d2fbf615f9e794568f831e6 # Parent 0d33dd5f537e941ef484f110b3f3a05ee726de7f Fluff out the coding style section, but the result was a bit big for the start of code.html, so move it to design.html. diff -r 0d33dd5f537e -r 00938a3d0955 www/code.html --- a/www/code.html Sun May 18 14:05:13 2014 -0500 +++ b/www/code.html Mon May 19 18:24:35 2014 -0500 @@ -14,15 +14,9 @@ more explicit is preferable to being clever enough to outsmart yourself: don't be so terse your code is unreadable.

-

Toybox source uses two spaces per indentation level, and wraps at 80 -columns.

- -

Gotos are allowed for error handling, and for breaking out of -nested loops. In general, a goto should only jump forward (not back), and -should either jump to the end of an outer loop, or to error handling code -at the end of the function. Goto labels are never indented: they override the -block structure of the file. Putting them at the left edge makes them easy -to spot as overrides to the normal flow of control, which they are.

+

Toybox has an actual coding style guide over on +the design page, but in general we just +want the code to be consistent.

Building Toybox

@@ -1156,7 +1150,7 @@

Directory generated/

All the files in this directory except the README are generated by the -build. (See scripts/make.sh)

+build. (See scripts/make.sh)