5 ms·
Agreed. The biggest problem with OOPS lies in its original premise: that code and data should be the same thing! This is grevious error, IMHO, that leads to no
by mimixco 6y ago
Agreed. The biggest problem with OOPS lies in its original premise: that code and data should be the same thing!
This is grevious error, IMHO, that leads to nothing but problems: endless boilerplate code, lots of "interfaces" that essentially do nothing (that couldn't be done directly with said data), and debugging nightmares.
I much prefer to work with systems where code and data are separate and never the twain shall meet.
- michaelcampbell 6y agoOOPs original premise is homoiconicity? Really?
- throwaway894345 6y agoI'm not sure "code is data" necessarily means "homoiconicity", but it could mean "first-class functions" (or at least that's what I think of when I hear the phrase; maybe I'm wrong); however, I'm not familiar with anyone who argues that these are fundamental OOP features (perhaps Smalltalk had first class functions, but for a very long time the most popular flavors of OOP did not).
- _old_dude_ 6y agoyes, Homoiconicity is about having the same syntax for both structure and data. First class functions means there is no conversion, again at syntax level, between a function and a value. Mainstream languages all have a way to see code as data, it's function pointer in C, delegate and lambda in C# and first class functions in Python or JavaScript.
- throwaway894345 6y agoI understand the differences between homoiconicity and first class functions and even that modern languages often support them, but that support is typically an artifact of a functional (and not OOP) influence with the exception of function pointers in C whose origins im not sure about except that it doesn’t come from OOP. The point is that despite the confusion about “what does OOP mean, really”, there are no prominent arguments that suggest that homoiconicity or first class functions are defining characteristics.
- TOGoS 6y agoI'm pretty sure what was meant by 'code is data' is that a lot of OOP training encourages you to "bundle the code and the data in an object". People take that to heart, and...bundle code and data into objects. Whether or not those functions and that data really belong in the same object is an afterthought, if considered at all.
- winstonewert 6y agoI presume "code and data are really the same thing" is intended to refer to way that OOP binds code and data together.
- TheOtherHobbes 6y agoI'm not sure anyone really knows what OOP's original premise is. There are various legends, and they mostly conflict with each other.
- goatlover 6y agoIt was whatever Simula and then Smalltalk's goals were.
- MasonOfSpoons 6y agoIt feels a bit like a rhetorical device to discuss OOP in any context other than the version of Java that's currently in widest usage.
- prostodata 6y agoI think both conceptions are important. On one hand, some code is naturally related to certain data and hence we should accordingly design the program. On the other hand, complex and distributed programs have code which must be dynamically bound to different data. OOP focuses on only one aspect but does it very well. How to adequately support the opposite aspect is not clear. At least there are many ways how this can be done.
- tehjoker 6y agoThis reads like a rejection of von Neumann architectures. I don't think this is quite right. https://en.wikipedia.org/wiki/Harvard_architecture https://en.wikipedia.org/wiki/Harvard_architecture