
Ask HN: What would you consider your coding standards? - tech_crawl_
Just wanted to see if people had different coding standards..
======
Rannath
Variable name length should match scope. A variable that only does something
for three lines can be a single letter (Ex: i). A variable that is (god
forbid) global should be nice and long (Ex:
global_map_of_all_callback_functions). Everything I control should be
readable.

Method/Class name length should be inversely proportional to usage. If it's
used everywhere it should be convenient to type (Ex: add). Of course the
method/Class should still describe what SINGLE responsibility the piece of
code has. Remember that the name of the class & parameters is part of the
method's call signature is many languages (Ex: Registry.add(Person person)
could be read as "add person to registry").

Use the generally accepted standards of the community you code in. (Ex: Rust
prefers snake_case and SCREAMING_SNAKE_CASE for names)

Be consistent.

Follow the principles of Clean Code.
[https://cleancoders.com/](https://cleancoders.com/)

There's more, but that's the general thrust of it.

