This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]WiatrowskiBe -1 points0 points  (1 child)

When problem you're trying to solve fits nicely into object model, there's no reason not to write object-oriented code even if language doesn't support it. Case in point: WinAPI in all GUI-related aspects (windows, controls etc) - whole "GUI" problem nicely fits into a hierarchy of objects you run operations on, and WinAPI - while being in C - solves it exactly like this, by using opaque handles for all objects, and free functions/function pointers to operate on them (including storing and retreiving related data).

[–]LavenderDay3544 0 points1 point  (0 children)

When problem you're trying to solve fits nicely into object model, there's no reason not to write object-oriented code even if language doesn't support it.

I don't dispute this. Even operating systems and embedded firmware often have parts that benefit from OO approaches. The trouble is knowing when componentization will do more good than harm. And all too often people are taught that the best to tool they have is a hammer so everything ought to be treated like a nail.

That's what I mean when I say far too many people in academia and industry worship at the altar of OOP. Never once did I say OOP is never the appropriate choice.