add attributes to debug

Gorge Jingale via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 24 16:51:48 PDT 2016


On Sunday, 24 July 2016 at 23:41:26 UTC, Ivan Kazmenko wrote:
> On Sunday, 24 July 2016 at 21:33:20 UTC, Gorge Jingale wrote:
>
>> To allow for different debug versions without having to go 
>> full blown version().
>>
>> @mem debug do something memory wise
>> @see debug write a message to console
>
> I don't get what would be the benefit.
> Currently, you can write that like:
>
> version (debug_mem) {do something memory wise}
> version (debug_see) {write a message to console}
>
> In my opinion, saving a few characters here does not get 
> anywhere near a good reason to add language complexity.
>
> Ivan Kazmenko.

It's not complex to add and it saves more than a few characters, 
One can append attributes much easier to debug than version. That 
alone saves about 10 chars each statement, if there is, say 1000 
debug statements in a typical smallish app, that's 10000 
characters, quite a bit. One also has to consider the extra 
identifiers to add. That is around 20 chars each. It's also a bit 
more visual.

It's also easier to remove attributes or change them. If one 
needs to change all debug attributes @see to @look, that involves 
about 10 keystrotes. If one has to do this to version, it is 
about 30.

It already fits in with attributes... no extra complexity their.





More information about the Digitalmars-d mailing list