3 ms·
That example is indeed more readable, but it still reads like methods on objects which is a fundamental issue for me. Any non trivial program written in an obje
by Annatar 9y ago
That example is indeed more readable, but it still reads like methods on objects which is a fundamental issue for me. Any non trivial program written in an object-oriented paradigm eventually becomes incomprehensible, whereas the functional approach doesn’t rely on the state machine model. Two different approaches. I didn’t care for objects back in 1990 and I certainly care even less for them now. I upvoted your example in appreciation for the effort you went through though.
- simias 9y agoI agree that for these types of constructs a more functional style could look better. That being said the OOP approach as the merit of reading in the proper order: you get your args, pick the 1st and then use that or the default "y" value. If you rewrite this to use function calls instead of methods you end up with something like: (or (cadr (args)) "y") Which is fine if you're used to lisp syntax but it's really a matter of taste at this point.