[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What exactly is wrong with Object Oriented Programming?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 25
Thread images: 3
File: oop.jpg (17 KB, 589x362) Image search: [Google]
oop.jpg
17 KB, 589x362
What exactly is wrong with Object Oriented Programming?
>>
File: ZgoSt7Q.jpg (67 KB, 1024x576) Image search: [Google]
ZgoSt7Q.jpg
67 KB, 1024x576
Your mom
>>
It's mostly used incorrectly. Subclassing things based on taxonomy and not code.

Also, most OOP languages don't even have any notion of covariance or contravariance.
>>
>>52017836
in theory its pretty good idea
in practice no language implements it perfectly.
its also like a kind of cancer, its very easy to get swept up and refactor everything into its own class unnecessarily.
like everything, it has its place.
someone else post the kite example please
>>
>>52017893
>>52017898
Is C# an example of doing OOP correctly?
>>
>>52017908
No, it's nothing special.
>>
>>52017861
Dr Juggs! That's a (jizz) blast from the past. Magnificent.
>>
>>52017908
C# is a good example of doing everything badly

if you want a good implementation of oop stick to pseudocode
>>
>>52017836
OOP is popular and effective, so naturally /g/ is vehemently opposed to it.

see >>52017935 for example
>>
>>52017935
>C# is a good example of doing everything badly

In what way?

C# is easy and effective to use, pretty much anyone who has used it agrees.

>>52017966
Good point. Forgot how contrarian /g/(and all of 4chan) was.
>>
well /NEET/?
>>
File: 1426357554598.png (152 KB, 1948x858) Image search: [Google]
1426357554598.png
152 KB, 1948x858
>>52017836
it's bollocks
>>
Its not bad but all real programmers moved on to a data oriented approach anyway.
>>
>>52018331
What is
>define private public
>>
>>52018363
DOD isn't really an alternative to OOP. It's only really applicable when OOP wasn't appropriate in the first place.
>>
>>52017836
Once you master the composition over inheritance advocated by fowler, you see how powerful oop is.
>>
>>52017836
because making everything a child/parent abstractions is stupid and constraining. design patterns have to be used to break out of this very monotone way of programming. languages not constrained by class types dont need design patterns

because using classes as a type system is constraining and makes code very static, module system should be used instead
>>
>>52018621
It really irks me to know that most of the canonical design patterns are just workarounds for closures.
>>
>>52017836
Nothing is wrong with it, just like nothing is wrong with GoTo programming.

The problem comes in when it is used badly, just like every single programming paradigm.

OOP is useful if you have really complicated objects with lots of code behind them. Inheriting an AsyncTask in Android for example is orders of magnitude more easy than coding a threading routine yourself.

But in other cases I have seen needless class inheritance which ends up making more work for little benefit.

OOP really requires a plan that is laid out in order to be good. If it is just winged out on the spot when most programming happens, it will probably crash and burn.
>>
>>52018621
>what is composition
>what is dependency injection

do you have any idea what you're talking about?
>>
How should I arrange my code in oop?
>>
>>52018708
>>what is composition
its programming in a way that ignores class heirarchies, basically how you would program naturally if you werent stuck in an OO language

>>what is dependency injection
another pattern for creating functionality that is not contrained by OO types systems which does not come naturally to OO
>>
>>52018761
Such that you're preventing code duplication and minimizing dependencies. Not so that your class hierarchy is a taxonomy.
>>
Lmao do people on /g/ even program anything besides Fizz Buzz in haskell and rust?
>>
>>52018089
The OOP in C# is definitely bad. It just copied Java, which in turn mainly copied the bad C++ OOP (which is really just OOP monkey-patched onto regular C methods).

Inheritance is harmful and should be dropped in favor of composition. Method overriding in big inheritance chains is *very harmful* and basically our generations GOTO statement. Theres also no proper way of doing Mixins.
Thread replies: 25
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.