Pong & Object Oriented Programming - Computerphile

Pong & Object Oriented Programming - Computerphile

Computerphile

8 лет назад

263,045 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@mohammadshahabrafiq
@mohammadshahabrafiq - 20.08.2023 20:44

Excellent video.

Ответить
@lepidoptera9337
@lepidoptera9337 - 15.02.2023 09:13

Why in the world would you use "Pong" as an example?

Ответить
@atlantic_love
@atlantic_love - 27.08.2022 00:38

One of my favorite channels. I'd like to see him talk about how to do OOD (Object Oriented Design). For instance I'm bogged down right now in making my own classes that represent things like Container, Random and Sort. I don't know whether I'm supposed to write my program such as interaction with the user comes from within main(), or if the user interaction should come from within in the objects. I'm using C++ and this is just a hobby of mine.

Ответить
@saintjerome8579
@saintjerome8579 - 28.07.2022 19:58

This is the best, clearest explanation for OOP I've ever heard. Of only my high school programming teachers had made it that clear.

Ответить
@FunnyVideos1337
@FunnyVideos1337 - 18.11.2021 18:33

I love Dr Steve Bagley hes so handsome

Ответить
@NoahSpurrier
@NoahSpurrier - 25.10.2021 18:47

The problem with OOP as implemented is that it’s not supposed to be difficult to wrap your head around; it’s not supposed to be more complicated; it’s not supposed to make programming harder. It’s supposed to help manage complexity; it’s supposed to be easier to understand; it’s supposed to make our jobs easier. We should ask why new programmers are intimidated by it. We should ask why has OOP not lived up to the promises.

Ответить
@Cypeq
@Cypeq - 19.10.2021 01:41

Brilliant... Such a great way to tech object oriented programming. It's so simple too. Make a fun simple game, not a school or other boring structure.

Ответить
@pehash
@pehash - 29.05.2021 15:00

I would love a smart guy like this to stream or record a video of a simple game development, like pong for example, and explain everything he does in ample details and simplified in the same time. I would sit there for hours with a huge popcorn bag just listening to the guy.

Ответить
@petersmythe6462
@petersmythe6462 - 12.04.2021 06:45

strict encapsulation is problematic. You end up with something like a rigid feudalistic hierarchy of manager objects. And passing objects by reference? Kinda just global variables with extra steps isn't it? I don't think very many people really practice data encapsulation religiously and doing so would lead to a pretty wierd way of programming.

Ответить
@qantum251
@qantum251 - 27.03.2021 17:47

Sorry this time, it's just useless only blabla bla.

Ответить
@minocs
@minocs - 10.03.2021 07:58

I ❤️ OOP

Ответить
@baka_geddy
@baka_geddy - 20.10.2020 12:33

Mikyo Zoldyck Explains Computer Programming... Seems legit.

Ответить
@chaitanyapatki6601
@chaitanyapatki6601 - 09.10.2020 15:50

Ca n you plz send a java program for this

Ответить
@ScoutSniperMC
@ScoutSniperMC - 28.08.2020 01:18

FactoryServiceManagerFactory

Ответить
@BlenderDumbass
@BlenderDumbass - 30.07.2020 04:00

I use classes because self is easier then global in python. LOL

Ответить
@ultrio325
@ultrio325 - 29.07.2020 11:17

object orientated ponging

Ответить
@BlackFoxLovesYou
@BlackFoxLovesYou - 28.06.2020 17:55

Did the Inheritance video he mentioned ever get made? Would love to watch that if it hasn’t!

Ответить
@amzonfire6013
@amzonfire6013 - 01.05.2020 19:58

Oop stincks!!!

Ответить
@0colorad0
@0colorad0 - 14.04.2020 04:18

"So many different terms; objects sending messages to other objects... And, well, not much else happening. In fact, that's the only thing"

Ответить
@jordanstarr1769
@jordanstarr1769 - 01.04.2020 04:28

This is a brilliant explanation.

Ответить
@suicidalbanananana
@suicidalbanananana - 26.01.2020 21:09

"Its probably not going to be more then a few hundred lines long"
Honestly that sounds like way to much code, even if you'd go completely overboard with OOP

Ответить
@Engravingsful
@Engravingsful - 08.04.2019 12:59

That look more like simon says toy simon than pong

Ответить
@lincolnsand5127
@lincolnsand5127 - 27.03.2019 10:05

OOP is not hard. But boy does it have problems

Ответить
@Microphunktv-jb3kj
@Microphunktv-jb3kj - 27.02.2019 15:17

OOP is bad, encapsulation is just an illusion...

Ответить
@abeplus7352
@abeplus7352 - 30.12.2018 04:58

So much hate for OOP. I actually really like the style of thinking behind oop . Just the fact that you can write a class once and not have to think about the details behind what each method does. It just does what you want it do as an entity.

plus it really helps in organizing your code instead of having each method like a block of 100 lines of code , each method can be less than 20 let's say because you have entities and helper methods that'll take care of most things for you.

It might not be perfect for all use cases , but for most of the things I've made solutions for it's been helpful. Plus unit testing is like a piece of cake when you have classes.

