Hacker News new | ask | show | jobs
by eru 3571 days ago
May I ask why you want to learn OOP? You don't need it at work right now, and you'll probably never need it. Not even in interviews.
6 comments

It's still very relevant in the job market. Probably upwards of 50% of jobs are going to want you to know OOP, and many of those will cover it explicitly in technical interviews.
To be a better programmer?

I don't think I'll ever work in a purely functional language, but I still took an online course to learn something about functional approaches. It was great; it has definitely changed how I program for the better.

Yeah, I was going to say, OO is brutally overused and seems to be fading quite quickly in the new world of highly scalable systems, e.g. Spark, CouchDB and so on. Objects still have a place in widget sets, datetimes, etc.

Overall though they were often used by default where there were better ways and just as often abused to allow a ton of shared state (globals in disguise), which almost always makes code harder to follow.

That's definitely true. I think classic OO works a lot better in a context where objects are relatively long-lived.

The problem is that the way most modern systems are scaled, they are very short lived. When the purpose of a code base is to turn HTTP requests into SQL queries and SQL results into HTML responses, then the objects end up being a thin layer between function calls.

That's not a necessary outcome; in a parallel universe something like Prevayler would have given us long-lived object graphs in a lot of the places where we now use OO languages on top of external databases. But that's sure not the world we live in.

Another factor that I think made things worse was the massive increase in the number of programmers during the Internet boom. I love working with code from master OO developers, especialy those of the test-driven, domain-driven sort. But OO approaches allow so many degrees of freedom that it's easy for relatively junior developers to make giant messes. Messes that I don't even think of really as OO, just snarls that happen to be in OO languages. Regardless, I think the September That Never Ended kept the average OO code base in a state much worse than the best ones.

Anyhow, I'm excited to see the state of practice moving forward, inch by inch.

What? http://githut.info/ 5 out of the 6 top languages on Github are OOP(not counting CSS). And PHP still supports OOP. Pretty much if you want to create an app for web/mobile/desktop with one of the most common languages you are going to end up using OOP. How can you "never need it"?
By and large, the party line on HN is that everybody does (or should be doing) functional programming and / or lisp.
Which really does not reflect reality at all. Outside of research/education, and stuff hobbyists are doing, FP typically isn't typically used alone. Some ideas are just borrowed from it and sprinkled onto OO languages to make things a bit nicer. FP has a lot of good ideas, but that doesn't make it reasonable to assume that it's all you need to know, or even the most important thing for you to know.
I didn't say it was an accurate reflection of reality.
I didn't think you did, was just commenting on what you'd mentioned.
Yeah, I don't know where all these people have worked where they think that OOP is dead. OOP is very well suited to many problems that businesses face and until something comes along to change that then OOP will be used heavily.
I don't need to be able to drive at work right now. I'll probably never need to do it in an interview. Does that mean that I shouldn't try to get better at it?
Funny, pretty much every interview I've been through (20+) kicked off with simple OOP principle questions.