Reformat - raisercostin/software-wiki GitHub Wiki

Topics

Tabs vs. Spaces

Advices

  • Always use spaces in original files. The formatting is kept this way. In html/javascript this might generate an increase in the filesize but don't optimize for that.
  • Use the convention to always convert tabs to 2 spaces that will allow a lot of levels of imbrication.

End Of Lines - EOL

Conventions

Depending on the Operating System the end of line (EOL) is encoded with different characters.

  • windows (CR+LF)
  • linux (LF)
  • old mac (CR)

Parts - Characters

Symbols

  • \n might refer to \r\n in some cases - end of line for windows
  • \n refers to just LF on linux

Advices

  • Make a convention to use across your projects one specific type like the windows or linux convention
  • Configure git with autocrlf = false: Intro to Git to disable automatic correction at commit/checkout time

Resources

End Of Files - EOF

Encoding

See https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/

  • UTF8
  • Ascii

Code Formatters

  • Java
  • Xml

Code Validators

  • Java
  • Xml

Resources