3 ms·
> But there's a design pattern where nearly everything is returned as an exception. shudder The worst of cargo cults!
by gumby 5y ago
> But there's a design pattern where nearly everything is returned as an exception.
shudder The worst of cargo cults!
- catskul2 5y agoIs "cargo cult" really what you mean here. It doesn't seem to fit.
- gumby 5y agoYes, the blind following of "patterns" because you think that is what makes for "good code" is a perfect example. Especially when fitting the predefined pattern bends your implementation otherwise out of shape. A design pattern is a way of communication. If you turn it into a procrustean tool you don't even understand why they exist.
- ncmncm 5y agoMost design patterns are anti-patterns: they represent a failure of the language to offer a way to abstract the pattern into a component or native language construct. It is usually better if it can be captured in a library. But sometimes, particularly in weak languages, nothing but core language support will do. A fancy core language feature should embarrass the language designer. Sometimes, a language evolves to the point where a core feature could be as well implemented as a library component. That is a marker of real progress, because now the feature can be offered in a dozen variations in a dozen libraries, each tailored to local conditions, where the core feature had to ruthlessly ignore all but the most generic use cases.