3 ms·
Honestly I think ease of use of a library is way more important than implementation elegance. How many people are ever going to look at your libraries source co
by overgard 9y ago
Honestly I think ease of use of a library is way more important than implementation elegance. How many people are ever going to look at your libraries source code? .001% of your users? I use the C++ stl every day, but if you look at the implementation it's basically horrifying, but I don't really care because the interface is straightforward and does its job.
My main issue with fluent interfaces though is you can end up with objects in weird half initialized states, and there's generally combinations of parameters that are incompatible which the type system can't help you with. The point of constructors is you don't end up with semi-initialized objects
- jlg23 9y ago> Honestly I think ease of use of a library is way more important than implementation elegance. How many people are ever going to look at your libraries source code? Poor idiots like me who get hired to help get the hard, last 10% done. Given the small percentage of projects that actually have a lifespan of more than a few months, I'd still chose usability (by devs) over elegance for prototypes or MVPs, but one should never forget that this can incur a huge technical debt. PS: I do not consider the article's proposed solution elegant - quite the contrary.
- overgard 9y agoWe probably don't disagree here, because "clever" interfaces generally annoy me, I just think in terms of priorities interface matters more than implementation elegance. A confusing implementation might waste a few people's time, but a bad interface can waste hundreds\thousands of peoples time. (if you ever worked with COM or Win32 apis you probably feel my pain)