Changes between Version 50 and Version 51 of Coding_Conventions
- Timestamp:
- Aug 16, 2020, 12:45:45 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Coding_Conventions
v50 v51 14 14 15 15 == Common == 16 17 - Use the US variant of English when choosing variable names. For example, use 'color' instead of 'colour'. 16 * Use the US variant of English when choosing variable names. For example, use 'color' instead of 'colour'. See also the [[EnglishStyleGuide#Englishspelling|English style guide]]. 18 17 19 18 … … 252 251 253 252 254 === Misc ===253 === Miscellaneous === 255 254 * In header files, avoid `#include` and use forward declarations wherever possible. 256 255 … … 430 429 431 430 432 == JSON ==433 * Basically follow the JS formatting conventions 434 * When on the same line, insert spaces after `{`, and `:` and before `}`, but not after `[` or before `]`; e.g. `{ "foo": "bar" }` and `["foo", "bar"]` 435 * Use tabs for indentation, not spaces 431 == JSON == 432 * Basically follow the JS formatting conventions. 433 * When on the same line, insert spaces after `{`, and `:` and before `}`, but not after `[` or before `]`; e.g. `{ "foo": "bar" }` and `["foo", "bar"]`. 434 * Use tabs for indentation, not spaces. 436 435 437 436 … … 439 438 * All XML files should start with 440 439 {{{ 441 <?xml version="1.0" encoding=" utf-8"?>440 <?xml version="1.0" encoding="UTF-8"?> 442 441 }}} 443 442 and be UTF-8 encoded (preferably without a BOM but that doesn't really matter). 444 445 443 * Empty-element tags should be written without a trailing space: use `<foo/>` or `<foo bar="baz"/>`, not `<foo />` nor `<foo bar="baz" />`. 446 447 444 * Indent using whatever the similar existing XML files use. (Usually two spaces; sometimes four spaces, or tabs, etc.) 448 445 … … 464 461 }}} 465 462 * File extensions for shaders: 466 467 468 469 463 * `.fs` - fragment shader 464 * `.vs` - vertex shader 465 * `.gs` - geometry shader 466 * `.cs` - compute shader 470 467 * All GLSL files should start with right [[https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#Version|version]]. 471 468 {{{