I don't know how many advances might be happening recently on some underground Smalltalk mailing-list, but in general, OOP has remained the same for decades.
Does everybody think it's good enough? Does nobody want new features that will make your code more expressive somehow? Watcha think?
Name:
Anonymous2012-05-06 2:09
Does nobody want new features that will make your code more expressive somehow?
What does this have to do with object-orientation?
Name:
Anonymous2012-05-06 2:12
OO is one way of designing your system. It has strengths and weaknesses for different types of problems. You're supposed to use OO design when the strengths of OO design to the problem are more valueable than the weaknesses of OO design to the problem.
Name:
Anonymous2012-05-06 2:12
OOP is not only about code reuse (I take it you're thinking about it?); it's also about modelling the real world problem in a coherent way inside a program.
I know. I'm going to admit I haven't studied many other paradigms, but I surely believe there are improvements that could be made to OOP.
For example, not all relationships in the world can be expressed as HAS-A / IS-A, and I shouldn't have to dump OOP just because of that.
I personally consider something I call "private IS-A"; basically that would be an interface to an object that can only be acquired under certain circumstances.
The whole point is, I don't usually see people talking about what could be improved in OOP or added to it. People just talk about using OOP. Where's the metathinking?
Name:
Anonymous2012-05-06 2:21
>>5
All the mental effort is dedicated to solving problems using the tools available instead of doing analysis to the tools.
Is that just an observation on reality or is it the way you think things should be?
Name:
Anonymous2012-05-06 2:30
>>7
It's an observation. There are too many things to do if we spend time analysing the tools we use. This is why there we focus our efforts on a couple of disciplines: theoretical computer science, software engineering, electrical engineering, computer engineering, IT administration, etc. It's quite possible to create all sorts of tabulated data regarding the tools we use, but that sort of work is generally a theoretical field of study. People do theoretical work so that other people can take the lessons of that study and solve practical problems with it.
There are lots of wildly different paradigms for wildly different problem domains. But not so much overlapping (you'd have noticed if you really read that page). Are you telling me the amount of information on that page scares you so much you believe it's *gotta* have all the solutions to all the problems I might have encountered?
You'll notice... if you look closely, that I'm talking about OOP here, and stuff close by (Aspect-oriented programming, for one). The philosophy of functional programming won't help me (much); so that cuts a lot of possibilities, and the remaining ones I at the very least know the philosophy... but it also didn't help. That's why I'm talking about enhancing OOP.
Name:
Anonymous2012-05-06 4:15
>>11 Does everybody think it's good enough? Does nobody want new features that will make your code more expressive somehow?
The point is that the general population are taught to use tools, not think about them. This is also applicable to skilled fields like programming and system design.
The philosophy of functional programming won't help me (much)
you might have a different viewpoint if you were more familiar with functional programming. Even if you aren't using a restrictive language that forces no side effects, you can still apply the philosophy in other normally non-functional languages. And it can have very nice pay offs. For example, it may be nice to keep some data structures immutable if they are going to be accessed concurrently. And it may pay off to think in terms of mapping and reducing with higher order functions if you are going to take advantage of parallelism for crunching data. But this all depends on what problem you are currently trying to solve. The perks I mentioned wont be relevant if the application is single threaded, for example.
Yeah, some functional functions are really interesting, and I like mixing imperative languages with them. It's really bliss. But that doesn't really solve object-oriented programming problems (they solve and express algorithmic stuff really neatly, but it's completely unrelated to object-oriented architectures, which is what I'm aiming).
Name:
Anonymous2012-05-06 6:43
>>14 But that doesn't really solve object-oriented programming problems
So the object orientation actually creates more problems instead of helping you solve them?
OOP is useful when it works well. In excess, or superfluousness, it becomes mental masturbation.
I see programming as the bridge between the problem and the solution. Thus, all code you write should be directly to get you to the solution and not anywhere else.
I think it's naive to believe you're going to solve a complex problem just walking a straight line. Try that, and you'll end up like Rasmus: "I just kept adding the next logical step". That's the main reason why PHP is such a shit.
If your system is complex and you don't take the time to architect it well, you won't go too far before regretting that mistake. Or just being stupid and thinking that "well, programming is really hard, right?"... >__>
Why does this thread even have any replies? >>1 took a semester of Java at his community college and think that makes him qualified to talk about programming paradigms. Things should have ended with that realisation.
>>21
This is one of the endless shit threads. It's worse than homework threads, because at least the people posting those are trying to do their homework. This guy just decided he was better than his teachers and stopped paying attention entirely.
>>24
Yes, saying PHP is shit is SO BRAVE and many people on /prog/ are going to disagree with it. Clearly.
Go back to /r/programming (or /pr/, if that still exists; I hope not).
Phew, well, I'm happy you agree then. You see, a lot of stupid people believe PHP is good, and given the sudden shitstorm I thought I might've hit some idiot like that.
Btw, as I'm sure you've noticed I'm a newfag, so I really don't know what people like or don't around here just yet.
Name:
Anonymous2012-05-06 11:12
>>1
Roles/Traits/Mixins are the solution. Scala, Perl6, Ruby, D and many others are supporting class composition, some even at runtime.
What I would love to see is something very simple: syntax for message composition, a la Smalltalk's semi-colon, so that I could do this:
// hypothetical java extension in which the pipe is a method composition operator
RacialStereotype nigra = new RacialStereotype();
// instead of
// nigra.setFavoriteMusician("Lil Wayne")
// nigra.setFavoriteFood("watermelonz an da fried chickenz")
// nigra.setFavoritePasstime("smokin bluntz wif muh niggaz");
// we can do
nigra.setFavoriteMusician("Lil Wayne")
| setFavoriteFood("watermelonz an da fried chickenz")
| setFavoritePasstime("smokin bluntz wif muh niggaz");
Is that so much to ask from an "OO" language?
>>34
Just define your void methods so that they always return self. Then you can do shitty_example.stupid_pattern1('a').stupid_pattern2('b').stupid_pattern3('c'). You could even do that in Java, I'm pretty sure.