

Ask HN: Which coding guidelines do you use? - dutchbrit

Always interesting to see what code guidelines people use in what language.<p>Personally, I use the following for PHP:
Basic Coding Standard: https:&#x2F;&#x2F;github.com&#x2F;php-fig&#x2F;fig-standards&#x2F;blob&#x2F;master&#x2F;accepted&#x2F;PSR-1-basic-coding-standard.md<p>Coding Style Guide: https:&#x2F;&#x2F;github.com&#x2F;php-fig&#x2F;fig-standards&#x2F;blob&#x2F;master&#x2F;accepted&#x2F;PSR-2-coding-style-guide.md
======
nkuttler
Oh, it's a question about PHP... Anyway, I either use the one that's official
for the language, the one that applies to the project I'm just working on, or
the one that seems the most sensible to me. For the latter I normally check a
few very popular projects for the language and see what they agree on.

------
_random_
You don't have to follow guidelines if you are using a modern IDE. Guidelines
should follow your code. VS 2012 + ReSharper.

------
agoandanon
K&R braces in all things. Because that is the One True Way to do it.

------
chewxy
PEP 8 for Python,

Go fmt all the things

------
etioyuahgdhjdkg
Spaces. Not tabs. No exceptions.

~~~
_random_
> No exceptions

try { ... } catch {}

Seems a bit radical, but hey, who am I to argue.

------
cLeEOGPw
GNU for C/C++

