News for hackers. Stuff that matters.
Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @01:33AM (#17504662)
His advice is sage and you should look past whatever deficiencies you find in his form of communication. Simply put there's always bigger fish to fry, and virtual methods are a quick and easy way to implement test stubs. Especially when the compiler devirtualizes.
Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @01:37AM (#17504680)
Well I had a response to that originally but his edits kind of changed how much sense my reply made in response. Here's what I had:

Performance is only one aspect of it. It also reduces code bloat, reducing the program's size footprint. Most tests (yes, I know, not all, but most) should not make it into the final binary users are running. I also don't see what's "hacky" about making a foo.test.cc file when I want an alternate implementation for foo.cc. It seems to be quite a positive and clear way to document the fact that an implementation is only needed for testing, and vice-versa. And not only that, but it reduces compile (& link) times, since you only need to compile one of the two implementations for each use case.

Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @02:11AM (#17504788)
Yea all things being equal I'd choose your approach. But in an existing project that did things this way - it would be the last thing I'd touch. This is of course barring extreme circumstances - which profiling and other tools would identify.

Unfortunately a lot of C++ developers don't really understand how the linker works, and because of that the build system is black magic.

Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @02:30AM (#17504856)
Yeah, I wasn't suggesting they immediately dispatch a team for transforming everything into this. But at least from now on they could try to get people to use this pattern, and make the move gradually.
Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @03:55AM (#17505186)
I want to reiterate what I think the broader point is - If this is the most pressing problem you have a very highly functioning team. There's only so much bandwidth for change and I frequently see it get spent poorly.