www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Object-Oriented Programming is Bad

reply sigod <sigod.mail gmail.com> writes:
Video: https://www.youtube.com/watch?v=QM1iUe6IofM
Article: 
https://medium.com/ brianwill/object-oriented-programming-a-personal-disaster-1b044c2383ab

Interesting talk. Especially given that my D code tends to be 
structured very similarly to what Will suggests.
Mar 06 2016
next sibling parent Chris Wright <dhasenan gmail.com> writes:
On Sun, 06 Mar 2016 20:33:39 +0000, sigod wrote:

 Video: https://www.youtube.com/watch?v=QM1iUe6IofM Article:
 https://medium.com/ brianwill/object-oriented-programming-a-personal-
disaster-1b044c2383ab
 
 Interesting talk. Especially given that my D code tends to be structured
 very similarly to what Will suggests.
The article didn't make it to suggestions (besides "no OOP ever"), and the video was too boring for me to pay any attention. The one example he did give was pretty unconvincing. "Should a Message send() itself?" Messages can be sent to any of a variety of places, so you need to send an endpoint along. An endpoint comprises some amount of data to specify where it's going, and it might be a pointer to memory shared between processes, or a URL for a REST interface, or a socket file descriptor, or... You could pass just that data along, probably as a discriminated union, and have a send() function that specializes based on which value is passed. But it's simpler and more extensible to use an interface and implementations.
Mar 06 2016
prev sibling next sibling parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Sunday, 6 March 2016 at 20:33:39 UTC, sigod wrote:
 Video: https://www.youtube.com/watch?v=QM1iUe6IofM
 Article: 
 https://medium.com/ brianwill/object-oriented-programming-a-personal-disaster-1b044c2383ab

 Interesting talk. Especially given that my D code tends to be 
 structured very similarly to what Will suggests.
Perhaps interesting, but also annoying and backwards. OOP was developed in Simula in 1961-1967 by Nygaard and Dahl. Dijkstra wrote about structured programming in the late 60s, and Dahl, Dijkstra and Hoare coauthored the book "Structured Programming" in 1972... If OOP turns into a personal disaster it probably is the result of not actually trying to implement an OO-model, which is the purpose of having OO mechanisms in a language. However, nobody has ever suggested that you should only do OO modelling, and you can implement an OO model in most languages, even C. OO-modelling is a tool. *shrugs*
Mar 06 2016
prev sibling parent Era Scarecrow <rtcvb32 yahoo.com> writes:
On Sunday, 6 March 2016 at 20:33:39 UTC, sigod wrote:
 Interesting talk. Especially given that my D code tends to be 
 structured very similarly to what Will suggests.
It's pretty good. I'm reminded of my short time working in a tech company where we did Java programming. There were multiple things that annoyed me. First was EVERYTHING was an object. That didn't make sense for logically passing just data as a block together, say 3D points as x,y,z, where you'd end up making a final class holding nothing but those three types, and no functions just so you could sort of emulate a struct. Another annoyance was the main function which had to break the OO requirements by making a class with a static main you could then call. It never quite felt like it fit. They also pushed making all members publicly accessible via getters and setters. So you'd have a lot of code like this: Class X { private: int a; public: int getA(){return a;} void setA(int A){a=A;} } Finally, the last large annoyance was working on Web Programming. We'd end up doing a combination of either ASP or JSP. It was modeled in 4 layers (UI, Logic, Business, Database) where often in the UI layer you'd immediately drop 2-3 levels and talk directly to the Database. Didn't help how they wanted every call to get data from the database, and a simple calendar/timesheet application did like 50 calls per page to the database making it take FOREVER, i think 30 seconds? We knew if it was that slow for 1 person, having the entire company using it with 600 employees it would totally suck.
Mar 06 2016