Hate to break it to him, but parentheses require hitting the Shift key as well. Twice.
Underscores are stupid
121–130 of 131 posts
Re: Underscores are stupid
#122> Underscores require me to hit the Shift key. When writing prose, I only hit the shift once or twice per sentence. In Ruby, I have to hit the shift key every few letters. Awkward. Inefficient. Oh my, oh my, how do people ever cope with that vile "having to hit shift" that have regular capitalisation of all nouns etc. Surely such a thing is impossible, as is hitting shift when you need an underscore. I understand tha…
I use alternate hands when using the shift key, so that's not the issue. Perhaps it's just that I've got into a bad habit of depressing the shift key with a little more force and holding it for longer. With sticky keys I seem to dance off the keys better.
If you have a number pad, perhaps it might be better to switch the number row with the symbols (i.e. don't use SHIFT to get to the symbol.) I think that's the default for French layouts.
Re: Underscores are stupid
#123This may solve your problem: my.long.name = 1 a.short.name = 2 one.long.result = a.short.name - my.long.name one.string:trim:upper Use dots for identifiers and colons for class props and methods. Now we just need to design a whole new language :(
At least on a US keyboard, colons require the shift key, too.
Re: Underscores are stupid
#124I think they should make keyboards with the spacebar divided, and make the left half (or I guess the right if you're left-handed) into a shift key.
Perhaps the spacebar is just too big, and could be divided better into other modifiers. My left thumb is usually wasted (though not on a Mac, where the thumb can easily reach the Command key.)
Some people however - seem to alternate thumbs on the spacebar - or rather use the other hands thumb to the hand that just typed a character. I personally always use the right thumb to space.
Re: Underscores are stupid
#125Bravo! Also underscores in uri strings look awful. this_uri_is_ugly.html vs this-uri-is-pretty.html I wish python allowed for dash in its script names... cannot import from module-test.py but I can from module_test.py Thank you for posting this, I "laughed-out-loud".
Re: Underscores are stupid
#126Earlier quoted context omitted.
"the stretch"? Properly typing an underscore should utilize two hands and shouldn't require a stretch at all.
It moves your pinky, your smallest and least mobile finger, to move up two rows, which requires a typical person to completely flatten that finger. Either that, or you end shifting your whole hand. Which means that you end up moving your hand a lot while typing because the underscore may easily be the most common keyboard character encountered in some programs.
Either way, reaching the + key on QWERTY-102 is objectively more difficult than the underscore [uses the pinky, is farther away than the underscore from homerow], and also requires a shift-modifier. I use + far more than _ while I'm coding. (And I'm currently writing most of my code in Go, so I use _ quite a bit since it's a blank identifier.)
Maybe I just have big hands, but it honestly doesn't impede my typing at all to add an underscore to the text.
Re: Underscores are stupid
#127Earlier quoted context omitted.
Well, the author himself is pretty ambiguous. While most of the article talks about code, the author mentions underscores being ambiguous in the context of underlined fonts. (I don't even think my text editor [for code] supports underlined fonts.) He also mentions only using shift once or twice per sentence when writing prose. So it would seem that the author is just hating on _ in all contexts. Which is kind of sill…
I don't even think my text editor [for code] supports underlined fonts. Well, mine does, and I used to have a co-worker who actually used it for coding. So there you go. :-)
How would you use it for coding, though? Unless you stripped it before the compile phase I would think any formatting in a rich-text format would choke up almost any interpreter or compiler.
Re: Underscores are stupid
#128Earlier quoted context omitted.
I don't even think my text editor [for code] supports underlined fonts. Well, mine does, and I used to have a co-worker who actually used it for coding. So there you go. :-)
Come to think of it, I do know some editors that support HTML rendering inside comment blocks. How would you use it for coding, though? Unless you stripped it before the compile phase I would think any formatting in a rich-text format would choke up almost any interpreter or compiler.
Re: Underscores are stupid
#129What colour do you want your bikeshed painted today? I for one, don't like the "->" operator in C. It requires two characters and the use of the shift key. I would like that the next standard just used "." for all member access and let the compiler work its magic and guess what needs to be done. Of course that would break a sizeable amount of legacy code, but who cares about that anyway. The important is that the cod…
I know you're being sarcastic, but since you bring it up, I think the -> operator in C(++) is awkward as heck. If dereferencing were a suffix operation as in Pascal, you could simply write p .foo instead of ( p).foo. I guess it'd break because of (a* +b) but that's just all the more reason to disallow whitespace around infix operators.
It would be p^.foo instead of (^p).foo or p->foo. Less awkward when adding or removing one indirection level too.
Re: Underscores are stupid
#130Earlier quoted context omitted.
The automatic dereferencing in "pointerToStruct.foo" might have to loop until it arrives at a struct. I think such a loop would be unique in C, but I don't feel it'd make C any higher level. Similar in concept: &function and function are the same. If you have a fixed-size array: ary, &ary and ary[0] are the same when passing them into a function. Then there are all the other numeric conversions, where "unsigned" is a…
pointerToStruct.foo would just be equivalent to pointerToStruct->foo. No loop required. The main problem with this is that it hides memory accesses. The offset of x.y.z.w relative to &x can be determined at compile time, so if &x is available, accessing x.y.z.w requires roughly only one load instruction. (DISCLAIMER: ABI- and compiler-dependent. One instruction is an estimate. This estimate may not be precisely true…
For example, you cannot tell how many indirections happen in a[5][2][8] either. Every game programmer must have seen a newbie try to cast a[4][4] into a :)