Sent from my iPhone On Jun 17, 2012, at 12:43 PM, Vinzent <ru.vinz...@gmail.com> wrote:
Data structure is an implementation detail... > It's not. Not in clojure. It is in OO, but clojure is not an OO language, so it's not an implementation detail in clojure. That is my point, representations SHOULD be considered implementation details, because representations change... if you treat them as contracts your code will break everywhere, if you wrap them with abstractions your code will only need to change in one place... But I have made this point before and starting to feel like the conversation is going in circles. I have made several reasoned arguments for getter functions... If you disagree thats fine. But the only well reasoned argument why one should not use them except that it adds an extra lines of code to maintain and imo LOC is a poor metric for maintainability. > interfaces are contracts, if the data representation changes in OO you > need only change one class... > Well, but if interfaces change? That's the same as data representation change in clojure. > This is exactly the point of my post, if you wrap keywords and treat them > as one does properties this could be a one liner in clojure too... > If you do this, you can't longer use sequence functions on your objects. You're hiding the data behind an additional API layer. Instead of maps, you now have pojos with getters\setters. This is wrong. I'm not blindly advocating the use of simple abstractions just because that > what some/many OO programmer suggests is best practice... but because > personal experience has given me enough conviction to believe they add > value even if they add a few LOC... And that it is worth arguing about a > bit... even if this means I am not "following" idiomatic clojure practices > that I disagree with. I don't agree with all OO practices either..mutable > collection types, excessive over engineering... All patterns have some > trade offs, but one LOC for a seam is well worth it imo. > Well, if you're writing clojure code in java style then your personal experience of course will be something weird and it'll lead you to such convictions. Also, I think following idiomatic practices is extremely important in any language. You can't write C code in java, java code in clojure, etc, because it'll be a mess. If you'd take chopsticks and try to use them as a fork because you used to forks and your personal experience tells you that fork is a convenient instrument then all you get is caustic remarks from those chinese guys at the next table. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en