Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The 1_000_000 thing exists in perl as well (I think also via theft from Ada) and frankly I can't understand why everybody hasn't stolen it.


C++ has (albeit only since version 14) the single quote as digit separator, which is (IMHO) a better choice: https://en.cppreference.com/w/cpp/language/integer_literal


> which is (IMHO) a better choice

I know C++ added it 14 years after D :-) but I'm curious why you say ' is a better choice? I never read the papers proposing the feature, but the _ hasn't caused any problems for us, and I like it better myself.


I use the quote separator for digit grouping on any occasion, i.e. also outside of computer code. There, we usually have non-monospaced fonts, for which the use of underscores is glaringly uglier compared to use of single quotes. I don't know if you took this design decision from somewhere else or not, but it was an inspired decision nevertheless.

Also, I'm glad and honoured to have a comment like yours in my history. Sorry for late reply.


Pretty much every currently updated language does these days.


When I met Walter at an OSCON in 2008 we were both annoyed that more languages hadn't already stolen it.

"Achieved what perl had managed in 1988 and D in 2000" is not honestly a point in favour of languages who worked it out somewhere in the past decade.


What an odd way of looking at it. It's not a contest. It's a diffusion of ideas that are helpful.


I agree that its helpful and you notice Ive been firmly on the side of everybody stealing it - which is why "pretty much every language has that" rather than "oh, cool, that's a really nice feature and it's interesting to learn where it diffused from" was such an oddly dismissive response to Walter and I enthusing about it.


This wasn't remotely true in 2000 when D was being created. AFAIK D was the first after Ada, and certainly popularized it as I made many presentations including it.

C is still holding out :-)


Perl 5.000 was released in 1994 (see https://perl.bot/p/kw3gbl for a demonstration that had the syntax)

Edit: That bot is far too easy to be curious with, and unless I got my testing wrong, perl 2 (from 1988) seems to have been where it was added: https://perl.bot/p/jzyi91

All assistance convincing the rest of the world they should also adopt the feature is very much welcome though :D


Thanks for the info! I stand corrected.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: