▲ | smikhanov 6 hours ago | ||||||||||||||||
If this is indeed this simple and this obvious, why didn't other languages followed this way? | |||||||||||||||||
▲ | diggan 6 hours ago | parent | next [-] | ||||||||||||||||
That particular quote is from the "Epigrams on Programming" article by Alan J. Perlis, from 1982. Lots of ideas/"Epigrams" from that list are useful, and many languages have implemented lots of them. But some of them aren't so obvious until you've actually put it into practice. Full list can be found here: https://web.archive.org/web/19990117034445/http://www-pu.inf... (the quote in question is item #9) I think most people haven't experienced the whole "100 functions on 1 data structures instead of 10 on 10" thing themselves, so there is no attempts to bring this to other languages, as you're not aware of it to begin with. Then the whole static typing hype (that is the current cycle) makes it kind of difficult because static typing kind of tries to force you into the opposite of "1 function you can only use for whatever type you specify in the parameters", although of course traits/interfaces/whatever-your-language-calls-it helps with this somewhat, even if it's still pretty static. | |||||||||||||||||
▲ | electroly 3 hours ago | parent | prev | next [-] | ||||||||||||||||
"APL is like a diamond. It has a beautiful crystal structure; all of its parts are related in a uniform and elegant way. But if you try to extend this structure in any way - even by adding another diamond - you get an ugly kludge. LISP, on the other hand, is like a ball of mud. You can add any amount of mud to it and it still looks like a ball of mud." -- https://wiki.c2.com/?JoelMosesOnAplAndLisp | |||||||||||||||||
▲ | marcosdumay 5 hours ago | parent | prev | next [-] | ||||||||||||||||
Because it's domain specific. If you push this into every kind of application, you will end-up with people recreating objects with lists of lists, and having good reasons to do so. | |||||||||||||||||
▲ | exe34 6 hours ago | parent | prev [-] | ||||||||||||||||
some of us think in those terms and daily have to fight those who want 20 different objects, each 5-10 deep in inheritance, to achieve the same thing. I wouldn't say 100 functions over one data structure, but e.g. in python I prefer a few data structures like dictionary and array, with 10-30 top level functions that operate over those. if your requirements are fixed, it's easy to go nuts and design all kinds of object hierarchies - but if your requirements change a lot, I find it much easier to stay close to the original structure of the data that lives in the many files, and operate on those structures. | |||||||||||||||||
|