what language you use doesn't really matter it all boils down to whether you understand what you are doing or not, if your bean seized brain isn't capable of logical reasoning and problem solving then you are better off seeking another profession.
I can count on my hands the number of times I've actually needed inheritance and object hierarchies when programming something.
2 months ago
Anonymous
that only means you either worked only on very simplistic programs, or you suffer strongly from primitive obsession and just refuse to utilize more sophisticated solutions (with which you can usually get away with at little to no disadvantages if your code is throwaway/run once and forget about it)
Nah I mean if you want to do OOP using C, because you have to implement all the plumbing yourself, unless the basic struct + functions is sufficient for your purposes.
As time has gone on, the perception of how programming languages has changed significantly, some capabilities in some languages has ceased to exist but some libraries make popular things of the moment easier to program.
We should have stuck 100% with assembly/machine code, or a compatible system derivative like C, and built libraries inside only 1 of those languages instead of making hundreds of languages that are a pain in the ass to make compatible with eachother.
The only thing that makes sense from an engineering perspective is an exceptionally efficient machine code type of system code which eats up the code of other systems of other programming systems, then implements them in the most efficient manner automatically. The problem is the complexity of this program requires a very strong understanding of turing machines and how to optimize turing machine instructions into the optimized variant of the turing machine instruction through the identification of various regressive fractals which occur systematically and patternistically in databases.
Then it doesn't matter what fricking language a person uses cause this fricking system will fricking eat up your dumb fricking code and spit it out back into the efficient machine code variant.
>44 years of experience >most likely confuses OOP for modularization and similar techniques
> rust troony seething > has no idea how any of this works
as anons have stated here previously, stick to your topic of expertise, rust trannies: raping children and failing at every programming language known to man.
2 months ago
Anonymous
>Rust >OOP
Rent free humiliation ritual of a cnile.
You will never be a real programmer.
Yeah class methods in python are kind of weird, I only really use them to provide alternate constructors since overloading methods in python typically just results in kwargs soup that's nigh undocumentable.
>have silly errors be caught at compile time
vs >have it explode during production
even javashitters and pytoddlers are gravitating towards static typing nowadays (typescript, mypy). only a complete moron would defend dynamic typing.
This, unless you're using a GOOD language like Clojure. REPL + spec allow for rapid development and much much much more flexibility than your average type system.
2 months ago
Anonymous
>spec >good
lol enjoy your 200 line of vomit when spec validation fails. use malli
OOP isn't complicated. moron-tier explanation, but I understand it at a very basic level.
Basically classes have class-wide variables, and objects (functions) within them have function-wide variables. "IFs" etc have local variables.
So there's a hierarchy of variables, right? So, there's different ways to reference them, incase you name something "school_name" in a function, when you weren't meaning to reference the class-wide variable.
Similarly, you can address a variable from outside the hierarchy - terminology depends- but as you can see, Student.school_name is addressing the class variable.
That being said, I have no fricking idea what the point of "cls" or "self" is.
>OOP isn't complicated >goes on to describe scoping, a separate concept tangentially related to OOP >mentions classes a lot, word object only mention once
Things that make you go hmmm...
find a tutorial or course that does ***not*** use any as their examples for OOP
Dogs / Animals
Students
Cars / Vehicles
anything else that's just modeling some data entity
anything that calls a class as a "template" for objects
what the frick do you mean? OOP is shit but that doesn't make objects any less of a copy of a class, which is exactly why the template analogy works
take your fricking meds or maybe try not GPTposting next time you drooling moron
2 months ago
Anonymous
>posts no OOP >doubles down on being wrong
2 months ago
Anonymous
if you want someone to "post some OOP". check OP's image
>class variable
There's not such thing as a class variable, a class is just a prototype, the thing defined at the top of the class is an static class attribute and it's just a way to use the class as a namespace. If you are using static attributes as variables you are doing Python OOP wrong.
a class is just a template (like a dildo mould)
an object is just a thing built using that template, and of course you can make multiple things out of the same template (like the pink dildo you put in your ass that was made from that mould, different from the black dildo your mom fricks herself with made from the same mould)
They are called in the same way, but class methods pass the class type as the first parameter to the function, whereas the the static method contains no reference to the class or instance.
this
op, your instinct is telling you that OOP is plebeian-tier shit and you are correct
read Nietzsche
make your own rules
trust your instinct over reasoning because reasoning is the sign of weakness
don't repress your instinct by asking plebeians if it's correct
because the plebs will only crush you down to their level
your soul is made of gold, you are a warrior and a king, not some pajeets writing OOP at a corporation
Man that shit sucks. OOP is not really that good because it couples the state and logic together too much increasing complexity. That is why all the good shit (databases, ECS for games) is based off of a relational model, not a hierarchical and/or network model. Just keep working at it, I would try a language with better syntax. Half the shit in the picture you have to worry about is not even OOP stuff, its just language syntax you have to know.
>OOP is not really that good because it couples the state and logic together too much increasing complexity.
explain how fewer function parameters, and removed need to carry state externally along the data, increase complexity
I tend to find that things which completely try to throw oop out the window are torturous to deal with but it’s also easy to have a nice day in the foot with bad oop. In both cases you end up wondering what the frick has gone wrong with programming while the fools dance about after they think they solved everything again for the 100th time.
Classes are just namespaces. It's a way to group definitions and functions.
Objects are just an additional layer of namespace separation. Each object has access to its class's attributes and methods. But also, objects have a scope separate from other objects. So it's like an additional layer of compartmentalization per object.
this. I was looking for this.
OP has to trolling with this static ref shit, or Python is worse than I thought.
cls.school_name has to be the only ref that makes sense.
this is why newbies should be taught low level programming first. none of this would then look like a black magic and you would have a mental model to process all these abstractions properly.
I've been programming for 44 years. Classical, non-object oriented (mainly years ago) and fully OOP. Currently, I manage a system that was 1.5 Million lines of code that I have down to 750,000 lines (that's HALF) - all thru applying OOP techniques. You have to use the right tool for the job (ask any handyman, mechanic or woodworker). OOP isn't the answer in trivial programs. But in big systems and systems that have to adapt to new business rules, it's invaluable. To just say OOP is bad is a total misunderstanding of OOP. You have to LEARN the tools - not just dismiss what you don't understand. You need to study the OOP subject further before you dismiss it.
>I've been programming for 44 years. Classical, non-object oriented (mainly years ago) and fully OOP. Currently, I manage a system that was 1.5 Million lines of code that I have down to 750,000 lines (that's HALF) - all thru applying OOP techniques. You have to use the right tool for the job (ask any handyman, mechanic or woodworker). OOP isn't the answer in trivial programs. But in big systems and systems that have to adapt to new business rules, it's invaluable. To just say OOP is bad is a total misunderstanding of OOP. You have to LEARN the tools - not just dismiss what you don't understand. You need to study the OOP subject further before you dismiss it.
Boomer moment. Is this ChatGPT or is this a genuine wfnh (work from nursing home) boomboom cnile?
You're talking to moronic kids who can barely write hello world but roleplay as experts on the internet. They'll just scream at you and miss your point. And I don't even like traditional OOP that much btw, I'm an erlang fanatic.
As time has gone on, the perception of how programming languages has changed significantly, some capabilities in some languages has ceased to exist but some libraries make popular things of the moment easier to program.
We should have stuck 100% with assembly/machine code, or a compatible system derivative like C, and built libraries inside only 1 of those languages instead of making hundreds of languages that are a pain in the ass to make compatible with eachother.
The only thing that makes sense from an engineering perspective is an exceptionally efficient machine code type of system code which eats up the code of other systems of other programming systems, then implements them in the most efficient manner automatically. The problem is the complexity of this program requires a very strong understanding of turing machines and how to optimize turing machine instructions into the optimized variant of the turing machine instruction through the identification of various regressive fractals which occur systematically and patternistically in databases.
Then it doesn't matter what fricking language a person uses cause this fricking system will fricking eat up your dumb fricking code and spit it out back into the efficient machine code variant.
,
>44 years of experience >most likely confuses OOP for modularization and similar techniques
Well, I think there's also a point where you have to ask if the system you're managing has exceeded its scope and consider building a separate system. Otherwise you create an object leviathan of unnecessary abstractions and rarely-used subsystems like Windows that can't realistically be secured.
Your problem isn't OOP, it's that Python is moronic.
So disregard Python, learn Self. Or Smalltalk.
Or Common Lisp with CLOS but that requires a bit more discipline and understanding.
Because said "Dead language" is an ideal vehicle for in depth understanding. Once you have gained understanding, then you can return to popular moronic language because you'll be able to figure out what it's attempting to ape and account for it's idio(tic)ms.
OOP is not about namespaces or data encapsulation.
Those are just nice side effects.
OOP is about using object-oriented semantics to design models to solve problems.
Good object models help you make sense of really complex problems that otherwise would be impossible.
The rest is just discussions about "purity" and "implementation" details.
Not the person you're replying to, but how about: virtually all 3D engines, most videogames, most professional GUI-based tools, the vast majority of the cloud backend of Azure, AWS and GCP, the biggest desktop OS in the world, the majority of large financial systems, all ERPs, most corporate backoffice software, virtually all email servers, this fricking site that you're shitposting on...?
2 months ago
Anonymous
Not an argument. Software written in OOP languages just tends to use classes for everything because it's convenient, not because OOP is such a good fit to solve many problems.
2 months ago
Anonymous
convenience is actually a significant factor in how good a paradigm is - why would I write solutions in something inconvenient or convoluted?
also: designing a solution in a paradigm like OOP, and writing code in an OOP language, are not the same level of work or even same level of thinking
Watch a YouTube video. There's no shortage of videos explaining the concept.
Then you can move onto design patterns.
Then you can question your life choices after you're five years in deep and you realize what you've done.
Whenever they bring out the animal and vehicle analogies, it feels like they intentionally want gatekeep something that's not even that complicated from the students
Become a cnile grug, duh.
But OOP is even more difficult in C.
Nah, C is for OOP rejects who couldn't fathom object hierarchy.
what language you use doesn't really matter it all boils down to whether you understand what you are doing or not, if your bean seized brain isn't capable of logical reasoning and problem solving then you are better off seeking another profession.
I can count on my hands the number of times I've actually needed inheritance and object hierarchies when programming something.
that only means you either worked only on very simplistic programs, or you suffer strongly from primitive obsession and just refuse to utilize more sophisticated solutions (with which you can usually get away with at little to no disadvantages if your code is throwaway/run once and forget about it)
the opposite.
Nah I mean if you want to do OOP using C, because you have to implement all the plumbing yourself, unless the basic struct + functions is sufficient for your purposes.
You are so wrong.
As time has gone on, the perception of how programming languages has changed significantly, some capabilities in some languages has ceased to exist but some libraries make popular things of the moment easier to program.
We should have stuck 100% with assembly/machine code, or a compatible system derivative like C, and built libraries inside only 1 of those languages instead of making hundreds of languages that are a pain in the ass to make compatible with eachother.
The only thing that makes sense from an engineering perspective is an exceptionally efficient machine code type of system code which eats up the code of other systems of other programming systems, then implements them in the most efficient manner automatically. The problem is the complexity of this program requires a very strong understanding of turing machines and how to optimize turing machine instructions into the optimized variant of the turing machine instruction through the identification of various regressive fractals which occur systematically and patternistically in databases.
Then it doesn't matter what fricking language a person uses cause this fricking system will fricking eat up your dumb fricking code and spit it out back into the efficient machine code variant.
> rust troony seething
> has no idea how any of this works
as anons have stated here previously, stick to your topic of expertise, rust trannies: raping children and failing at every programming language known to man.
>Rust
>OOP
Rent free humiliation ritual of a cnile.
You will never be a real programmer.
Cniles aren't grugs, they're screamcrying zoomBlack person hipsters.
Get a grip
most people don't bother with making class methods and just use methods and have then change self.<foo>
Yeah class methods in python are kind of weird, I only really use them to provide alternate constructors since overloading methods in python typically just results in kwargs soup that's nigh undocumentable.
It's useful for namespacing functions that have to do with the class but don't pass the datatype it works on as first argument.
because your learning material sucks. that image should have contained an object method other than the constructor.
>OOP in languages that aren't statically typed
Sounds like hell.
this, wtf are you doing OP
this is why anything serious uses type annotation
>anything serious uses type annotation
this is why i dropped python for rust 8 years ago
Python has type annotation ignorant troony dipshit
Not mandatory type annotation, which is the problem when you're working in a shared codebase.
>type annotations
Which are ignored.
static/dynamic typing doesn't matter, it's actually strong typing that matters
>have silly errors be caught at compile time
vs
>have it explode during production
even javashitters and pytoddlers are gravitating towards static typing nowadays (typescript, mypy). only a complete moron would defend dynamic typing.
This, unless you're using a GOOD language like Clojure. REPL + spec allow for rapid development and much much much more flexibility than your average type system.
>spec
>good
lol enjoy your 200 line of vomit when spec validation fails. use malli
Quite comfy, actually.
https://en.m.wikipedia.org/wiki/Common_Lisp_Object_System
Smug Lisp weenies win again.
base-
>en.m
cringe
This is the exception since there's only 1 type (list) anyway.
Common Lisp has a full type system.
>__init__
yikes
truly fricked init?
OOP isn't complicated. moron-tier explanation, but I understand it at a very basic level.
Basically classes have class-wide variables, and objects (functions) within them have function-wide variables. "IFs" etc have local variables.
So there's a hierarchy of variables, right? So, there's different ways to reference them, incase you name something "school_name" in a function, when you weren't meaning to reference the class-wide variable.
Similarly, you can address a variable from outside the hierarchy - terminology depends- but as you can see, Student.school_name is addressing the class variable.
That being said, I have no fricking idea what the point of "cls" or "self" is.
>OOP isn't complicated
>goes on to describe scoping, a separate concept tangentially related to OOP
>mentions classes a lot, word object only mention once
Things that make you go hmmm...
i was explaining the diagram which shows class variables
as i said, moron-tier explanation regardless
find a tutorial or course that does ***not*** use any as their examples for OOP
Dogs / Animals
Students
Cars / Vehicles
anything else that's just modeling some data entity
anything that calls a class as a "template" for objects
awful explanation
>he doesn't like dog->bark()
>anything that calls a class as a "template" for objects
that's exactly what they are you fricking moron
go ahead chucklefrick, post your best OOP
what the frick do you mean? OOP is shit but that doesn't make objects any less of a copy of a class, which is exactly why the template analogy works
take your fricking meds or maybe try not GPTposting next time you drooling moron
>posts no OOP
>doubles down on being wrong
if you want someone to "post some OOP". check OP's image
kys moron
Here's a real moron-tier explanation.
OOP is just structs with functions and state.
every pajeet is more competent than you so you must be stupider than a pajeet
in other words, give up
Cool! Didnt know python could doo OOP
>class variable
There's not such thing as a class variable, a class is just a prototype, the thing defined at the top of the class is an static class attribute and it's just a way to use the class as a namespace. If you are using static attributes as variables you are doing Python OOP wrong.
>There's not such thing as a class variable,
https://en.wikipedia.org/wiki/Class_variable
Futher, not all class variables are even static
Learn C
I filter OOP because I don't like it
it is just structs with methods and inheritance
use a better language to learn it
start coding a small project and you will figure everything out during the process
Real question, composition or inheritance? I would prefer composition with interfaces or traits over inheritance any day.
Both. There are places where inheritance makes sense (eg. GUI programming is much easier with it. Even GTK, written in C, uses inheritance.
a class is just a template (like a dildo mould)
an object is just a thing built using that template, and of course you can make multiple things out of the same template (like the pink dildo you put in your ass that was made from that mould, different from the black dildo your mom fricks herself with made from the same mould)
>Python OOP
That got to be one of the most awful ones.
What is the difference between @classmethod and @staticmethod?
They are called in the same way, but class methods pass the class type as the first parameter to the function, whereas the the static method contains no reference to the class or instance.
Practice oop in a language designed around it, do C# for a few days and you'll get it.
don't use it.
I don't use classes in Python, I just separate by modules
That's actually a complement, anon. Every good programmer is repulsed by the unnecessary complexity of OOP.
this
op, your instinct is telling you that OOP is plebeian-tier shit and you are correct
read Nietzsche
make your own rules
trust your instinct over reasoning because reasoning is the sign of weakness
don't repress your instinct by asking plebeians if it's correct
because the plebs will only crush you down to their level
your soul is made of gold, you are a warrior and a king, not some pajeets writing OOP at a corporation
>what do?
procedural programming
Man that shit sucks. OOP is not really that good because it couples the state and logic together too much increasing complexity. That is why all the good shit (databases, ECS for games) is based off of a relational model, not a hierarchical and/or network model. Just keep working at it, I would try a language with better syntax. Half the shit in the picture you have to worry about is not even OOP stuff, its just language syntax you have to know.
Oh yeah? Please explain what a relational model is and how that relates to ECS but not OOP. Be specific.
ECS is a fricking meme.
No serious game developer uses it.
>OOP is not really that good because it couples the state and logic together too much increasing complexity.
explain how fewer function parameters, and removed need to carry state externally along the data, increase complexity
I tend to find that things which completely try to throw oop out the window are torturous to deal with but it’s also easy to have a nice day in the foot with bad oop. In both cases you end up wondering what the frick has gone wrong with programming while the fools dance about after they think they solved everything again for the 100th time.
How moron you have to be to not understand oop? Maybe you are just farming (You)'s
Classes are just namespaces. It's a way to group definitions and functions.
Objects are just an additional layer of namespace separation. Each object has access to its class's attributes and methods. But also, objects have a scope separate from other objects. So it's like an additional layer of compartmentalization per object.
>class_method.png
>school name as property of student class
>class method refer to hardcoded class
What the frick is this shit?
this. I was looking for this.
OP has to trolling with this static ref shit, or Python is worse than I thought.
cls.school_name has to be the only ref that makes sense.
The only OOP design pattern used in the workplace is the Strategy pattern as Xoomers over do, SOLID principles and clean code.
>Iterators aren't used in the workplace
all I see is dependency inject everything and anything.
Sounds like a skill issue to me
It really is
Quit and do like 99% of homosexuals here
> im a embedded, OS dev, frick this web dev shittery
Python is moronic. Why the class methods needs keywords self and cls. Try java. Fall back to python if needed
Yes sar java is number one programeng language sar!
Keep doing OOP problems until you get it
>all the shit on oop on this board
>TURNS OUT NOBODY ON HERE KNOWS HOW TO USE IT
CNILES AAAAAAAAAAAAHAHHAAAAAAAHAHAAHAAHAAHAAHAAH
this is why newbies should be taught low level programming first. none of this would then look like a black magic and you would have a mental model to process all these abstractions properly.
ITT:
>watches this slop video once
>thinks theyre an expert
I've been programming for 44 years. Classical, non-object oriented (mainly years ago) and fully OOP. Currently, I manage a system that was 1.5 Million lines of code that I have down to 750,000 lines (that's HALF) - all thru applying OOP techniques. You have to use the right tool for the job (ask any handyman, mechanic or woodworker). OOP isn't the answer in trivial programs. But in big systems and systems that have to adapt to new business rules, it's invaluable. To just say OOP is bad is a total misunderstanding of OOP. You have to LEARN the tools - not just dismiss what you don't understand. You need to study the OOP subject further before you dismiss it.
>I've been programming for 44 years. Classical, non-object oriented (mainly years ago) and fully OOP. Currently, I manage a system that was 1.5 Million lines of code that I have down to 750,000 lines (that's HALF) - all thru applying OOP techniques. You have to use the right tool for the job (ask any handyman, mechanic or woodworker). OOP isn't the answer in trivial programs. But in big systems and systems that have to adapt to new business rules, it's invaluable. To just say OOP is bad is a total misunderstanding of OOP. You have to LEARN the tools - not just dismiss what you don't understand. You need to study the OOP subject further before you dismiss it.
Boomer moment. Is this ChatGPT or is this a genuine wfnh (work from nursing home) boomboom cnile?
lines of code doesn't mean anything. if you one-line everything I can get it down too but it's still the same shit.
You're talking to moronic kids who can barely write hello world but roleplay as experts on the internet. They'll just scream at you and miss your point. And I don't even like traditional OOP that much btw, I'm an erlang fanatic.
Cases in point:
,
>44 years of experience
>most likely confuses OOP for modularization and similar techniques
Well, I think there's also a point where you have to ask if the system you're managing has exceeded its scope and consider building a separate system. Otherwise you create an object leviathan of unnecessary abstractions and rarely-used subsystems like Windows that can't realistically be secured.
stop being filtered
I want to make money i don't give a frick about boomerisms like C
OOP complexifies everything.
Understand it for what it is.
It's code that creates new code inside every single class/object.
This is significant for some computation properties, but in most cases it's been incorrectly utilized.
Ignore what is recommended and find a solution that is simple and modifiable.
And easily testable.
For every advanced structure you construct, construct an advanced test system.
This will reduce the complexity in your code to 0.
Dan Ingalls' OOP lecture.
Not trying to meme or joke here.
Your picrel has subtle Burman elements and is written in a homosexual tone. This will be discussed in your yearly posting review.
>wat do?
rape
i do my oop in sql queries
What are you using oop for? If you don't know, then stick to standard c.
Struggling is part of the learning process. Just keep going.
I unironically learned OOP from the Perl Info pages. It had all the fun $cow->moo stuff lol.
Your problem isn't OOP, it's that Python is moronic.
So disregard Python, learn Self. Or Smalltalk.
Or Common Lisp with CLOS but that requires a bit more discipline and understanding.
>learn dead language
Why?
Because said "Dead language" is an ideal vehicle for in depth understanding. Once you have gained understanding, then you can return to popular moronic language because you'll be able to figure out what it's attempting to ape and account for it's idio(tic)ms.
OOP is fluff and useless jargon.
Learn FP. Keep functions and data separate, like God intended.
Learn C structs.
Then realize that, at its core, OOP is just C structs with a bunch of sugar on top of it for inheritance and state tracking.
You have now learned OOP.
True for C++, basically the only feature it adds is automatic vtable generation.
As always, learning C is the answer.
>OOP is just C structs
C didn't invent structs.
>learning C is the answer.
Only if the problem is not enough bugs.
>C didn't invent structs.
Neat, doesn't change anything I said though.
@classmethods are moronic, just self.method
OOP is not about namespaces or data encapsulation.
Those are just nice side effects.
OOP is about using object-oriented semantics to design models to solve problems.
Good object models help you make sense of really complex problems that otherwise would be impossible.
The rest is just discussions about "purity" and "implementation" details.
Examples of such really complex problems?
Any big system is modelled inheretly by an object oriented design.
Next question?
Examples for such big systems?
Not the person you're replying to, but how about: virtually all 3D engines, most videogames, most professional GUI-based tools, the vast majority of the cloud backend of Azure, AWS and GCP, the biggest desktop OS in the world, the majority of large financial systems, all ERPs, most corporate backoffice software, virtually all email servers, this fricking site that you're shitposting on...?
Not an argument. Software written in OOP languages just tends to use classes for everything because it's convenient, not because OOP is such a good fit to solve many problems.
convenience is actually a significant factor in how good a paradigm is - why would I write solutions in something inconvenient or convoluted?
also: designing a solution in a paradigm like OOP, and writing code in an OOP language, are not the same level of work or even same level of thinking
this is the most moronic code block I’ve ever seen
>writes some stupid shit
>see guys I told u it sucks!!
Watch a YouTube video. There's no shortage of videos explaining the concept.
Then you can move onto design patterns.
Then you can question your life choices after you're five years in deep and you realize what you've done.
Learn it properly via Java or C# or C++
im moronic, if you not supposed to use OOP what are you supposed to use?
Lambda?
In theory the alternative is functional programming but in reality you end up creating a bunch of project-specific paradigms for things OOP abstracts.
Thinking about video games helped me understand OOP, namely games you put a lot of hours in. For me, it was Sonic Adventure 2 Battle.
Whenever they bring out the animal and vehicle analogies, it feels like they intentionally want gatekeep something that's not even that complicated from the students