Quote:
Originally Posted by
bakunin
First of all, i am glad your problem was solved. There are still some points you might want to consider:
[..]
You definitely have a point there. As i am about to post a larger software project for the community within the next days i suggest we should have a discussion about coding standards in general. Perhaps we could all profit somewhat from such a discussion and by seeing what others do and why.
bakunin
For speed I usually start with shorter names when I create code quickly, in this case I only had a couple of minutes..
This stems from coding on the command line, where I do most of my coding. Most of the time this is for ad hoc one-time scripts. Using short variable names is a real benefit there for speed and keeping it all in the head..
If code is working well then it makes it into a more permanent script and then of course the variable names are replaced by mnemonic variable names and larded with comments (although I am definitely not a fan of overdoing comments)
In this thread it is just about coding ideas, so that one can experiment what works best, not production level solutions. They are just tiny snippets of code, quick ideas, that should be easy to understand even with minimal mnemonics. I think it may be even be a benefit as it encourages people who want to reuse the code to really think about it and try to understand the meaning .
When I am coding for production scripts, I would not dream of using single letter variables other than for counters, obviously..
For larger software projects of course, or when coding in a team this is very important, and I am all for mnemonics and coding standards, but not so much for small snippets that are just rudimentary coding ideas ...
S.