the word "amt" is not descriptive and is very poor programming
he/she should have used the fullword "amount" as I did. short hand variable make it difficult to read
We use 'amt' very often at work. Everybody knows what it means.
It would be bad programming to use 'a', but 'amt' equals amount in everyone's (who'll have to look at the actual code) mind so I would consider it a descriptive variable.
I would also consider using 'amt' in a 'banking' application as being a descriptive variable too. I would be surprised to find anyone going through a bank app. code to not know what amt would mean. Especially in a method called deposit()!
Granted, amt could mean something else, and it would be bad programming to use a amt variable to mean something else. But then, most complete words have multiple meanings too.
So I think that u can't say that using an abbreviation for a variable name is "very poor programming".
Just my 2 cents.
*edit: Now that I checked, I could add that java.sun.com often uses abbreviations for variable names in their examples. 'num', 'rect', 'fps', etc.
Question
Mouton
We use 'amt' very often at work. Everybody knows what it means.
It would be bad programming to use 'a', but 'amt' equals amount in everyone's (who'll have to look at the actual code) mind so I would consider it a descriptive variable.
I would also consider using 'amt' in a 'banking' application as being a descriptive variable too. I would be surprised to find anyone going through a bank app. code to not know what amt would mean. Especially in a method called deposit()!
Granted, amt could mean something else, and it would be bad programming to use a amt variable to mean something else. But then, most complete words have multiple meanings too.
So I think that u can't say that using an abbreviation for a variable name is "very poor programming".
Just my 2 cents.
*edit: Now that I checked, I could add that java.sun.com often uses abbreviations for variable names in their examples. 'num', 'rect', 'fps', etc.
Edited by MoutonLink to comment
Share on other sites
29 answers to this question
Recommended Posts