3 ms·
> Case-sensitivity is the opposite though: it's making two things that look the same be different. I can see why you would say that, but (as my comment suggest
by JadeNB 11y ago
> Case-sensitivity is the opposite though: it's making two things that look the same be different.
I can see why you would say that, but (as my comment suggests) I'm with wtetzner (https://news.ycombinator.com/item?id=10932471 https://news.ycombinator.com/item?id=10932471) on this one: I think that `variable` and `VARIABLE` look different. I am willing to believe, though, that this may just be a result of my training (as a mathematician); my students often genuinely see no difference between `h` and `H` (as variables), for example, and will interconvert freely.
> I don't think people buy their cars on the basis of how easy they make it to drive someone else's car, and nor should they.
I agree, but people often learn to drive with someone else's car, and I think that's the relevant analogy here.
- ziotom78 11y agoI think the point in the "variable"/"VARIABLE" difference is that, although they visually look very different, their meaning does not. In a more practical case, if I read some code which has two variables within the same score with names "last_value" and "LAST_VALUE", I would not be able to tell what should they contain: one has the last value in a sequence (which one?), and the other... what?
- JadeNB 11y agoI agree that, in that example, it's hard to think why one would want both. I not infrequently find it happening (that I want the same name with different capitalisations to mean different things) in TeX, but that's probably not a good example of programming practice (and I can't think of a recent example anyway). It is probably most prevalent in mathematics, where, for example, one will often use `a` for the length of the side of a triangle opposite the angle labelled `A`. Again, though, it's fair to argue that good mathematical practice in naming variables is not good programming practice!