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

>(((Object-oriented programming)))

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 46
Thread images: 4

File: 1499865324573.jpg (87KB, 1000x540px) Image search: [Google]
1499865324573.jpg
87KB, 1000x540px
>(((Object-oriented programming)))
>>
The best thing about OOP is that it encourages decent code organization. It's hard enough to get nicely commented code, but with OOP at least you can sort of orient yourself with other people's code.
>>
>>61766760
>spaghetti code is organized
You might as well be using fucking BASIC with tons of GOTOs when you use OO. There is no concept of code flow or organization with OO.

OO is fucking stupid.
>>
>>61766664
>le anti OOP meme
Cite me a better way to represent compound data units that can't be easily represented mathematically.
Let me help you out: You can't.
>>
>>61766842
not him but plain old s-expressions are pretty solid
>>
>>61766664
>>61766842


OOP isn't actually programming, its data entry
>>
>design a paradigm to force lazy programmers into structured thinking
>plan backfires and requires even more skilled programmers to maintain the new convoluted structures
>>
>>61766842
component oriented programming
>>
>>61766842

>data units that can't be easily represented mathematically

no one cares if it isn't "easy" for you to represent them mathematically, they need to be be done as such anyway, any other way is laziness and your system is going to suffer at some point because of it, if you can't deal with that you shouldn't be anywhere near a codebase
>>
why is /g/ so consistently hipster
it's embarrassing
>>
inheritance trees are stupid, but objects aren't.
>>
>>61766908
And what the hell do you think those components use to communicate with other components?
I'm not denying that OOP has reached a point of unforgivable terribleness. I'm pointing out that so far, there isn't a solid way to represent abstractions that conforms nicely with human logic.
>>
>>61766952
Okay then. Can you describe a mathematical function that can differentiate between a boat and a road vehicle?
>>
>>61766664
Fine.
Go back to your C/Assembly lair full of GOTOs, switches and thousands lines long functions.
>>
>>61766842
Such as? Never met a codebase that couldn't be unfucked from the OOP shittiness into data flow. It's not that hard, OOP brainlets, it's all about data transforms.
>>
>>61767075
Let f be the function such that f(x) = 1 if x is a boat and f(x) = 0 if x is a road vehicle.
>>
>>61766952
>willfully complicating the implementation because of "muh math purity" autism
No, you're the one that shouldn't be anywhere near a codebase. Keep it simple or die.
>>
>>61767125
boolean flags. now distinguish between 4 boats. hey, just add a flag. this is some nice clean code right here. boolean flags for everyone!
>>
>>61766760
>it encourages decent code organization.
It does the exact opposite, it allows people to write convoluted and unmaintainable code because it's designed to protect idiots from themselves at all costs.

>>61767040
See >>61766854
>>
File: KrZVDsP.png (152KB, 1948x858px) Image search: [Google]
KrZVDsP.png
152KB, 1948x858px
>>
>>61767125
>tfw such a massive brainlet that building a literal switch statement seems like a good alternative to objects
It's time to go back to school and get a real degree, pajeet.
>>
>>61767125
can do with both interface and reflection
>>
>>61767125
Nice. So you're gonna start passing strings around to represent vehicles now?
>>
>>61767111
Gee, I wonder how you're going to represent all that data without some sort of objects, or functions that are oriented towards transforming said objects...
>>
Really the only thing that is majorly bad about OOP is using inheritance. If you don't use that, and still think it can be called OOP, then OOP is good, and the term doesn't even mean much. Even better, stop putting functions into objects to operate on "this"/"self", and you're golden. But that certainly doesn't sound like OOP, it's just programming and also using objects. What does OOP mean anyway?

>>61767020
Basically what this guy said
>>
File: 1455062572265.gif (27KB, 896x700px) Image search: [Google]
1455062572265.gif
27KB, 896x700px
>>61767040

