Do you have any more details on your recommendations?
if avail > 0:
I could never reason well about that. Then I changed it to if available_hosts > 0:
and eventually into if number_of_hosts_to_scan > 0:
Technically this would be enough if number_of_hosts_to_scan:
but it's less clear.I'm not afraid to type long variable names because the editor has autocomplete. I don't type much and I don't make typos.
1. It is not obvious to everyone. 2. Another integral parameter called k is added later on. Now which is which? 3. Another guy might call all his integral parameters k. n and k are used for the same thing all over the code-base. An outsider might initially think they are different. 4. Names which are descriptive of their use are obvious to everyone by definition.