• within_epsilon@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    12 days ago

    New feature with terrible syntax. There are features of every language I choose not to use. As a C++ developer, I would choose not to use this syntax, so that my team can write better designed code. However, I am an oddball on my team for loving trailing return types. In peer review, the schlong operator i.e. ---> would only be used where it makes sense which should be nowhere.

    Peer reviewing this seriously would require knowing more context. Instinct tells me MyClass**** is probably allocated from the heap. A possible reason for so many levels of indirection are jagged arrays. Maybe the function only gets the first element of each level of the arrays. The function name doesn’t make that clear. This is poorly designed. Please re-design/re-write. I will happily review those changes. I expect unit tests to show example use cases.

    I would suggest using a stack allocated array with sentinels for missing values to improve cache coherency. Without context, I assume looping over the jagged structure will be common. Loading more into cache should improve efficiency in loops, but benchmarks are required.

    Wait… I should join the crowd. So I say, “down with C++” and up with some safe alternative. Maybe rust: https://github.com/Speykious/cve-rs.