logoalt Hacker News

James_Ktoday at 10:33 AM3 repliesview on HN

C++ has two ways of naming things: `std::incomprehensible_long_name` and `|`.


Replies

tialaramextoday at 1:50 PM

It's funniest when they're making keywords.

"Hmm, we need a new keyword to express this complicated idea about how geese move, in other languages they seem to use the keyword fly"

A1: Just re-use this existing four letter keyword 'swim'. Yeah, technically a goose can also swim but that's different, and the ideas aren't similar, and the implementation is entirely different, but this way we didn't need a new keyword so it's less work for a compiler right?

A2: Simple, new keyword complicated_goose_motion - why are people not happy with that?

At some point a noob will ask "Hey why can't we just name it `fly` like in Other Language?" and they will be ridiculed because of course several C++ companies have used the word fly as an identifier in software, and so reserving that word would incur a slight annoyance for them, whereas just forcing either A1 or A2 avoids a little work for those companies and is thus better...

show 1 reply
_haotoday at 11:38 AM

I love C++ for the power it gives me, but boy do I hate reading C++ code. I know most of these things are for historical reasons and/or done because of parser compatibilities etc. but it's still a pain.

show 2 replies
miohtamatoday at 2:37 PM

This post is a prime example of the latter syntax which looks like a crow was jumping on a snow, and is equally readable.