News for hackers. Stuff that matters.
Re:OOP Is Dead, Long Live OOP by Waterluvian on Thursday October 18, 2018 @02:02PM (#18250563)
I think this relates to what you're saying.

I've never felt any frustration that OOP feels like the wrong tool when I'm using languages that give me the choice to use it or not (like Python, and JavaScript). But when I'm using Java, as one example, it often feels like I'm really locking myself into a design up front.

In Python, especially. I'll find myself starting off all experiments or simple projects with functions and basic data types. As something evolves and I want some semantic clarity I'll stop using dicts and start using namedtuples. And then at some point I may replace the namedtuples with classes. From there I may discover value in having subclasses so I'll add a few (but this is exceedingly rare in my line of work).

Re:OOP Is Dead, Long Live OOP by std_throwawayay on Thursday October 18, 2018 @02:17PM (#18250712)
My experience with Python is largely the same. I often start with local variables in a script, then put some parts into functions, then start putting some shared/persistent data into dicts. If after some time a pattern emerges where I think "gee, wouldn't it be useful to pack these three variables that always occur together and interact with each other into a class and use some methods to consistently modify them?". Then I create a class that does some specific thing. This transformation occurs gradually over the development process and the data shapes the design of the application. I would call this process a prototype development. At the end I would have the knowledge about the design where I could start implementing it in Java or C++. But the problem is already solved well enough in Python and you almost never need to take the leap to another programming language.

The program is not good, the design is not well thought out and the implementation is not very clean. It is a design prototype that you use to write the real application. If only there were time for a fresh start. The solution that we have by that point is not perfect but it does three things: Actually solve the problem, solve it good enough for regular usage and it allows further modification with only minor pain.

I wish I could tell the full story but most software stories end before the grand finale.

Re:OOP Is Dead, Long Live OOP by Chabs on Thursday October 18, 2018 @02:05PM (#18250597)
But that's the whole point of JAVA. It's an opinionated platform with a hyper-standardized workflow. Sure, that limits creativity, but in many business contexts, the last thing you want is your programmers getting "cute".

There's a straight line from requirements to implementation; no meandering involved. At least that's the theory. In practice...

Re:OOP Is Dead, Long Live OOP by bunderbunder on Thursday October 18, 2018 @02:39PM (#18250947)
> But that's the whole point of JAVA. It's an opinionated platform with a hyper-standardized workflow.

That may have been where Java wanted to go, but, when I'm working in Java, I don't feel like that's where I am. Ways of doing things in Java tend to be wildly inconsistent from project to project. Partially, I think, because so much core functionality in the Java ecosystem was allowed to be federated out to 3rd-party projects for so long. Take the long-standing popularity (and rivalry) of Guava and Apache Commons for handling even basic tasks that are hard to get done using the core Java APIs. If there's such a thing as a "platform smell", I'd say that certainly qualifies.

With Python, on the other hand, there is a fairly consistent common understanding of what "Pythonic" means, and, even when there really is more than one way to do it, the question of which one to use can usually be quickly resolved to a predictable outcome by simply pointing out that one option is the more Pythonic way to do things.

(edit: Though, to be fair, Java was first released into a world where languages like C, C++ and Common Lisp represented the status quo. Expectations were lower at the time.)

Re:OOP Is Dead, Long Live OOP by mikmoila on Thursday October 18, 2018 @04:40PM (#18251916)
To be honest, I've never seen a problem I couldn't solve in easier way with core modern JDK libraries than with "3rd party" libraries.
Re:OOP Is Dead, Long Live OOP by bunderbunder on Friday October 19, 2018 @09:15AM (#18256475)
It's definitely gotten better over the past 5 or so years. But there was a lot of time spent acquiring technical debt over the preceding couple decades.

Even if I don't use Guava or Apache Commons myself, for example, I still occasionally run into dependency conflicts that I need to resolve with awful hacks like package relocation because so many other major libraries rely on one or the other, and neither library is a particularly great citizen about breaking changes.

Re:OOP Is Dead, Long Live OOP by madmax96 on Thursday October 18, 2018 @02:18PM (#18250718)
https://medium.com/stanford-d-school/want-some-creativity-cr...

It’s interesting - when you begin adding constraints, sometimes it helps solve the problem. You can’t be creative unless you’ve created a solution. It would be interesting to see the impact on this with programming languages.

Re:OOP Is Dead, Long Live OOP by jcoffland on Thursday October 18, 2018 @02:32PM (#18250872)
I'm glad I don't work places that try to keep me from being "cute".
Re:OOP Is Dead, Long Live OOP by kamaal on Friday October 19, 2018 @01:51AM (#18254466)
When faced with complexity you have to use with whatever 'opinionated hyper-standardized workflow' to build 'un-opinionated hyper-unstandardized workflows'. The net result is like trying to build sculpture with glass with chisel and hammer.

Its then you realize you had better started with clay.

Re:OOP Is Dead, Long Live OOP by Waterluvian on Thursday October 18, 2018 @02:07PM (#18250625)
Yes. That may very well be. And I'm not saying Java is bad because of what I described. Just that I experience the, "ugh OOP isn't helping me do what I want to do here" with Java.
Re:OOP Is Dead, Long Live OOP by std_throwawayay on Thursday October 18, 2018 @02:34PM (#18250901)
It probably is the right tool if you have an enterprise problem that needs an enterprise solution.
Re:OOP Is Dead, Long Live OOP by mikmoila on Thursday October 18, 2018 @04:58PM (#18252053)
According to my experience "enterprise problems" are more related to scalability, data integrity, APIs, and workforce hiring than "what programming paradigm to use."
Re:OOP Is Dead, Long Live OOP by xapata on Thursday October 18, 2018 @02:13PM (#18250678)
It was a hypothesis, not a theory. Usually a hypothesis is abandoned after so many counter examples.
Re:OOP Is Dead, Long Live OOP by ken on Thursday October 18, 2018 @05:21PM (#18252235)
> I've never felt any frustration that OOP feels like the wrong tool when I'm using languages that give me the choice to use it or not (like Python, and JavaScript).

Do you not miss more advanced features, like multiple dispatch? Do you just implement it ad-hoc when you need it?

I don't know any way to say it that doesn't come off sounding condescending, but this looks like the Blub Paradox to me. Python's brand of OOP is better than most, but it still feels pretty limiting to me. It doesn't even offer syntactic abstraction to make it easy to work around. You have to hope (as the 'multimethod' package does) that other features accidentally allow you to.

Re:OOP Is Dead, Long Live OOP by Waterluvian on Thursday October 18, 2018 @05:52PM (#18252477)
It's not something I've ever needed with such frequency that I wished it was in the core langauge. When I need it I just use a library that exposes it. I use a decorator based multidispatch.