There's an easy fix for part of the problem: bind shift-space to underscore. Yes, you still require shift, but IMO it's the stretch not the shift that makes typing an underscore jarring. xmodmap -e 'keycode 65 = space underscore'
"the stretch"? Properly typing an underscore should utilize two hands and shouldn't require a stretch at all.
Underscores are stupid
91–100 of 131 posts
Re: Underscores are stupid
#92Page long commenting on a fluffy article ( e.g "5 * 5 - 3" beats "5*5-3" ) may be good for your mind but imho, this thing should not be on the front page.
Re: Underscores are stupid
#93At my old job, we had DSL that allowed and encouraged very descriptive variable and procedure names with space in them. To implement this unambiguously the language had to exclude all the operator characters from variable names and procedure calls with a sigil. A line of code may have appeared like this:
line slope estimate = @some function( x - step size ) / ( x - step size);
Feels a bit strange at first but quickly becomes natural, especially when dealing with wordy domains (math was a bad example).
Re: Underscores are stupid
#94Earlier quoted context omitted.
Unless you use Emacs (as the author seems to), in which case you have S-Space bound to starting/ending selection. But in general yes, one can rebind underscore to something that doesn't require pressing Shift.
That's C-SPC.
:).
Re: Underscores are stupid
#95This misses one point when comparing Lisp to languages like Ruby. Lisp does not have infix notation. Therefore, you never have to worry that "foo-bar" (the symbol) could ever be confused with "foo - bar” the operation subtracting bar from foo. That’s because in Lisp, foo-bar is written "(- foo bar).” Since a Lisp programmer spends all his time writing "(- foo bar),” when he sees “foo-bar,” his brain easily parses it…
Even if I don't know what programming language you're talking about, if I see x2-x1 or margin-75 I know you probably mean subtraction, and if I see last-name or message-id you probably mean a single identifier. I've seen plenty of Lisp code that says things like x2-x1 in docstrings (because it is shorter) and I've never found it to be confusing.
Re: Underscores are stupid
#96Interesting that he calles dashes "ordinary, easy-to-type, recognizable, [and] visually unambiguous." What he's referring to as a dash is actually a hyphen (-), which is pretty ambiguous when compared to the en dash (–) and em dash (—), both of which require modifier keys to type (and are frequently used in prose, to counter another of his claims). Fortunately, I've never seen em dashes or en dashes used in code.
Re: Underscores are stupid
#97Re: Underscores are stupid
#98This 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 :(
Re: Underscores are stupid
#99Earlier quoted context omitted.
I like the arrow since it reminds me sometimes that I'm working with a pointer and not an object on the stack
Pointers aren't always to objects on the heap, they can be pointing to locations on the stack as well.
Re: Underscores are stupid
#100I use case instead of underscore. Doesn't help the shift-issue, but reduces the length of identifiers e.g. file_not_found becomes FileNotFound.
IThinkItIsObjectivelyMuchLessReadable I_think_it_is_objectively_much_more_readable The difference in length is pretty small anyway.
Names tend to be pretty small anyway. Here are some random ones from the code I'm working on (Sococo Teamspace)
CreateVariant - a method
soLogWriteInfo - a method (I didn't write)
clHeadSSt - a circular list head for a stream