3 ms·
'cleverness for its own sake' often makes it into standard practice later. And I seriously fail to see the 'for its own sake' here. This cleverness reduces the
by apk17 10y ago
'cleverness for its own sake' often makes it into standard practice later.
And I seriously fail to see the 'for its own sake' here. This cleverness reduces the number of moving parts, does the 'dont repeat yourself' and thus reduces ways modifications of the code could break it due to overseeing a case.
I just shuddered to think how this would be done in java - with a LinkUpdater interface, and a RootLinkUpdater and ElementLinkUpdater, and one instantiation per iteration, and suddenly we have a lot of code around to keep the active code's function simple - to a point where it is completely pointless because of adding a lot of machinery. (And java does collections differently anyway.)
- sidlls 10y agoI agree with you, about this specific example and in general. When I look back on my career, often when I've said something is "clever for its own sake" was only clever because of a lack of understanding on my part, and rarely for its own sake, outside of toys and obscurity competition where such cleverness is the point.