missing HexString documentation
Ralph Doncaster
nerdralph at github.com
Wed Feb 7 19:29:10 UTC 2018
On Wednesday, 7 February 2018 at 19:25:37 UTC, Ralph Doncaster
wrote:
> On Wednesday, 7 February 2018 at 16:51:02 UTC, Seb wrote:
>> On Wednesday, 7 February 2018 at 16:03:36 UTC, Steven
>> Schveighoffer wrote:
>>> Seems like the same code you would need to parse the first is
>>> reusable for the second, no? I don't see why this deprecation
>>> was necessary, and now we have more library/template baggage.
>>>
>>> -Steve
>>
>> For the same reason why octal literals have been deprecated
>> years ago:
>>
>> https://dlang.org/deprecate.html#Octal%20literals
>>
>> The library solution works as well and it's one of the
>> features that are rarely used and add up to the steep learning
>> curve.
>
> I, like Steve, disagree.
> Coming from c/c++ (and some Java), this was really simple to
> understand:
> x"deadbeef"
> While this took a lot more time to understand:
> hexString!"deadbeef"
>
> For hexString, I had to understand that ! is for function
> template instantiation, and I also had to find out what library
> to import.
I just did a quick check, and with DMD v2.078.1, the hexString
template increases code size by ~300 bytes vs the hex literal.
So yet one more reason to prefer the hex literals.
More information about the Digitalmars-d
mailing list