assaultcube / AC

AssaultCube
849 stars 218 forks source link

Coding style suggestions #359

Open ac-stef opened 3 years ago

ac-stef commented 3 years ago

Please

Felix-The-Ghost commented 3 years ago

set your editor to not use tabs (there is no agreement on tab width, therefore tabs can not be used at all)

Could you expound on this please? (should I offer code in the future)

flowtron commented 3 years ago

Regarding "spaces vs tabs": The net is filled with this discussion, here are three semi-random picks from 10, 5 and 3 years ago:

  1. https://softwareengineering.stackexchange.com/questions/57/tabs-versus-spaces-what-is-the-proper-indentation-character-for-everything-in-e
  2. https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/
  3. https://insanelab.com/blog/notes/spaces-vs-tabs/
Felix-The-Ghost commented 3 years ago

Well, I don't see a strong reason to use one over the other. Frankly tabs seems better because it can vary in width to the preference of the viewer and is technically more concise, however if the majority of AC's codebase is already using spaces for indentation, I understand the need for consistency with existing code so I can respect that when submitting work to AC.