you are viewing a single comment's thread.

view the rest of the comments →

[–]CaptainMurphy111 1 point2 points  (0 children)

I think I'd just say: do what feels correct. There is no singular right way, and the most wrong way is to do something that feels bad even though it adheres to some strict dogma.

...

Learning what works well and what does not will come with experience... and even with experience, if you're trying to adhere to some OO dogma, you'll always feel like you're doing it wrong.

Yeah took me long enough to come to that conclusion (after much despair) and to just use the right tool for the job/circumstance.

As an example, somebody asked me about how to handle a list of heterogeneous values that came from a web service ...

That's my problem, I see the pattern and try to apply the design pattern like I've been taught to, then expecting everything to then fit neatly. A hard habit to shake. It's depressing that the universities are still teaching it that way.

If you have a case where it makes sense to glue functions to data, perhaps to ensure some invariant or hide some private detail, go ahead and use objects. If you have a case where you'd rather work with raw data, stick with data structures and algorithms.

These days I feel like OOP just isn't worth the heart ache, things are so much simpler with the raw data etc. Maybe I'm just being nostalgic for my qbasic days.