3 ms·
I'm a fan of fluent design myself, and dislike flags. return foo().baz().bar(); With flags you start with success/fail, and end up with HRESULT.
by snarfy 11y ago
I'm a fan of fluent design myself, and dislike flags.
return foo().baz().bar();
With flags you start with success/fail, and end up with HRESULT.
- copsarebastards 11y agoI'd agree with you in some languages, but in C this would be prohibitively difficult. In general, good fluent design uses immutable objects, which makes it basically just a syntactic sugar for functional programming. While fluent syntax is nice, the functional semantics are the real value, and are much easier to do in C (although, as soon as you add in memory management, functional programming often becomes prohibitively difficult too).