• (nodebb)

    Hmm.

    OK. I'm not really happy about ra as a variable name for a shared-pointer-to-Assignment, but it's not an interesting mistake. Maybe there's a good reason for calling it that beyond simply an abbreviation for "reference-to-Assignment" (which it isn't, which is why I'm not happy about it).

    What bothers me is the article's blatant dismissal of using Assignment::Ptr instead of boost::shared_ptr<Assignment>, but even more, its unconditional dismissal of Assignment::makeAssignment(...). After all, whether it's C++ before C++11 (using Boost) or C++11+ (using the STL), the library provides a function to construct a new shared pointer and return a pointer to it. It's called the_right_namespace::make_shared<T>(...) with the forwarding (to the constructor) done in a way that's appropriate to the C++-version in use (perfect forwarding in C++11+, hypertemplated overloads in C++<11).

    That means that the only arguments are about snake_case versus camelCase, and whether make_shared<Assignment>(...) is better or worse than makeAssignment(...). I'm actually opposed, on the grounds of DRY, to having the function be a static member function of Assignment, and would much prefer it to be a namespace level function outside the class. It's not like it has to be a friend or anything stupid like that - it's just a forwarder-to-constructor.

    But the whitespace is definitely toothgrindingly stupid.

  • (nodebb)

    Sure be nice if there was a pretty-formatter you could run over your codebase and a source control diff engine that could intelligently ignore syntactically insignificant whitespace changes.

    Addendum 2025-02-05 09:30: I'd also like complete buy-in from my entire dev team on which format standard we use going forward.

    I also want a pony.

Leave a comment on “Whitespace: A Frontier”

Log In or post as a guest

Replying to comment #:

« Return to Article