Live data from Hacker News

Underscores are stupid

devblog.avdi.org

21–30 of 131 posts

Re: Underscores are stupid

#21
Only nerds know what underscores are? I think anybody who grew up in the early Napster/Limewire/Kazaa days knows what an underscore is because they probably downloaded a file like Michael_Jackson_-_Beat_It.mp3

Re: Underscores are stupid

#22
post #15

Earlier quoted context omitted.

and gets even worse if you bring variables into the game. a = 5 b = 3 everybody from nearly every programming language would expect that after c = a-b you will find c to be 2 not nil (or throwing an exception or whatever)

I've always found code without spaces around these symbols to be very undreadable.

Yes, but in this case it's not about readability, but about extremely significant whitespace. Forgetting a space and your code has a totally different meaning.

Re: Underscores are stupid

#23
Any time I have some feelings, I try to clean up the emotions and use my reason. Underscores solve a lot of problem and are useful in technology and programming and then suddenly i_love_underscores.

Re: Underscores are stupid

#24

All you have give up for this is tightly-packed arithmetic statements, like this: 5*5-3 Instead, you have to give your tokens some breathing room: 5 * 5 - 3 I don't know, that seems pretty stupid too.

and gets even worse if you bring variables into the game. a = 5 b = 3 everybody from nearly every programming language would expect that after c = a-b you will find c to be 2 not nil (or throwing an exception or whatever)

I never pack my code like that without whitespace, as doing so is only readable when you have single-letter variables, which is not very common.

I agree with the OP. CamelCase and underscores are both scourges.

Re: Underscores are stupid

#25

This 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 :(

Using dot as a name separator is actually the convention the R programming language, so it's certainly not a new idea. Ironically, it used to be the case that R did not allow _ as a variable character.

Re: Underscores are stupid

#26

Only nerds know what underscores are? I think anybody who grew up in the early Napster/Limewire/Kazaa days knows what an underscore is because they probably downloaded a file like Michael_Jackson_-_Beat_It.mp3

And because in middle school, everyone had one in their email address and AIM screen name.

Re: Underscores are stupid

#28
post #19

Semicolons. Underscores. Spaces. Tabs. Every couple weeks it's some new minutiae profiled as the cause of all the world's problems. Don't people have better things to focus on than this?

Some people are detail-oriented. How can you expect Mr. Grimm to obsess over corner cases in his code but shrug at what he perceives are problems with representing it?

The people who think only in terms of the “big picture” while glossing over the details are not programmers. They are “architects.”

EDIT: This second statement is probably not correct. I would use strikethrough if I could. But the first statement still rings true with me, many programmers are detail-oriented, which means that they care about lots of things other people would consider irrelevant. Whether this is, on the whole, a good thing or not is another matter. But I do not think it is surprising.

Re: Underscores are stupid

#29
As a daily python user at home and at work, I realized I'm typing a huge amount of underscores. My keyboard supports rebinding keys and programming macros (a feature I've never used until now) so I remapped an extra \ key on it so that it would type _ without me holding shift. Small change, but it's much less of a strain.

(I'm using a Kinesis Advantage keyboard.)

Re: Underscores are stupid

#30
post #17

I 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.

That's a bit contrived considering you're (a) writing a sentence and (b) you use some really short words (i.e., "I", "It", and "Is"). I think for things like FileNotFound or similar its not really that different in readability, and comes down to preference.
Post reply on HN