Standard way to supply hints to branches

Manu turkeyman at gmail.com
Wed Sep 11 11:53:36 UTC 2024


On Wed, 11 Sept 2024 at 09:12, Walter Bright via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 9/9/2024 7:18 PM, Tejas wrote:
> > Hi, what are your views on the article linked below that discourages
> using
> > `[[likely]]` and `[[unlikely]]`?
> >
> >
> https://blog.aaronballman.com/2020/08/dont-use-the-likely-or-unlikely-attributes/
>
> Wow. The article eviscerates that design.
>

Just to be clear; nobody I'm aware of has proposed that design, so I hope
that's not your take-away.

My proposal is to allow a hint attached strictly to control statements.
(ideally as a suffix)
It is easy to read, also easy to ignore (this is important), and extremely
low-impact when marking up existing code: no new lines, no rearranging of
code, purely additive; strictly appends to the end of existing
control statements... these are very nice properties for casually marking
up some code where it proves to be profitable, without interfering with
readability, or even interfering with historic diff's in any meaningful way
that might make it annoying to review.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20240911/2ea27c31/attachment-0001.htm>


More information about the Digitalmars-d mailing list