Regarding the proposed Binray Literals Deprecation

Adam D Ruppe destructionator at gmail.com
Sat Sep 10 14:21:02 UTC 2022


On Saturday, 10 September 2022 at 05:58:25 UTC, Walter Bright 
wrote:
> Do you really want to use the nuclear option over octal 
> literals?
>
> It really bothers me why so many discussions head down this 
> path. Let's please try and keep the voltage down.

Have you ever stopped to ask WHY there's so little confidence in 
D's leadership?

This whole thing started because you make the *patently false* 
statement in DConf that binary literals were *already* 
deprecated. This shows you didn't fact check your talk - you 
didn't try to compile the code, you didn't check the spec, and 
you didn't talk to any experienced D users, who would have 
pointed out the error.

Yet you presume to lecture us what what things are used and how, 
then make unilateral decisions, just ignoring community 
experience.

A lot of us were excited about std.conv.octal. I wrote the first 
draft myself, then even voluntarily rewrote it into a convoluted 
mess when requested to by the Phobos maintainer, which was a lot 
of work and VRP improvements rendered most that work moot since 
then, but at the time, I thought it was worthwhile to get it in.

That was over ten years ago.

Since then, despite hitting use for octal literals several times, 
I've only ever translated them to use std.conv.octal a few times. 
I more often translate to binary or hex, not necessarily because 
they're the best representation (though like i said, i often do 
prefer binary literals to octal), but just because they're built 
in.

Similarly, I have been arguing that `throw new Exception("some 
string")` is bad form for a long time, but I often do it anyway 
just because it is the most convenient thing to do.

On the other hand, you've pointed out before that `unittest` is 
not a fantastic test system, but it gets used because it is 
convenient and this is a good thing, since some unittest is 
better than none.

I do think octal in its own, fully independent module would be 
better than we have now, since at least then it is easier to pull 
without additional baggage. But I've heard a lot of people 
complain they just won't do the import at all because you have to 
move elsewhere into the code to add it and it is just an added 
hassle. So it wouldn't fix that but might be more used than it is 
now.

But regardless, binary literals are already here and shouldn't go 
anywhere. (btw another reason why is the octal!555 trick - using 
an int literal - won't work with binary since it will overflow 
too easily. you'd have to quote the string. which is not a big 
deal but another little thing)

Anyway, removing the binary literals we've had for decades would 
*hurt* D. And ignoring D's users over and over and over again IS 
going to lead to a fork.


More information about the Digitalmars-d mailing list