by joncampbelldev · 8y ago · 0 comments
I am also a little unsure what you mean by not worrying about default. Even polymorphism has to deal with this, if you call a polymorphic method on an object that doesn't implement that interface you'll get at best a compile problem, at worst a cast exception. This is why some languages provide support for a "default" or "method not implemented" hook in polymorphism.
If you are arguing that polymorphism is a better way to build systems than switch/case statements then no argument here. Open constructs like polymorphism are far better for growing and evolving large systems over time.
That doesn't mean we should exclude a nice way to say "i've got a variable that i want to translate to some other value in a few different ways".
My point was only that it just seems so silly to me that everyone is discussing whether this syntax is "best" or how it "doesn't do X, Y or Z", because I remember doing that too before Rich Hickey (angelic choir noises) showed me that actually you don't have to put up with that shit. Just use a language that puts syntax extension in the hands of it's community and let them figure it out without burdening the core language with a thousand little tradeoffs for the 90% use case.
The downside of that is that some Lisp projects can only be understood by the original authors, during the time they were actually active on it.
I have seen a few that went DSL crazy with macros.
Scalaz is another "good" example of that.