Basics (coding guidelines)

From ds-ea wiki

Jump to: navigation, search


These Information is very basic stuff, how long a line should be, which kind of indents should be used, what encoding is preferred..

Contents

Encoding

ALWAYS use some kind of unicode say, UTF-8. Ignoring utf-16 for the time being safes compatibility issues, and should not be required for quite some time. For those using editors that care about it, please don't use a BOM for it confuses quite a bit of tools.

Line feeds

Simplistic: unix style - \n. Any software one possibly could use to write code is supposed to support any line breaks; Using only the newline character will work best for almost anything. Also remember to use this in any document software creates as well as any (network)streams.

Line length

Several folks tend to wrap around 80 characters, which is the basic length of shell windows. Since most users even have longer shell windows today and long commentaries and properly indented code requires a lot of space, we keep our wrapping around 100 - 150 characters.

Indents

We always indent in full tabs. Everything.

That not only enables each user to use their own visual representation (length) of a tab (which is 4 spaces for us), but also to do proper output as in html, whithout confuscating the source itself (use \t).

Please continue to read the Indent Guide .

Personal tools