Python Forum

Full Version: worst variable name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
what do you think is the worst variable name (of names that are valid)?

my vote is for:                data

but i am guilty of having used it once or twice.
(Apr-21-2017, 07:06 AM)Skaperen Wrote: [ -> ]what do you think is the worst variable name (of names that are valid)?

my vote is for:                data

but i am guilty of having used it once or twice.

Why Would data be a "bad" variable name?
All abreviations do seem bad, because they decrease readability unneccessarily. The "worst" abreviations are then single characters.
Consider this Enum-overload of logging .ERROR that we all know and love  Cool
<xx>_loggers_defs.available_logging_levels.ERROR
Wall
The Handbook of Research on Computational Science and Engineering
(Vol 2), J. Leng has a section on just this subject.

You can get the ebook (vol 1 & 2) for $495. Hardcover $595
from http://www.igi-global.com/book/handbook-...ring/51940

All kinds of pontification (is that a legitimate word?) by one modest guy.
In reality, written by five people and highly acclaimed

Have I read it? No, haven't found a copy in a yard sale yet.
anything listed from this
>>> help("modules")
The people who set up the database at work loved long, descriptive variable names. One of them was ClericalCodingCompleteDateTime. The problem being that we work in SAS, which traditionally* had a 32 character limit on variable names. So this got read in as ClericalCodingCompleteDateTim.

* The latest version of SAS screwed up all our code using Excel files. Previously it would replace spaces in column names with underscores. Now it allows variable names with spaces, so it just reads in the spaces. It took me a while to figure out how to handle that one.
What exactly is SAS? I have a friend who does it as a consultant, and owns a horse farm.
SAS is a proprietary (and expensive) data and statistics language. It is used heavily in business and government, as opposed to R, which is used heavily in academia. It's better at handling large data sets than R is, but R is a more traditional language that most find easier to learn. (Also, the SAS Institute has a virtual lock on publishing, and the books suck. I know of one good SAS book, and I've been programming in SAS for 15 years). R used to have an advantage in graphs and charts, but SAS's new(ish) SG graphics puts them ahead of R at this point (minimal ink people will disagree with me).

Python is, of course, an up and comer in the data analytics field. When I retire this summer, I'm going to put some time into learning pandas and such. Then if things don't work out and I need a job, I will have the trifecta of SAS, R, and Python. Although my R is a bit rusty. I don't like it's overly functional paradigm and it's rather poor implementation of OOP. Of course, SAS is such and odd language it doesn't have any OOP. I think of SAS like Lisp: it's such a completely different paradigm, and you have to think in that paradigm to really make good use of the language.
How about 'TheVariableForStoringStuff'

data is excellent for intermediate buffer like loading json data, etc.
Pages: 1 2 3