Object Oriented Programming VS Procedural Programming

preview_player
Показать описание
Object oriented programming VS Procedural programming, in 2020. A coding revolution? (OOP) is a very opinionated matter, with some calling for an all-out eradication attempt of OOP because they think object oriented programming is bad. Coding styles are quite the something.
Рекомендации по теме
Комментарии
Автор

I don't have anything against OOP, I just prefer Procedural Programming, but I'll code with both :)

Stevesteacher
Автор

I like to program games with SFML and OOP, but then I end-up with a spaghetti of classes that are used to communicate between other classes. Some symptoms of overly object-oriented code in my games would look like having lots of "manager", "service", and "marshaler" classes, or having ass-backwards class relationships. The main class for my hero/character in the game would have members referring to the mouse, window, entity manager, and events for convenience. But in OOP, this doesn't make sense, because a 'character' doesn't have a 'mouse', and certainly doesn't have a 'entity manager'.
Some of Brian Will's videos are pretty good on showing some failures of OOP, especially this one:
I've never tried coding a game with a more procedural style, but I'd be interested in trying. I'd love to see what that looks like.

Xrispy
Автор

Thank you for the video! I've been dabbling in procedural programming after using object oriented programming for a long time so I wanted to get a second opinion to make sure I'm not ruining my code.

fredriddles
Автор

I think OOP has it's place in higher level applications like scripting in game engines, where the idea of "objects" actually makes sense. I think it has absolutely zero place anywhere in the realm of performance computing like game engines and embedded. Most harsh opinions for eradicating OOP come from senior programmers who have been through hell and back trying to ship worlds most performance heavy applications, where OOP doesn't help you at all and worst case slows down your software, especially when you're talking about data cache misses.

MempoEdits
Автор

Excellent points dude.. kinda weird there's people who want to eradicate a coding style just because they think it's bad. These styles exists to help solve different problems with it's own beautiful, frustrating and panic inducing quirks. if all you have is a hammer, everything looks like a nail. But still functional is da future fite me lol.

riyanafrizal
Автор

OOP isn't bad, but making literally everything a class is ridiculous
*looks at Java and C#*

zperk
Автор

The people who say OOP is a mess are the same people who learn a new programming trick and tell everyone that it is going to revolutionize their code style.

andrewherrera
Автор

Procedural programming is much more to the point than OOP in my opinion. Having done both OOP and procedural programming for over a decade, I prefer procedural programming in most cases. In fact, I haven’t found one example of an object oriented program that I couldn’t port to a procedural style, where it didn’t result in less and more concise code.

You can encapsulate things into a namespace without object orientated programming. A tuple comes to mind.

I’m not against OOP I just don’t think it’s the right tool for most jobs, and it leads to insanely large codebases for simple concepts.

Example. If you look at a “simple” RPC library written in OOP style in python you’ll see that there are about 15 files with god knows how many classes. At least 1000 loc. I worked on an RPC library in Nim that is less than 400 loc and I could explain it to you in 5-10 min

Wyklepheph
Автор

Scoured about 8 videos this is the best one i’ve found 👍

kaly
Автор

What is Procedural Programming vs Functional programming?

alsayehsoft
Автор

To write code that can write code you really dont need oop. Lisp does fine without CLOS and its the ultimate metaprogramming language

Oi-mjdv
Автор

Hey Bro you are actually doing good
I am watching your sfml playlist
I wanna ask you that
Is that a complete playlist or are you still working on it?
Btw
Love From India
❤️⚡🗡️

edsword
Автор

I'm 21 and i just started coding, but I feel it's kinda too late for me.
What is your take on this?
How old should someone be when he starts to become a decent programmer

carrapaz
Автор

Procedural is basically the natural and most basic way of programming, right?

And oop is like procedural, but each object has its own set of procedures.

AFAIK — stunning graphics is achieved by exactly opposite to oop. I just think of opengl and it seems to be the opposite of encapsulation, inheritance etc. Pure structs, arrays and everything is done by functions outside of structs.

Basically how I understand it is that oop is about individuals and procedural is about hivemind. Like, good luck making a strategy where each unit has its own stack of functions for AI. And good luck trying to procedurally code a game where every one of dozen of characters is a person and has its own role.

zhulikkulik
Автор

Ironically, I got so sick of header files that I switched from C to C++. I write pretty much straight C, but I use namespaces instead of header files.

mattr
Автор

I find it easier to program in a procedural style.

mattr
Автор

Man for a 16 year old, you know quite a lot of stuff.

ganeshkumar
Автор

I'm surprised to find no mentions of functional programming in the video or this comment section. The functional style excels at solving a lot of the problems people have with OOP. It retains many of the fancy features that procedural neglects, like polymorphism and encapsulation, without being especially complicated or syntactically verbose.

Functional programming also excels at modularity, as functions are extremely composable (and therefore easily decomposable into single-responsibility units) and reusable.

Languages like Haskell have type systems with much stronger guarantees than those of languages like C++ or Java. Elm even claims to eliminate all runtime errors in web apps, and it basically succeeds at that goal.

Functional languages usually have immutable values by default, which has pros and cons, but usually reduces bugs, and by writing pure functions with no side effects, programs become much easier to reason about.

joshuakb
Автор

I'm glad you made such a video. Honestly, if the compiler *smartly* translates our code into a code that's almost as efficient as our procedural equivalent one must not really care. Did you use perlin noise to move the character at the end? :)

DarshanSenTheComposer
Автор

I think you get the gist of somethings but you don't seem to fully understand they arguments on either side.

thunderza