2 ms·
Chaining works well in builder objects and perhaps in some GUI programming or some other very specialized cases but most of the classes I write don't have suffi
by avl999 5y ago
Chaining works well in builder objects and perhaps in some GUI programming or some other very specialized cases but most of the classes I write don't have sufficient mutable state to make this kind of thing worth it.
My advice would be to almost always start with a void (unless builder objects) and then add chaining if the evolution of your API dictates that chaining together calls would be a common enough usecase.