Hacker News new | ask | show | jobs
by steveBK123 1275 days ago
Worked with some guys like this, probably doing it intentionally. One guy liked single-letter vars & derivatives thereof. For example all the following might appear in the same 100 lines of code: a, aa, a_, aa_, aa__, A, AA, A_, AA_.

Often these were crazy code forking paths like:

* a is a 1 liner which calls a_ or aa depending on a conditional.

* a_ then returns something or calls a__ depending on a conditional.

* aa calls aa_ or aa__ depending..

* A, AA, A_ and AA__ might be some global states or boolean flags or cmdline args or env vars read in which effect all the above..

Another favorite was to use the same noun in different cases for different types of things. For example:

* servers - a function you call which returns a list of servers

* servers_ - a subfunction called by servers

* SERVERS - a boolean global variable switch to enable functionality

* Servers - a variable containing the list of servers used by all of the above

I once asked him to explain the differences and there was no consistency. Sometimes all-caps was the function, sometimes all-caps was the boolean, sometimes lowercase, whatever.

The best was clearly someone forced him to put in comments under duress.

However he ONLY commented the obvious stuff, like-

getCmdline # gets the cmdline