Object-Oriented Programming is Bad

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 6 18:34:40 PST 2016


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.


More information about the Digitalmars-d mailing list