3 ms·
>By that logic, driving on the right side of the road in the US vs driving on the left in the UK is "pop culture". Not at all. I don't drive on the right side
by papsosouid 14y ago
>By that logic, driving on the right side of the road in the US vs driving on the left in the UK is "pop culture".
Not at all. I don't drive on the right side because "everyone else does" and "that's the style". I do it because its the law, and because I would be risking my life and the lives of others to do otherwise. Having a function with an underscore in its name isn't breaking any laws, and isn't risking any lives or anything even remotely analogous. It is entirely based on subjective whims.
- pjscott 14y agoYou risk confusing and annoying other people who read your code. It's a non-lethal risk, to be sure, but still a reason to follow the local naming customs.
- papsosouid 14y agoYou risk confusing and annoying other people who read your code if you do follow convention also. I hate camelCase just as much in languages where it is customary as I do any other time. It is just a question of how many people you expect to annoy, which is precisely choosing it by popularity.
- zerostar07 14y agoThere are 2 factors that would keep you from switching styles: inertia, and symmetry. The benefit from keeping the code looking good usually outweighs the gratification of "going on your own". And frankly if you 're changing coding style in your contribution you look like a prick. The OP's point is valid: it's not popularity that leads to standardization it's because of the initial standardization that it is later adopted. Case in point: i don't know any major project that does not follow the style conventions of the framework it's built upon.
- bmelton 14y agoWith Python at least, it's effectively the law, or at least is defined in PEP8. PEP8 is tricky because it's technically a "style guide", but heaven help you if you're trying to get your code into somebody else's repository and aren't abiding its tenets. http://www.python.org/dev/peps/pep-0008/ http://www.python.org/dev/peps/pep-0008/