3 ms·
Given 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 vari
by papsosouid 14y ago
Given 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 agoYou know, saying that someone is a bad programmer without reading their code disqualifies you even before you say anything else. And the "majority of experienced programmers" is a "citation needed" thing. Donald Knuth seems to disagree with them, anyway. I see no other resistance than from you, by the way. Oh, and also: aside from "citation needed" your argument that "many people think the same" is an argument from authority, which is rather weak thing to do.
- papsosouid 14y ago>Donald Knuth seems to disagree with them, anyway. No, he does not. Read his code, it is full of single letter variables.
- klibertp 14y agoUnfortunately you're right on this. I read his various works long ago and had not very accurate memory of them. As a final note in this discussion I'd like to say that you're probably misunderstanding me. I have never said that single-letter names are completely prohibited - just that they should be avoided when possible. I actually went and did some analysis on the code I think is good: Underscore.js. This is what I found. I excluded all language keywords like `var` and `if`. I then calculated how many unique names there are in the code and how many of them are 1 or 2 letters long. The result I got was 4%. I then checked how many times each of the names was used and how many times 1 or 2 letter long names were used, Surprisingly I got almost the same result - 4%. So, to conclude - if more than 4% of names you use are shorter than 3 characters than you're writing bad - or at least worse than Underscore.js - code. I'm not guilty of this, I checked my own code too. And how about you? Also, on a more personal note - you're infuriating as a adversary in the discussion because of at least three things: you only answer to parts of arguments that are convenient to you, you don't openly state assumption you're making and you're mixing completely irrelevant things into the discussion. Please improve :)