Regarding hex strings

foobar foo at bar.com
Sat Oct 20 05:59:27 PDT 2012


On Saturday, 20 October 2012 at 10:51:25 UTC, Denis Shelomovskij 
wrote:
> 18.10.2012 12:58, foobar пишет:
>> IMO, this is a redundant feature that complicates the language 
>> for no
>> benefit and should be deprecated.
>> strings already have an escape sequence for specifying 
>> code-points "\u"
>> and for ubyte arrays you can simply use:
>> immutable(ubyte)[] data2 = [0xA1 0xB2 0xC3 0xD4];
>>
>> So basically this feature gains us nothing.
>>
>
> Maybe. Just an example of a real world code:
>
> Arrays:
> https://github.com/D-Programming-Language/druntime/blob/fc45de1d089a1025df60ee2eea66ba27ee0bd99c/src/core/sys/windows/dll.d#L110
>
> vs
>
> Hex strings:
> https://github.com/denis-sh/hooking/blob/69105a24d77fcb6eca701282a16dd5ec7311c077/tlsfixer/ntdll.d#L130
>
> By the way, current code isn't affected by the topic issue.

I personally find the former more readable but I guess there 
would always be someone to disagree. As the say, YMMV.


More information about the Digitalmars-d mailing list