2 ms·
I can see the utility in that, but fear that I would get confused on what 'inf' means if I don't use it often and come back to old code. I read that as infinite
by rodriguezcommaj 14y ago
I can see the utility in that, but fear that I would get confused on what 'inf' means if I don't use it often and come back to old code. I read that as infinite. Maybe something like "inFile" and "outFile"? A little more verbose, but still not too long and easier to deduce the meaning of the variables. Is camel-casing like that OK for variables in Python, or is there another convention that I am unaware of?
- TylerE 14y agoShortness is a real virtue here - the kind of code I'm writing where I do this is typically short, one off things, usually no more than 100 lines. Personally, I strongly dislike camel-casing, and never use it in my own code.
- rodriguezcommaj 14y agoIs there any strong argument against camel-casing, or is it just a stylistic preference? I traditionally like it as it's easier to pick out individual words, but I am open to any arguments one way or the other.
- TylerE 14y agoI just find it ugly. I'll admit that's oldschool, and use lots of short variable names, often abbreviated. This tends to be less of a source of error than a typoInAnExtremlyLongAndVerboseVariableName.
- RyanMcGreal 14y agoThe Python community generally seems to prefer words_with_underscores over camelCase. See PEP-0008 for more detail on coding conventions: http://www.python.org/dev/peps/pep-0008/ http://www.python.org/dev/peps/pep-0008/
- rodriguezcommaj 14y agoThanks for the resource. I guess I will have to get used to using underscores, which I currently dislike typing.