Timeline for Why is "tight coupling between functions and data" bad?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2013 at 22:13 | comment | added | Random832 | If you've got two different modules A and B that "bind together" a class C and an interface I, and pass the object to a function F that expects that interface, then how does F know whether to use A or B when operating on that C? The only way is to use a wrapper object - even if there aren't two modules, the only way for F to find the "binding" module is to pass it an object that knows about it (i.e. the wrapper object) | |
S Sep 25, 2013 at 14:47 | history | edited | CodesInChaos | CC BY-SA 3.0 |
Fixed "can can't" typo
|
S Sep 25, 2013 at 14:47 | history | suggested | itsbruce | CC BY-SA 3.0 |
Fixed "can can't" typo
|
Sep 25, 2013 at 14:45 | review | Suggested edits | |||
Sep 25, 2013 at 14:47 | |||||
Sep 25, 2013 at 14:09 | comment | added | Jörg W Mittag | @jozefg: I'm talking about Abstract Data Types. I don't even see how Algebraic Data Types are remotely relevant to this discussion. | |
Sep 25, 2013 at 14:00 | history | edited | CodesInChaos | CC BY-SA 3.0 |
added 41 characters in body
|
Sep 25, 2013 at 13:59 | comment | added | daniel gratzer | @CodesInChaos Then perhaps clarifying this as "static class based OO" | |
Sep 25, 2013 at 13:56 | comment | added | CodesInChaos | @JörgWMittag My impression is that many who criticize OOP criticize the form of OOP used in Java and similar languages with its rigid class structure and focus in instance methods. My impression of that quote is that it criticizes the focus on instance methods and doesn't really apply to other flavours of OOP, like what golang uses. | |
Sep 25, 2013 at 13:56 | comment | added | daniel gratzer | @JörgWMittag I think you meant Algebraic datatypes. And CodesInChaos, Haskell very explicitly discourages what your suggesting. It's called an orphaned instance and issues warnings on GHC. | |
Sep 25, 2013 at 13:48 | comment | added | Jörg W Mittag | You can do that easily in Scala. I'm not familiar with Go, but AFAIK you can do it there also. In Ruby, it is quite common practice as well to add methods to objects after the fact to make them conform to some interface. What you describe seems rather like a badly designed type system than anything even remotely related to OO. Just as a thought experiment: how would your answer be different when talking about Abstract Data Types instead of Objects? I don't believe it would make any difference, which would prove that your argument is unrelated to OO. | |
Sep 25, 2013 at 13:26 | history | answered | CodesInChaos | CC BY-SA 3.0 |