3 ms·
You write bad code. If you are using anything other than a single letter for a simple for loop iteration, then you are making your code less readable, not more
by papsosouid 14y ago
You write bad code. If you are using anything other than a single letter for a simple for loop iteration, then you are making your code less readable, not more. Adding cognitive load to a trivial process is bad, not good.
You summarize your argument by saying descriptive names are important, but your examples do not support that at all. Descriptive names are important for things that need to be described. If I write a function "reverse_string" with a single string argument, that argument had damn well better be named "s". There is no longer name that can convey any useful additional information. Many longer names will be distracting, and make the code harder to read.
- klibertp 14y ago"Many longer names will be distracting, and make the code harder to read." Do you have any source for this? I really can't imagine this happening, seriously. "You write bad code." I see, it's one of those days when you just have to be a dick to someone. Ok, no problem, moving on... To reiterate without needless things involved: can you prove that a) words between 1 and 6 letters of length are significantly harder to read for higher letter counts and b) having longer names, regardless of a, is not beneficial at all? If you can - please do.
- papsosouid 14y agoGiven that 90% of experienced programmers fall on the side of "i or gtfo", the onus is on you to prove that "counter" is beneficial. Any time I see a long variable name, I naturally assume it is important, and has a large scope. When you lie to me with your code, that makes it harder to read, not easier.
- klibertp 14y ago"Given that 90% of experienced programmers" Is this your proof? Nice... "is on you to prove that "counter" is beneficial" And why not on you to prove that it's harmful? Because you don't have arguments? "Any time I see a long variable name, I naturally assume it is important" Very good habit, keep at it - and please define 'long' by the way. For me it means 14-20 characters; and short means 3 to 6 characters. "experienced programmers fall on the side of "i or gtfo"," Well, these are probably the same people who claim that comments in code are bad. Both claims are simply stupid. Anyone experienced enough - and not dyslectic... - will tell you that readability counts, that you should never or almost never use any name shorter than 3 characters and that you should comment your code heavily. Whoever tells you otherwise - to put it simply - writes bad code or wants you to write bad code. I find it amusing to see so many people mistaking familiarity for readability. Just because something is very familiar to you it doesn't mean that it's readable. It's a shame that people are unable to look at the matter objectively and hence they write bad, unreadable, hard to change and extend code.
- papsosouid 14y ago>Well, these are probably the same people who claim that comments in code are bad. No, they are not. Please, copy this thread into a text file and hang on to it. Spend a few years actually reading and write code. Then come back and facepalm at yourself.
- klibertp 14y agoI have been reading and writing code for twenty years now in about a dozen languages or so. How long do you think I should wait to realize how mistaken I am now? And while we're at it, how many years have you spent writing and reading code and in how many languages? But that's a digressions, what's important is that you provided not even a single argument; not even one. You cannot expect to convince anyone without even trying.
- papsosouid 14y ago>I have been reading and writing code for twenty years now in about a dozen languages or so I would strongly recommend that you stop admitting that. >And while we're at it, how many years have you spent writing and reading code and in how many languages? 28 years, and I count 18 languages including logo and sh which you might not count. >what's important is that you provided not even a single argument; not even one. Yes I have. Ignoring it doesn't make it cease to exist. The vast majority of experienced programmers have already gone through writing code like you when they were beginners, and then realized it was bad and stopped. You can easily verify this yourself by noticing how the vast majority of experienced programmers tell you that you are wrong. >You cannot expect to convince anyone without even trying. I do not expect to convince you. You are attempting to convince others to write bad code. I am stating that you are a bad programmer, and that is why you find such resistance when you try to convince people to write bad code. The fact that you focus entirely on strawmen and demanding that other people prove you wrong rather than simply supporting your claims does not help your case.
- klibertp 14y ago