
Ask HN: I'm rubbish at (and hate) OOP – any hope for a career in web dev? - immutable-progr
Throwaway account. No matter what, I know I will never be good at OOP - at least not in the classical sense of creating classes and formulating getters and setters etc. I hate it. And I&#x27;m crap at it too. I can do procedural (modular and well-organised), but not functional.<p>I want to do server-side web development where OOP languages dominate. I know I can program in a non-OOP way, but no-one will take me seriously will they? Be totally honest, you wouldn&#x27;t highly regard someone who only ever programmed Ruby or Python in purely procedural code. Can you even point to a highly-regarded repo on Github in those languages purely in procedural? Yep, didn&#x27;t think so.  Is there even a popular library or package in those languages that are  written in a non-OOP way? Yep, didn&#x27;t think so again. Even PHP has long embraced OOP and no-one expects procedural - unless it&#x27;s bad procedural.<p>What are your honest opinions? I don&#x27;t mind if they are blunt.<p>Edit: thank you everyone for your comments and encouragement :-) One thing I forgot to mention is that for learning popular web development languages, it is difficult to come across non-OOP frameworks or large, popular (but well-written) non-OOP open source projects. It always feels like having to poorly translate from one model (OOP) to another. I realise this may be the wrong approach. But when you&#x27;re learning, you can&#x27;t avoid studying other projects (even if you don&#x27;t fully understand them!) - and they inevitably tend to be OOP.
======
mlthoughts2018
I work in machine learning, and on my team we generally avoid OOP in Python,
and we take great effort to avoid inheritance and abstract base classes when
we do use object-oriented designs.

In general, writing boring modules of functions with slight functional style,
occasional metaprogramming, and lightweight classes, has worked extremely well
for us. I would probably call our approach "module oriented design" because
tend to think of modules as cohesive clusters of functions and topical little
data structures (mostly just namedtuples, possibly using new dataclasses when
we get around to it).

The main times we invest much effort in custom classes tend to be times we are
wrapping or extended third-party tools that themselves chose OOP, and their
intended extension mechanisms involve inheritance. Think of writing a custom
Filter for logging, or custom Layers in Keras.

We don't like OOP in those cases, but we find it's better to stick with the
convention of the library you're using, than to try to force it to fit into a
different approach you like.

But overall, I've worked on many multi-thousand line codebases in Python,
often with web service wrappers around them, that are just collections of
modules with plain functions.

When I see this, I definitely would respect that development choice, and would
believe it has a lot of upsides favoring it.

Of course, I would also say that in the hands of skilled OOP developers, OOP
solutions are also good and also have upsides. If I found myself on a team
where OOP was the established lingua franca and people delivered good projects
with it, I would try to adapt to that.

------
bsg75
I have been using Python since version 1.5, and while not in web dev (I run a
data team: ETL, BI, viz), I never went OOP in Python and do just fine. We
write code in Go too, which has a growing presence in web dev, and is not OOP
at its core, compared to something like Java.

Where I can't speak to the development of code interacts with browsers,
procedural code and limited functional paradigms (apply like operations in
Pandas, and dplyr in R) are still very useful. IMO it depends largely on the
teams you would work with. A shop that has people or code with a strong OO
foundation won't be a good fit. Bluntly, I believe OOP is over used in _some_
cases. Like all successful approaches it has good and bad applications, the
latter not a barrier to widespread misuse.

Maybe instead of picking a segment of coding (web dev), find one where the
tools and techniques fit your preferences. If web dev or front end is
dominated by what you dislike, pick one that has opportunities where you fit?

------
pinewurst
I think you're being too harsh. I've never programmed Python in any way other
than procedural and it has never been a problem. I do have a thing for a more
functional style but abhor OO. It's one of the beauties of Python to me that
it works well for so many paradigms.

------
jstewartmobile
Make a product. Sell it. Customers could care less about which CS fashion
statement you subscribe to--as long as it results in a good product.

