Skip to content
baldurk edited this page Apr 16, 2014 · 2 revisions

I'm not particularly fussed about coding style honestly. I'll be the first to admit that I'm not particularly consistent when it comes to the code I've written, and I tend to be pretty tolerant about most of the common variations in personal preference or style as long as they are readable (most are, and unreadable code tends to come from things other than brace placement or naming conventions).

Try to match the code that you're modifying if you're just making a small change, and don't mix and match wildly different styles in the same place. Don't go reformatting tons of code when you're only changing one section, but if you're changing a section no-one will complain if it doesn't precisely absolutely match what it was before.

I reserve the right to ask for some reformatting if something bugs me in a pull request :).

A few notes:

  • Put OS-specific functionality in the relevant OS implementations. Most code should be agnostic.
  • Use wide strings for filenames, text, etc where we want to support unicode. Remember wchar is not a guaranteed size (like size). Currently we serialise wchar strings but we should convert to utf8. Use %hs or %ls where necessary to print strings, never use bare %s or %S as windows' implementation is messed up and it can cause bugs

Clone this wiki locally