News for hackers. Stuff that matters.
Re:How to do a code review by pitaj on Thursday September 05, 2019 @09:44PM (#20892293)
The quote, for people on mobile:

> A particular type of complexity is over-engineering, where developers have made the code more generic than it needs to be, or added functionality that isn’t presently needed by the system. Reviewers should be especially vigilant about over-engineering. Encourage developers to solve the problem they know needs to be solved now, not the problem that the developer speculates might need to be solved in the future. The future problem should be solved once it arrives and you can see its actual shape and requirements in the physical universe.

Re:How to do a code review by baby on Friday September 06, 2019 @12:55AM (#20893182)
Thanks!

I agree so much. Zero-cost abstraction is a misnomer.

Re:How to do a code review by uryga on Friday September 06, 2019 @07:17AM (#20894630)
isn't "zero-cost abstraction" shorthand for "zero-performance-cost abstraction"? i.e. computer, not human, performance?
Re:How to do a code review by baby on Friday September 06, 2019 @01:11PM (#20897498)
It is! Which is why I don’t like the term. It often masks the fact that it has a cost in complexity.
Re:How to do a code review by uryga on Friday September 06, 2019 @05:36PM (#20900135)
i've never read it that way! could you give an example of that?
Re:How to do a code review by ahartmetz on Monday September 09, 2019 @07:40AM (#20917183)
Two examples in C++: virtual method dispatch via vtable (in C you'd implement the same mechanism manually), templated generic code. C++'s generic data structures and algorithms are faster than C's because they don't have to use indirection through pointers. The compiler creates specialized code for each type instead. It causes binary size bloat, but execution time is low.
Re:How to do a code review by uryga on Tuesday September 10, 2019 @09:57AM (#20928224)
so what's the "cost in complexity" here? the complexity would be there whether you went with a a hand-rolled or "zero-cost" version (at least that's the idea), except the "zero-cost" version should require less code and thus be easier to maintain.