I agree with what you're saying (not OP). As for a solution? Objects/functions are by definition the best way for humans to abstract static concepts and processes that can be called and used using the "building block" mentality. I think the flaws show in its current state of application. I think a means of being less amboliguous with them and their features is the fix. We need to stop thinking of OOP as a shortcut and realize ot CAN be a powerful tool if said objects are constructed with proper care.
>>
>>61767327
>We need to stop thinking of OOP as a shortcut and realize ot CAN be a powerful tool if said objects are constructed with proper care.
Pretty much. We need a functional styled approach to OOP. IIRC most OOP languages are adding stuff like Lambdas now, though lagging behind on it more often than not.
>>
>>61767327
>I think the flaws show in its current state of application.
This really is a problem. In my opinion, unless you're trying to build a language from scratch, 3 layers of inheritance at most should be the gold standard:

Abstract <-- Concrete (use this whenever possible) <-- Concrete with specific, very unique, outlier properties

Everything else should be left to qualifiers (interface) or well thought out composition.
>>
>>61767291
OOP isn't about *some* sort of objects or functions. It's about organizing those in certain way you retard. Is procedural paradigm OOP too because you have data and functions of that data? I don't have a problem with collections of data and functions. I have a problem with how horrendous structures OOP encourages.
When designing from data flow, it's extremely simple to follow the code and,more importantly *prove* certain properties. You just don't have that with OOP because that shit can't be mathematically modeled.
>>
And who said you can't combine FP with OOP?
>>
>>61767453
>IIRC most OOP languages are adding stuff like Lambdas now, though lagging behind on it more often than not.

C++ added decltype() and auto in a really hamfisted manner, proving once and for all that Java being #1 in verbosity/unreadability is a meme perpetuated by people who know nothing about either.
>>
>>61767522
Like I said >>61767453, I agree that it should be, at least for certain applications.
>>61767524
Yeah fuck C++'s current state. I know Java added lambdas with JavaFX/Java8, but I'm not sure how well they were implemented.
>>
>>61767524
What's hamfisted in C++ auto?
>>
>>61767596

template <class T> auto getIntHash(int (*func)(T&), T& arg) -> int
{
return func(arg);
}
>>
>>61767291
>>61767324
The key part of OOP isn't object, it's oriented. The confusing metaphors that turn code into an unstructured blob. Languages Lisp and Ada have objects without OO, and in some languages that allow for OO like Common Lisp and Python, you're perfectly free to write correct code without a single OO idiom; you're simply building your own data structures.
>>
>>61766760
You've never worked on code that was originally written by Indians, have you?
>>
nobody can tell you why oop is supposedly bad, they just meme about it.
>>
>>61767593
>I know Java added lambdas with JavaFX/Java8, but I'm not sure how well they were implemented.
The only experience I have is with lambda's is with Java. What features should it have?

I love Java as a language but everything around is terrible. The users, the libraries, the standards. Like someone thought really well about designing it but someone else came along and shat all over it.
>>
>>61768472
Its more just how they run as opposed to features
>>
>>61766871
What the fuck is this dude saying?
>>
File: ecs.gif (27KB, 640x531px) Image search: [Google]
ecs.gif
27KB, 640x531px
>>61766664
what about ECS ?
>>
>>61768026
>nobody can tell you why oop is supposedly bad
Except, you know, everyone else in this thread.
>>
>>61768708
The concept is great but it is a pain in the ass to work with it at the code level. It's great in games when you have an "entity editor" of sorts where you can just drag and drop components.
>>
>>61767200
kek so much this
>>
>>61766760
anyone who grasps the concept of OOP can write organized code in C. It's the 90% of people that don't get it that are writing shit tier maintainable java.
>>
>>61766664
This is a categorization problem

I run into it when I'm trying to sort images I save into various folders. Sometimes an image would qualify for more than one category. So I end up with an image that might go in Science Fiction > Character Art, but could also qualify for Science Fiction > Mecha

So, what, do you just put it in both, in one?

The best solution I've seen is how the booru's do it. You tag the image with metadata: Character, Robot, Mecha, Science Fiction, etc. etc. and when you want mecha pictures, you just type the keyword and get them.

I don't know anything about programming but why not do the same thing instead of OOP?
Thread posts: 46
Thread images: 4


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.