6 votes

Fifty Shades of OOP

5 comments

  1. [2]
    stu2b50
    Link
    IMO it's mainly inheritance chains that have really become hated. Modern programming, including in corporate Java, mainly favors composition and dependency injection and value classes.

    IMO it's mainly inheritance chains that have really become hated. Modern programming, including in corporate Java, mainly favors composition and dependency injection and value classes.

    7 votes
    1. first-must-burn
      Link Parent
      Composition over inheritance was something I learned from Effective Java by Joshua Bloch in the nid- 2000's. One of the only programming books I've actually read cover to cover. So many useful ideas.

      Composition over inheritance was something I learned from Effective Java by Joshua Bloch in the nid- 2000's. One of the only programming books I've actually read cover to cover. So many useful ideas.

      4 votes
  2. [2]
    Akir
    Link
    Should I be on lobste.rs? It seems like half of all programming related stuff that gets posted here is in response to some (usually very unhinged sounding) arguments being made there.

    Should I be on lobste.rs? It seems like half of all programming related stuff that gets posted here is in response to some (usually very unhinged sounding) arguments being made there.

    6 votes
    1. trobertson
      Link Parent
      Probably, yeah. Ever since HN degraded* I've been going to lobste.rs/active for programming discussion. Actual practitioners and academics talking shop, divorced from big-corp motives and...

      Should I be on lobste.rs?

      Probably, yeah. Ever since HN degraded* I've been going to lobste.rs/active for programming discussion. Actual practitioners and academics talking shop, divorced from big-corp motives and bullshit.


      * HN users/posts nowadays are 30% fascist, 50% hype/shill/ads, 10% worthwhile, and 10% oblivious to just how bad it's become. dang, in particular, is the poster child for the latter group.

      2 votes
  3. first-must-burn
    Link
    What a nice read. Having not seriously touched Java or C++ in many years, it was a bit of a nostalgia trip for me. It also reminded me of some truly awful OOP code I have written. I think the real...

    What a nice read. Having not seriously touched Java or C++ in many years, it was a bit of a nostalgia trip for me. It also reminded me of some truly awful OOP code I have written.

    I think the real reason to lean away from these languages is they are simply too complicated and flexible. I spent the better part of a year trying to parse arbitrary C and C++11 code and generate automated tests for it. It was a nightmare. Every time we tried the tool on new code, we found new usage patterns that we hadn't considered. Basically what I learned is there is no limit to the weird shit people can write in C/C++.

    I like Go because it's very opinionated about almost everything, which brings a certain homogeneity to the code, making it easier to read and maintain. You can get this for other languages with style guides and opinionated code reviews, but it saves a lot of time (and arguing) to have it built into the language.

    I don't know if there are any modern tools that fix this, but my other beef with C/C++ (and to a lesser extent Java) is that it is truly an epic battle to create and maintain a build system. Sometimes it feels like it requires as much code as the application itself. And the builds are so slow!

    5 votes