From what I noticed people who hate it , generally are either wanna be pseudo coders who use python to write scripts , functional programmers ( kudos to you and I respect your opinion) , or C/Assembler programs who think that any form of abstraction is nonperformant and slow.

Ответить
@sawilliams
@sawilliams - 28.12.2018 10:47

Don’t forget the “stage “ object, that manages all the objects on the screen aka stage.

Ответить
@ebuzertahakanat
@ebuzertahakanat - 13.12.2018 06:51

never use inheritance always use composition! just google "composition over inheritance" before you go to that historical damned road of getting excited about inheritance.

Ответить
@12345charliebrown
@12345charliebrown - 26.11.2018 12:55

it's easy to fall into the OOP mindset. In theory it sounds like a great idea re-usable code relating to real world objects. But in reality it gets way over-engineered. Why write a class when a simple function will do? I go back to my old C code and I still find that easier to read than the Java code Ive written over the years.

Ответить
@bwatspro
@bwatspro - 27.10.2018 17:08

So, this is how Google Chrome logo came to be.

Ответить
@stefanrasovic7911
@stefanrasovic7911 - 23.10.2018 01:53

This man is beautiful

Ответить
@esjihn
@esjihn - 11.09.2018 21:59

this guy is writing on ancient paper from a time where printers made loud noises.

Ответить
@MikelNaUsaCom
@MikelNaUsaCom - 06.09.2018 03:47

having a deterministic size for the objects make garbage collection much easier to automate. IE making them strongly typed objects - especially if all your primitives are derived from a single base object.

Ответить
@GogiRegion
@GogiRegion - 07.08.2018 04:14

I always hear people talking about how hard objects and classes are to people, but I always thought it was just super intuitive. Maybe I just found a good Java starting article (the first programming language I ever used classes in was Java, which is bassically forced object oriented programming [anyone who has ever used Java knows exactly what I mean]), but it always seemed really easy to me. IDK.

Ответить
@noctavel
@noctavel - 31.07.2018 22:25

what about inheritance?

Ответить
@jamesgagne7895
@jamesgagne7895 - 12.05.2018 03:23

probably should have talked about the room object

Ответить
@noxabellus
@noxabellus - 06.05.2018 21:08

All you need to take away from OOP is the idea of associating a function with a type, so that you can call type_instance.function() easily. Everything else is more trouble than its worth. Especially classical inheritance.

And I'm saying this as a game dev. If I can make a whole game with has-a relationships rather than is-a's then you certainly can for business applications.

Ответить
@grahammurray8707
@grahammurray8707 - 31.03.2018 00:20

BTW pong was an arcade game and we encountered it in the UK first as ping for obvious reasons.

Ответить
@HadrianDan
@HadrianDan - 29.03.2018 12:35

Then in base, of Object Oriented Programming, the shapes or models are the objects or shapes inside shapes are objects of other objects and whatever is then in manipulate are the operations on the objects or something, correct if wrong. Where the object is a program in itself as well and each object has its own identity with own set of rules. A class is a blueprint to all of that also and stuff is and then the computer interprets and then does compile if it makes sense or whatnot.

Ответить
@Kylefassbinderful
@Kylefassbinderful - 09.03.2018 17:13

I really appreciate how you visually explained Object Oriented Programming. This is the first time I'm starting to grasp it.

Ответить
@NeilRoy
@NeilRoy - 07.03.2018 00:47

I'll always prefer straight C. I can do things similar to OOP with it without a bunch of convoluted code. Many of the concerns about straight C coding over OOP you get with C++ just never come up for me. I have more problems with a misplaced semicolon than anything else like pointers (which C++ programmers seem to have an irrational fear of). For pong, I can place structs and functions to do with paddles in their own files, say paddle.c and paddle.h and it is all completely contained without the headaches and slowdowns that come with C++ or other high level languages.

Maybe someday I will start coding with OOP like C++, I'm just not there yet. One thing I did like about C++ were vectors, so I wrote my own vector code for C which gave me the same functionality. :)

I did write a pong game in C++ one time just to demonstrate classes for someone that challenged me to do it. It didn't take long to write but after I was done, I didn't like how it looked. I don't know, I have never "accidentally" altered the code of something I should not have. It seems as though OOP is a solution to a non-existent problem.

Ответить
@davef21370
@davef21370 - 28.02.2018 21:59

I like to the analogy of Space Invaders and Galaxian. Space Invaders could be programmed using a bunch of arrays, x-y values and speed. Galaxian needed a simple AI for the groups to break off and swoop down. That would be far easier using OO.

Ответить
@aloluk
@aloluk - 24.02.2018 14:56

By the way, the screen would not be only represented by the computer, because what happens to the ball when it goes off the top/bottom of the screen?

Ответить
@david2sdad
@david2sdad - 27.01.2018 13:15

What is your get opinion of putting get in front of all accessors. This practice comes from Java Beans, but makes the grammar very strange. All of your nouns (and adjectives) turn into verbs: “Get would you like fries with that?“, “What is your get height?”, “if get name equals "root" then …”

Ответить
@LincolnBerryIII
@LincolnBerryIII - 13.01.2018 05:10

To move player 1 paddle "up": paddle1._ypos = paddle1._ypos - 1

Ответить