News for hackers. Stuff that matters.
Re:Ask HN: How to Learn OOP by eru on Wednesday September 14, 2016 @06:52AM (#12495607)
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.
Re:Ask HN: How to Learn OOP by jsmith0295 on Wednesday September 14, 2016 @07:10AM (#12495689)
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.
Re:Ask HN: How to Learn OOP by wpietri on Wednesday September 14, 2016 @09:28AM (#12496625)
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.

Re:Ask HN: How to Learn OOP by jambox888 on Wednesday September 14, 2016 @11:56AM (#12498242)
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.

Re:Ask HN: How to Learn OOP by wpietri on Wednesday September 14, 2016 @09:38PM (#12502718)
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.

Re:Ask HN: How to Learn OOP by duiker101 on Wednesday September 14, 2016 @08:09AM (#12496033)
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"?
Re:Ask HN: How to Learn OOP by GFK_of_xmaspast on Wednesday September 14, 2016 @09:30AM (#12496637)
By and large, the party line on HN is that everybody does (or should be doing) functional programming and / or lisp.
Re:Ask HN: How to Learn OOP by jsmith0295 on Wednesday September 14, 2016 @11:51AM (#12498184)
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.
Re:Ask HN: How to Learn OOP by GFK_of_xmaspast on Wednesday September 14, 2016 @03:07PM (#12500242)
I didn't say it was an accurate reflection of reality.
Re:Ask HN: How to Learn OOP by jsmith0295 on Wednesday September 14, 2016 @09:26PM (#12502676)
I didn't think you did, was just commenting on what you'd mentioned.
Re:Ask HN: How to Learn OOP by tdb7893 on Wednesday September 14, 2016 @01:24PM (#12499221)
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.
Re:Ask HN: How to Learn OOP by rkangel on Wednesday September 14, 2016 @07:01AM (#12495650)
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?
Re:Ask HN: How to Learn OOP by 0xfeba on Wednesday September 14, 2016 @10:10AM (#12496987)
Funny, pretty much every interview I've been through (20+) kicked off with simple OOP principle questions.