>have known python for 7 years now >done all sorts of fun shit with it >today is the first day I built something that needed classes >it didn't even need classes they just allowed easy organization
is OOP literally a joke? Everything I accomplished with classes I could have done literally by just thinking a bit more carefully about how I wrote everything. Yea thats more effort, but more effort is required if you wanna make something good
Christian Flores
I'm rewriting it without classes right now and its taking longer to write but I feel much better about it.
using classes feels dirty
Jace Morris
what even is this thread? Yeah once you get out of making tool programs and scripts, objects are pretty useful for organizing your programs idiot.
you were already using python objects anyways
Ian Wood
dur dur durrrr
yea but its a matter of how you write your code. I disagree. I've made an entire segment of gimp without a single class, just functions
Anthony Ward
If this is true, it would partially explain why gimp is so shit.
You are an idiot.
Tyler Howard
There was potential here, but the fucking faggot who made it is shit at old english.
Jace Nguyen
How mantainable is your code? How reusable is your code? How easy would it be for another programmer to read it and start writing on it?
OOP is mainly for business, for having a good standard to follow so that you have a common ground with fellow programmers.
Isaiah Hughes
and yet gimp has a lot of objects, gtk has a lot of objects, the linux kernel has a lot of objects
objects are fine and good for organizing big project, you could argue you don't have to write big projects without objects, but you'd have to do whole lot of arguing.. But it's probably unneeded for toys and small projects though.
Xavier Russell
What newspaper?
Christian King
You're a retard.
Dominic Allen
OOP is an unfortunate symptom of atavistic visual cortex reliance
the graph and set theoretic origins of category oriented functional programming ain't much better
Julian Campbell
DOD > OOP
Matthew Barnes
It is. The most retarded part is that sometimes it is used to organize your code into classes, logically, but then the class will have only one fucking instance.
Landon Phillips
>out of a sudden
How can someone even make this mistake? 'Out of' doesn't sound anything like 'all of'.
Oliver Turner
OOP is good for certain problems and in certain contexts. It's just an organizational thing. The problem is that Pajeet abuses it and over-complicates everything.
I remember taking a numerical computation class from the mathematics department, but a bunch of CS majors were in the class. One day, the professor basically had to yell STOP TRYING TO ABSTRACT EVERYTHING INTO A CLASS. Some problems are procedural.
Jayden Mitchell
>t. Script Kiddie Your "fun shit" doesn't count as real. That's why you haven't needed OOP.
Grayson Adams
Just renaming functions does it for me. >nope they arent functions >they are called methods >let me elaborate in retarded jingo a method is a subroutine (or procedure or function) associated with a class. With respect to Object Oriented programming the term "Method" is used, not functions. When a function is a part of a class, it's called a method.
wot
Noah Gonzalez
>you can do things either way >"my way is clearly better your are all faggots"
Elijah Baker
OOP makes a lot more sense if you program a bit in Smalltalk yet you will also see the flaws in other languages trying to do OOP
Xavier Reed
>used python for 7 years >still does not know when to use classes I learned the usefulness of it within the first week of learning programming, and it's not to be more organized
Anthony Perez
>classes containing nought but static methods
Adrian Russell
A method is just a function with an implicit "this" parameter. object.method(params...) is the same as class::function(object, params...) for non-virtual methods.
Camden Cook
I understand it. That's why I think it's stupid. It's just a function in a class.
There was no need to abstract a different meaning. If the function is in a special wrapper (a class), there is already an understanding that the wrapper may block/allow access to only some functions. >could do the same if the wrapper was a file via relevant naming convention >this >being the 'naming convention' in classes
Calling it a method rather than just calling it a function in a class, seems stupid to me. Taking something and giving it an abstract meaning just to realign the focus of its use is pretty idiotic. >it's like calling mp3s, ipod music files
Kayden Ross
never worked a day in his life
Isaiah Ramirez
This gets on my nerves so much. Why not just use a submodule?
Nicholas Gutierrez
Okay you made me reply.
I'm an automotive software engineer essentially meaning I write C code for cars. We use C# to automate scripts with external power supplies or measurement tools.
Thanks to OOP we can have inheritance meaning that when I write C# code I can use classes to make my life easier.
I.e.
io.powerSupply.Xantrax.SetVoltage(14);
Or
io.measurment.futekTorque.GetTorque();
see how easy that is? It's logically name interfaces that have constructors that do something every call.
It is insanely useful and makes organizing a shitload of driver C# much more efficient.
SO long story short fuck you OP.
Jackson Campbell
This.
The original concept of OOP was closer to what we now call the "actor model" (think Erlang and shit)
Gavin Reyes
i call functions with structures as parameters, who needs objects h-haha!
Robert Anderson
This has to be bait. You're not even using any meaningful OOP in your so-called examples.
Logan Clark
Pic somewhat related. OOP comes in at least two forms: a basic one in which the system provides some namespacing, simple polymorphism and data encapsulation, mostly just for utility; and a second form which takes the shape of a programming ideology that tries to fit every aspect of programming into an "object". One is useful for certain kinds of programming, the other is a retarded sham.
I regularly use classes in Python, if only for some simple namespacing (and because they're the only way to use structs in Python). It's nice to be able to write "method"/function names that are short since they cannot be accessed outside of the context of their class, and never need to be. Polymorphism has its use-cases, but they're not as common as OOP ideologues make them out to be.
Adrian Lee
>a second form which takes the shape of a programming ideology that tries to fit every aspect of programming into an "object". I hate this shit so much. The worst part about programming paradigms is those faggots who think you can only use one.
Jayden Rogers
>for some simple namespacing Write a submodule...
Asher Green
I mean type-based namespacing. It is fairly nice to have the language be able to recognize that "op.couple()" means "faggot_couple(op)" rather than "straight_couple(op)" since "op" is a faggot in this particular context.
Kayden James
>>have known python for 7 years now >>done all sorts of fun shit with it
Translation
>Im a script kiddie who writes hacks >Ive never worked on anything substantial
Jaxson Collins
OOP is very very useful for large projects, but 98% of the time it's not useful.
Also, Python was never meant to be used for OOP, it originally started happening as a shitty interpreter hack and eventually gained "real" support. It's a fucking disgusting mess of a language.
Easton Parker
Here are the only things you need to know to write good code with or without classes:
SRP DRY
Specifically for classes and OOP: Composition > Inheritance
The classic animal inheritance tree here:
Is wrong and only said by idiots failing to properly teach OOP.
Sebastian Edwards
>Is wrong and only said by idiots failing to properly teach OOP. The problem is that there are so many of them. And not only amongst teachers, but there are many people who truly believe in it and try to apply it in practice.
Jose Long
>Also, Python was never meant to be used for OOP, it originally started happening as a shitty interpreter hack and eventually gained "real" support. In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources.[10] Already present at this stage in development were classes with inheritance
Easton Barnes
>its taking longer to write That is why OOP exists, it's generally much faster to work with.
Lincoln Hill
$a = new File("animu.png"); $a.delete();
vs
file_delete("animu.png");
All OOP does is double the workload and improve nothing. It's fucking pointless.
Adam Edwards
Anything OOP can do can be done in a header file.
Jonathan Mitchell
>what is overloading
Alexander Hall
Objects are great on huge projects where you're able to trust the other people you're working with. If you're doing personal hack-jobs then there's no reason to over complicate things with them. I've seen Java coders take longer to structure their classes than it takes them to write the actual algorithms inside them.
The problem with OOP is the Oriented part. There are plenty of cases where objects are the best way to get something done, but there are several magnitudes more where they make things needlessly complex on the programmer to write and impossible for anyone else to read. Objects are a tool, but from the way a lot of people code it seems more like a necessity. It's like the first semester of CS was turned from "basics of programming logic" to "logical structures found in objects".
It's like the old saying goes, when all you have is a hammer, everything looks like a nail. OOB is a sledgehammer to a lot of code monkeys, partly because they were never taught any differently. Objects can be used with finesse, but when you job is nailing down railroad ties 8 hours a day, you reinforce bad habits.
James Lewis
All of you are retarded. Oop is just a paradigm to help you organize your code into modular blocks and develop programs using composition. It's not inherently better or worse than other paradigms they all have trade-offs