4 ms·
CapsLock is extremely useful in programming, where CONSTANT_NAME is the most common convention for names of constants.
by tsimionescu 5y ago
CapsLock is extremely useful in programming, where CONSTANT_NAME is the most common convention for names of constants.
- electroly 5y agoHolding down shift is not really a problem for constant names since you need it for the underscores anyway. You can type CONSTANT_NAME without lifting the shift key but with caps lock you still need to use shift anyway.
- tsimionescu 5y agoYou can't "hold down" shift when writing CONSTANT_NAME if you're doing any kind of touch typing. You constantly have to switch between pressing left shift or right shift, so basically you're writing 13 key-combinations. With caps lock, you only need to use a key combination once (for _), instead of 13 times without.
- foxfluff 5y agoAny kind of touch typing allows ring finger to substitute for pinky when the latter is shift-locked.
- tsimionescu 5y agoSure, but it's definitely harder than using CapsLock.
- electroly 5y agoAny kind of touch typing? No, I don't agree with that. I can type 140+ wpm and don't look at the keyboard, and I can hold down shift while typing CONSTANT_NAME. Pinky on shift, remaining 9 fingers type CONSTANT_NAME. The pinky would not be involved with this particular constant even if it were free. The kind of touch typing you learned in school has a problem with this, maybe.
- tsimionescu 5y agoA is normally typed using the left pinky, so holding left shift will force you to use the left ring finger for it. To be fair, on some keyboards, including the one I use, it's easy to reach both the right and left shift keys, so it's easy to alternate shift keys as needed to avoid using other fingers or moving your hand from the home row.
- electroly 5y agoI guess it's important to note that I would use the right shift for this. I have the ability to choose on-the-fly rather than be forced into one or the other by a typing method that I learned in school. I could still do it with the left shift but it's not the one I would choose for this. It's probably fairly obvious what I think about the taught-at-school touch typing method. It's a decent middle-of-the-road option that's intended to be easy to teach and to work for most people in most situations; that's all.
- masklinn 5y agoWriting out constant names is a minor and rare event (even more so with any editor featuring autocompletion). This does not come close to “useful”, let alone extremely so. The value of capslock is that it provides an essentially blank key which can be remapped to something useful e.g. Ctrl, Esc, Meta, …
- tsimionescu 5y agoA good keyboard doesn't really need re-mapping, as the ctrl, esc and meta/alt keys are already readily available. You could argue for mapping caps lock to Super or Hyper if you're an emacs user maybe, but I for one never felt the need. Exactly as the article mentions, caps lock is a nice to have, though rare, key. Removing or remapping it will complicate your typing in those scenarios for sure. if you find a better use for that space where it simplifies other more common scenarios, great. But just removing it would be idiotic.
- masklinn 5y ago> A good keyboard doesn't really need re-mapping, as the ctrl, esc and meta/alt keys are already readily available. They’re not, unless by “good keyboard” you mean “custom layout”. On all the keyboards I’ve ever known, the almost entirely useless capslock takes one of the more valuable places on the keyboard just left of the home row. It’s the modifier key which requires the least movement by far, yet with a native function which is almost entirely worthless. I’d like to see your hypothetical keyboard where control (to say nothing of esc) is anywhere near as easy to reach, despite both being used significantly more than caps, and caps being trivially and fully dispensable with unless your days are spent writing SQL with all keywords in all caps. > You could argue for mapping caps lock to Super or Hyper if you're an emacs user maybe No, you really could not, unless you’re part of the minority which flies with fully custom keybindings. But even then control is such a central modifier of emacs that making it more accessible and require less contorsion tends to yield the highest bang for your buck. You could always remap the old control to super or hyper instead of having two control keys I guess.
- 5y ago
- bdowling 5y agoOr in vim you type `constant_name`, followed by `Esc gUb`. ('g' go, 'U' uppercase, 'b' back one word.)
- tsimionescu 5y agoThat's still 3 extra key strokes, including a key combination, to go from writing the constant name back to writing the next word (with caps lock: caps lock, constant_name, caps lock; without caps lock: constant_name, Esc, g, shift+u, b, i - you also need w, i to get back to the end of CONSTANT_NAME and keep typing). Also, switching mode, applying a command, then switching mode again versus pressing a key for uppercase and pressing it again for lowercase is a much bigger distraction from my point of view (emacs user) but maybe you actually get used to that using vim.
- rgoulter 5y ago> versus pressing a key for uppercase and pressing it again for lowercase FWIW, "Caps Lock" is modal. e.g. the Wikipedia page lists "Caps Lock" as a common example of mode errors. https://en.wikipedia.org/wiki/Mode_(user_interface)#Mode_errors https://en.wikipedia.org/wiki/Mode_(user_interface)#Mode_err... (No vim = not worrying about insert/normal mode; no capslock = no worrying about if tapping 'a' gives 'A' or 'a').
- tsimionescu 5y agoTrue, but at least to me switching between CAPS MODE and lowercase mode is less distracting than switching between editing and command/visual modes.
- wizardofdos 5y agoAs common as it is wrong. Why is the constant screaming at me? Why is the fact that it's a constant important enough to be encoded in the styling of the letters, but not important enough to be encoded in the name. Why isn't the IDE or the compiler keeping track of the constantness of the variable and reminding me to not do the wrong thing? If they can and are, why am I not trusting them? And if they can't, why am I writing in a language that doesn't even have JavaScript levels of a type system?