DEV Community

Discussion on: The dichotomy of writing and reading object-oriented code

Collapse
 
royhobbstn profile image
Daniel Trone

This is exactly my thought process as well, though I write JavaScript rather than Java, so I refactor heavily to small functions and modules. Writing custom Class-like objects with methods and _hidden properties that are more than just data structures is a completely unnatural paradigm to me. I've often wondered if this is a consequence of being self-taught or if this is 'just the way I think'.

Collapse
 
developerscode profile image
Ka Wai Cheung

Good to know I'm not alone :)

I'd guess that it's the way most people perceive the world. You have a thing you need to build and you build it in the way you interpret it in your mind - which is fairly linearly. In a strange way, you're the sole "object" at play at the time you create that code. Refactoring into OO is kind of like looking back in the rear view mirror and thinking about driving down that path again, but letting the real "objects" do the work.