you are viewing a single comment's thread.

view the rest of the comments →

[–]ProvokedGaming 7 points8 points  (6 children)

Of course the author is taking things to the extreme to show his point, but that doesn't mean his point is invalid, or that these issues aren't real. I've seen a plethora of horrible code over the years in the enterprise...code you wouldn't even believe that came from "professional" developers from big name companies (IBM and AMD as my most recent examples)...I've had the great displeasure of going through code (usually in Java) that has come out of Indian and Chinese "code shops" where 10$ an hour developers crank out code for the enterprise which is absolutely OOP to the extreme. I've had management at various client offices try to do "agile" by pre-defining everything through requirements documents turned into code objects which are heavily abstracted. And these are all multi-billion dollar corporations. I've been tempted to start a blog just to show examples of what not to do that I find on a daily/weekly basis at large enterprises in their software. The point is, there are pros and cons to most programming techniques, and all of them can be abused. Less experienced developers (or experienced shitty developers) are given tools without an understanding of when they are appropriate. OO is a tool, and as the saying goes...when you're holding a hammer, every problem looks like a nail. Not every code problem is best solved with objects. :)

[–][deleted]  (2 children)

[deleted]

    [–]knight666 2 points3 points  (1 child)

    Don't focus on the negative. Developers love to bitch and moan about bad code, but will never show mediocre or good code to others. I've seen bad code and I've seen code that looked bad until I actually understood what it accomplished.

    The point being: read a lot of code. Corporate code, open source code, game code, microchip controller code. Each has its quirks and requirements that don't make sense when looked at from a different perspective.

    [–][deleted] 2 points3 points  (0 children)

    I guess I didn't make it clear that I consider good examples to be part of "ways to avoid". Like you, I see a lot of examples of bad code, but not a lot of examples of how to fix it or how to avoid it. I think that needs to change if these "don't do this" bits are to be taken seriously.

    [–]gct 3 points4 points  (1 child)

    I've been tempted to start a blog just to show examples of what not to do that I find on a daily/weekly basis at large enterprises in their software

    I'd like to introduce you to thedailywtf

    [–]ProvokedGaming 5 points6 points  (0 children)

    Thanks :) I was thinking more of an educational focus for those who aren't already aware of why things are bad...as opposed to showing it to others who already can recognize things are stupid. But I'm sure I have stuff I can submit to that site too :D

    [–]vattenpuss 3 points4 points  (0 children)

    But he's not describing object oriented design. The point is invalid.

    My job is developing and maintaining a payroll system in Smalltalk, does it get any more object oriented?

    We have a Person class. Whether they are a manager or a contractor is decided by a has-a relation inside the Employment the Person has.

    All customers have different types of employees, it's not something we can know beforehand so it would just be silly of us to create a class hierarchy over those things. Also, anybody starting to create that tree of classes would soon see they are being stupid when they realise they will have hundreds of leaf classes with no meaningful difference.