3 ms·
My personal frustration with Python's coding standards is the combination of PascalCaseNames and snake_case_names. Rust has adopted the same coding style. :( P
by cpeterso 13y ago
My personal frustration with Python's coding standards is the combination of PascalCaseNames and snake_case_names. Rust has adopted the same coding style. :(
Plenty of C++ code uses UPPERCASE_SNAKE_CASE_NAMES for macros, but that doesn't seem so bad because macros are ugly and should be used less frequently than classes and functions. (I hope!)
- eevee 13y agoCurious, why's that bother you? Different things should look different, and all. :) The alternative for class names is Camel_Snake, which will get you smacked in virtually any language. Python code does tend to use UPPERCASE_SNAKE for "constants" as well, probably inherited from C (sometimes via Perl or Ruby).
- cpeterso 13y agoMixing the styles just feels inconsistent. The only language I know where Camel_Snake is used is Ada.
- Shish2k 13y agoWhat happens when you want to write a set of functions to handle a set of classes? Especially when you are given a class and want to figure out which handler to call dynamically - eg you have FooEvent, should the function be "handle_foo_event", "handle_FooEvent", "HandleFooEvent", or any of several other possibilities?