Underscores be Gone

My two biggest pet peeves with Python are underscores and outdated less powerful list comprehensions compared to modern standards such as Linq. The _ should be considered as relics of 60s era when terminals/printers didn’t had ability to print lower cases. However programming languages didn’t allowed spaces so programmers were forced to use some character to separate words in variable names. With new technology of lower case letters this was no longer needed since about 50 years. Underscores takes away extra space, makes code actually less readable because they stand out too much among regular roman characters and its slow down the typing a lot (I’ve to reach my finger for shift key followed by _ key on most keyboards).

can’t select a variable or function name with a double click

One case for the underscored style is that you can use one-letter-words better. For (a rather silly) example, findMeAClass is perhaps uglier than find_me_a_class

Google Python Style Guide has the following convention:

module_name, package_name, ClassName, method_name, ExceptionName, function_name, GLOBAL_CONSTANT_NAME, global_var_name, instance_var_name, function_parameter_name, local_var_name

Avatar
Shital Shah

A program trying to understand what it’s computing.

comments powered by Disqus