Two Plus Two Poker Forums I really can't get my head around OOP
 Register FAQ Search Today's Posts Mark Forums Read TwoPlusTwo.com

 Notices The Theory of Poker Applied to No-Limit now available For those of you here in Las Vegas, The Theory of Poker Applied to No-Limit by David Sklansky is now available at Gambler’s General Store/ GAMBLER'S BOOK CLUB in downtown Las Vegas. Their address is 727 S Main St, Las Vegas, NV 89101 and their phone number is (702) 382-9903. We also have this title available in several special poker book promotions directly from Two Plus Two Publishing. For more info or to ask questions check out this thread in the books and publications forum: Sklansky Invites Reviews, Comments, And Questions, About Theory of Poker Applied To No Limit .

 08-17-2014, 01:31 PM #1 Ovalman grinder   Join Date: Mar 2009 Posts: 524 I really can't get my head around OOP Learned ZX Spectrum BASIC in the early 80's and spaghetti coded my way. Things like 10 Let a=1 20 a=a+1 30 If a=30 Gosub 100 40 Print a 50 Goto 10 100 Print "a is 30" I recently came back to programming and find many things so alien. I think my problem lies with the Object Orientated Programming method. I understand what it is (sort of) but I can't seem to apply it with any code I've written. I seem to go back to spaghetti coding which is what I understand. Most if not all programming courses on Youtube are geared towards the newbie programmer but I've learnt many bad habits that I can't shake off. I'm trying to learn Android (Java) but I've also dabbled in Python and C#. It's not the actual language that's the problem as I understand about loops and variables but it's the actual structure of a program. If you were creating a program from scratch, how would you go about it? Can someone explain to me how to break things down from an idea into actual code? I'm pretty frustrated BTW. Last edited by Ovalman; 08-17-2014 at 01:35 PM. Reason: typo
 08-17-2014, 04:05 PM #2 daveT S.A.G.E. Master     Join Date: Jun 2005 Location: La La Land Posts: 23,168 Re: I really can't get my head around OOP This is an incredibly complex question. You are asking people to describe, in one post, years of knowledge. You don't even offer any code to examine, no specifics of what you are trying to solve, nor describe in any detail the problems you are running into.
08-17-2014, 05:49 PM   #3
ganstaman
Carpal \'Tunnel

Join Date: Sep 2008
Location: central nj
Posts: 9,601
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Ovalman 10 Let a=1 20 a=a+1 30 If a=30 Gosub 100 40 Print a 50 Goto 10 100 Print "a is 30"
Unimportant, but line 50 is set up to make for a boring program.

Quote:
 Originally Posted by Ovalman If you were creating a program from scratch, how would you go about it? Can someone explain to me how to break things down from an idea into actual code?
I agree with daveT. Do you have a particular idea in mind that you were failing to code? Where is it that you're getting lost?

 08-17-2014, 05:50 PM #4 kazana Pooh-Bah     Join Date: May 2006 Location: que, said che Posts: 5,659 Re: I really can't get my head around OOP If you're in the process of trying to get your head around OOP, it's best to start with small, trivial "programs" - not a complex application. Do some basic inheritance cases and see how the instances behave. Then move on to one of the next more complex paradigm. Once you've got a better intuitive feeling of OOP, you'll start automagically associating structures/approaches with a problem set at hand. Then it's a matter of somehow finding out if you indeed do have a good approach for the problem at hand which can be not too dissimilar from playing football with a basket full of snakes.
 08-18-2014, 09:56 AM #5 jjshabado Carpal Tunnel     Join Date: Jul 2006 Posts: 22,556 Re: I really can't get my head around OOP Live everyone else said, you're asking a very generic/open-ended question thats not really possible to answer in this thread. You can do some googling for noun/verbs and object oriented programming. It's probably the easiest way to be introduced to it. The noun/verb strategy is fairly simplistic and flawed in practice but a decent starting point. Super quick googling (funnily enough most google hits are about how flawed this strategy is): http://www.eventhelix.com/realtimema...m#.U_IGXIBdVNM http://books.google.ca/books?id=GEJ_...0verbs&f=false http://objology.blogspot.ca/2011/09/...ng-advice.html
 08-18-2014, 12:30 PM #6 animas journeyman   Join Date: Nov 2012 Posts: 237 Re: I really can't get my head around OOP This is my layman's understanding of OOP. I hope it helps at least a little bit. OOP is based on objects. Objects are different kinds of data structures that can hold characteristics inherit to said data structures -- methods (or procedures for manipulating the data of objects) and variables (or data that relates to these objects). In OOP, the most basic of objects are primitive types -- float, integers, character strings, etc. When you declare a specific number of one of these classes, you are creating what they call an instance of a class. So, for example, you declare in the interpreter a = 1.0; You are creating an instance of type floating-point. Very basic, but this is the gist of creating an object. To take OOP further, you can design your own data structures in the form of classes, that allow you to create objects that model real life objects. So, for example, you might want to create a class called triangle, whose inherit characteristics(variables) are hypotenuse, adjacent, and opposite, and whose procedures (methods) might be a list of theorems from triangular geometry. Psuedocode for creating an instance of class triangle might use the length of the sides of a triangle. So: new Triangle triangle1 (50, 40, 30); where the numbers are the length of the sides of the new object and triangle1 is the name of the new object. That new object might have methods for determining the different size of the angles of the triangle. These functions will be defined for the object when you create the user-defined class, called Triangle.
 08-18-2014, 04:48 PM #7 Ovalman grinder   Join Date: Mar 2009 Posts: 524 Re: I really can't get my head around OOP Android (using Eclipse) overwhelms me, I can't get text fields into variables for instance. I know OnClickListeners do the job but I'm unsure how to apply them. I end up with so many errors that I usually end up ditching the code and starting again. Java, Python and C# seems a bit easier to tackle (even though Android uses Java) but don't do what I need. Sorry for the very generic question but I'm just looking a few pointers to help me which some of you have already given. I'm maybe unsure myself how to go about learning to program and why my question is so ambiguous. I have a couple of idea's for the mobile platform so I really want to learn Android (Java). Thanks for the replies, it's helped somewhat (i'll give that book in your 2nd link a read jjshabado)
08-18-2014, 05:29 PM   #8
maxtower
Carpal \'Tunnel

Join Date: Sep 2005
Posts: 7,907
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Ovalman Android (using Eclipse) overwhelms me, I can't get text fields into variables for instance. I know OnClickListeners do the job but I'm unsure how to apply them. I end up with so many errors that I usually end up ditching the code and starting again. Java, Python and C# seems a bit easier to tackle (even though Android uses Java) but don't do what I need. Sorry for the very generic question but I'm just looking a few pointers to help me which some of you have already given. I'm maybe unsure myself how to go about learning to program and why my question is so ambiguous. I have a couple of idea's for the mobile platform so I really want to learn Android (Java). Thanks for the replies, it's helped somewhat (i'll give that book in your 2nd link a read jjshabado)

It sounds like your problem isn't so much OOP, as it is just lack of experience. To get started with Android, there's a couple key concepts you'll need.
1. Many tutorials use XML to produce widgets on the screen. Maybe you should try to do this programmatically first so you will better understand the connection between XML and Java/Android SDK.
2. Because user events can happen asynchronously, you need to understand a little bit about threading in a program. That's where all those listeners come in to play. The events don't happen sequentially relative to some of the other code you're writing.

08-18-2014, 09:46 PM   #9
iosys
old hand

Join Date: Sep 2011
Posts: 1,753
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Ovalman Most if not all programming courses on Youtube are geared towards the newbie programmer but I've learnt many bad habits that I can't shake off.
I disagree but that doesn't matter depending on what your learning preference is and I assume it's not watching videos.
There are many good courses on youtube that don't teach you bad habits...

Maybe consider looking at your code and compare it to code that you consider is elegant by someone else.
Also maybe you should just learn how to navigate documentation if you get frustrated by slowness.

08-19-2014, 06:54 PM   #10
chezlaw
Limey Bastard

Join Date: Jan 2004
Location: London
Posts: 36,059
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Ovalman Learned ZX Spectrum BASIC in the early 80's and spaghetti coded my way. Things like 10 Let a=1 20 a=a+1 30 If a=30 Gosub 100 40 Print a 50 Goto 10 100 Print "a is 30" I recently came back to programming and find many things so alien. I think my problem lies with the Object Orientated Programming method. I understand what it is (sort of) but I can't seem to apply it with any code I've written. I seem to go back to spaghetti coding which is what I understand. Most if not all programming courses on Youtube are geared towards the newbie programmer but I've learnt many bad habits that I can't shake off. I'm trying to learn Android (Java) but I've also dabbled in Python and C#. It's not the actual language that's the problem as I understand about loops and variables but it's the actual structure of a program. If you were creating a program from scratch, how would you go about it? Can someone explain to me how to break things down from an idea into actual code? I'm pretty frustrated BTW.
Only answering as I also learned to program on a spectrum.

imo you're approaching it wrong, take a basic course in programming on udacity or similar and just play it with a straight bat.

08-21-2014, 11:54 AM   #11
Benholio
Carpal \'Tunnel

Join Date: Jun 2004
Location: Atlanta, GA
Posts: 8,292
Re: I really can't get my head around OOP

Quote:
 Originally Posted by chezlaw Only answering as I also learned to program on a spectrum. imo you're approaching it wrong, take a basic course in programming on udacity or similar and just play it with a straight bat.
Seconded.

 08-21-2014, 09:55 PM #12 Low Key Carpal \'Tunnel     Join Date: Jan 2007 Location: Thank you, Florida Posts: 33,333 Re: I really can't get my head around OOP I recommend joy of code and greenfoot, really easy to understand the basics, plus you're making little games in the process ^_^
 08-22-2014, 12:27 AM #13 Alobar Born Ready     Join Date: Nov 2003 Location: 3rd turtle from the bottom Posts: 41,298 Re: I really can't get my head around OOP I thought android was (and still is, cuz I still have a ton to learn) really hard to lean compared to python and java. There arent really very many good resources to teach it in the way there are for lots of other languages. There arent any good lecture style or video courses on it imo. The best course of action is just finding a good book (I would recommend Big Nerd Ranhc Guide for andriod) and then using stackoverflow. Thats assuming you have a decent understanding of Java, which if you are completely lost with OOP might not be the case? I wouldnt worry so much about OOP in particular, I think its just something that comes with more practice and knowledge. If you are writing lots of code, and reading other peoples code and working on making your code better, it just starts to make sense. I mean you can write really complex programs without using OOP, it just makes everything easier and the entire process more efficient. I dunno how good your Java is, but the Standford Java course is really good. if you have the basics down you can also just look at one of the many MOOCs out there and take an interesting class that uses java as its language, and then you are forced to write code for your assignments, and youll be reading other peoples code, and I think it will really help. Im still a noob tho, so take all the above for what its worth
08-22-2014, 10:36 AM   #14
splashpot
Carpal \'Tunnel

Join Date: Nov 2004
Location: splashing
Posts: 8,203
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Alobar I thought android was (and still is, cuz I still have a ton to learn) really hard to lean compared to python and java.
Android development is java.

Quote:
 There arent really very many good resources to teach it in the way there are for lots of other languages. There arent any good lecture style or video courses on it imo.
https://www.udacity.com/course/ud853 - taught by google developers
https://www.coursera.org/course/android - this one starts in a month but if you click preview lectures, i think the videos are available now

These courses still assume a proficient level of java knowledge though.

08-22-2014, 11:26 AM   #15
Alobar

Join Date: Nov 2003
Location: 3rd turtle from the bottom
Posts: 41,298
Re: I really can't get my head around OOP

Quote:
 Originally Posted by splashpot Android development is java.
what??? Now Im really confused!!

I know its not another language, but the person I was addressing knows that as well, so I thought the meaning of what I was saying was clear enough. maybe not.

Quote:
 https://www.udacity.com/course/ud853 - taught by google developers https://www.coursera.org/course/android - this one starts in a month but if you click preview lectures, i think the videos are available now These courses still assume a proficient level of java knowledge though.
I never ran across that first one, thanks for the link. I'll have to watch the videos. That coursera course isnt very good (Ive taken it), I mean its worth it I guess cuz its free and its one of the better free lecture ones on android ive done, but you arent going to be able to take just that and be able to do anything worth a **** on your own or even have that be your main source of lean and you fill in the gaps with other resources.

I guess thats what I mean in regards to android and lectures, I have yet to find any lecture source (even a pay one like treehouse, which sucks btw) where you can use just that as your main point of learning and then use other resources to fill in the gaps and come to a decent understanding of whats going on.

Thats just my experience with it. I've done a TOOOON of self learning on all kinda of subjects, and teaching myself how to make android apps is the first time ive ever struggled or gotten frustrated with the available resources. obviously everyone is going to be different.

 08-28-2014, 08:59 PM #16 Bantam222 veteran     Join Date: Aug 2006 Location: Seattle Posts: 2,381 Re: I really can't get my head around OOP I agree with Alobar. Self learning Android was one of the trickier things I have had to do. I'm very comfortable with Java, that was not the issue.
08-29-2014, 11:09 PM   #17
vento
journeyman

Join Date: Mar 2009
Posts: 311
Re: I really can't get my head around OOP

Quote:
 Originally Posted by Bantam222 I agree with Alobar. Self learning Android was one of the trickier things I have had to do. I'm very comfortable with Java, that was not the issue.
I am starting to learn java as well and the whole concept of OOP is somethingim gradually learning. Any good books other resources how to structure your program and design it in order to use OOP without line of code written yet. What im interested is how people design their OOP programs. Would be great if you know tutorials walking you the process for some simple programs. Could be even with pseudocode..how to draft classes on paper, write down methods under them etc

Obviously you cant just create perfect plan and execute it and people work different ways but understanding how people approach the problem and map the program beforehand would make it so much easier to code.

Anyone know good recources to learn methodical approach designing/creating programs?

Last edited by vento; 08-29-2014 at 11:27 PM.

08-30-2014, 12:48 AM   #18
Carpal \'Tunnel

Join Date: Sep 2002
Location: Russian Troll
Posts: 21,508
Re: I really can't get my head around OOP

Quote:
 Originally Posted by vento I am starting to learn java as well and the whole concept of OOP is somethingim gradually learning. Any good books other resources how to structure your program and design it in order to use OOP without line of code written yet. What im interested is how people design their OOP programs. Would be great if you know tutorials walking you the process for some simple programs. Could be even with pseudocode..how to draft classes on paper, write down methods under them etc Obviously you cant just create perfect plan and execute it and people work different ways but understanding how people approach the problem and map the program beforehand would make it so much easier to code. Anyone know good recources to learn methodical approach designing/creating programs?
Just start winging it from the keyboard it has been known to happen.

As far as developing new code embrace the concept of refactoring, it is something that is pretty much inevitable. To me the key is coming up with good base classes that are "naturally" (for lack of a better word) extensible. I could get really into the weeds with this so I'll just say there are a lot of resources including books that will take you through example programs that illustrate the key concepts. Here's one I think is good, Python 3 Object Oriented Programming. Work through the examples as you go through the book and maybe experiment with some changes. Nothing like having to fix code that doesn't work to help you learn in my view. So yeah be bold in experimenting.

Last edited by adios; 08-30-2014 at 01:03 AM.

 08-30-2014, 05:47 AM #19 Craggoo culled     Join Date: Sep 2006 Location: R.I.P. ItzPenzoo 12-09-11 Posts: 12,533 Re: I really can't get my head around OOP When you learn something new, find a way to apply it. For example, if you had just learned about a function recursively calling itself re-write an old function that replaces for/while loops with recursive calls.
09-03-2014, 03:43 PM   #20
Alobar

Join Date: Nov 2003
Location: 3rd turtle from the bottom
Posts: 41,298
Re: I really can't get my head around OOP

Quote:
 Originally Posted by splashpot https://www.udacity.com/course/ud853 - taught by google developers.
I know thats not what this thread is about, but thought id comment for people who come across this and who are interested in android. I worked through this class and thought it was excellent, easily best one ive seen for android.

 10-29-2017, 11:55 AM #22 leavesofliberty Carpal \'Tunnel   Join Date: Jul 2010 Location: probably busto Posts: 6,260 Re: I really can't get my head around OOP Find a tutor. Oh nevermind, you seem to be doing that already.
 11-08-2017, 05:26 PM #23 Sean newbie   Join Date: Nov 2017 Posts: 47 Re: I really can't get my head around OOP Try reading a book.
 07-12-2018, 02:48 PM #24 TB303 adept   Join Date: Sep 2008 Location: not dead yet Posts: 750 Re: I really can't get my head around OOP Learned to program on ZX speccy too....and also struggled with OOP. My advice.... FxxK IT! Learn C instead. Also javascript and other modern FUNCTIONAL PROGRAMMING languages. OOP is bs, everyone I speak to who programs in the OOP paradigm takes 10 years to write the simplest of software, all the code they're writing to save them time for reuse later on, simply never gets reused! I never did computer science and I've worked in the field for 15 years, ok I struggle when someone throws their C# code at me for help (thankfully java is long dead). Abstraction = bs word people use to make sure everyone knows they took a CS course after flunking what they went to uni for Inheritance = biggest joke in OOP, DO NOT DO IT Polymorphism = forget it.... OOP is dead. Trust me. Get into Scala or something.
07-12-2018, 03:49 PM   #25
antialias
journeyman

Join Date: May 2018
Posts: 302
Re: I really can't get my head around OOP

Quote:
 OOP should only really be introduced after you've learned to link everything together.
I don't agree with this. I've taught people who had previously learned spaghetti code and those who have never coded at all.

It is way easier to get people who have never coded to develop good coding skills than those who started off with spaghetti code.
The latter have to unlearn a lot of stuff that might get quick results on tiny tasks but lead to no end of pain on even moderately complex one (and mostly to code that is so complex that they eventually have to trash everything and start over).

Not to mention that spaghetti coders are less than useless in any kind of team environment.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Links to Popular Forums     News, Views, and Gossip     Beginners Questions     Marketplace & Staking     Casino & Cardroom Poker     Internet Poker     NL Strategy Forums     Poker Goals & Challenges     Las Vegas Lifestyle     Sporting Events     Other Other Topics Two Plus Two     About the Forums     Two Plus Two Magazine Forum     The Best of Two Plus Two Marketplace & Staking     Commercial Marketplace     General Marketplace     Staking - Offering Stakes     Staking         Staking - Offering Stakes         Staking - Seeking Stakes         Staking - Selling Shares - Online         Staking - Selling Shares - Live         Staking Rails         Transaction Feedback & Disputes     Transaction Feedback & Disputes Coaching & Training     Coaching Advice     Cash Game Poker Coach Listings     Tournament/SNG Poker Coach Listings Poker News & Discussion     News, Views, and Gossip     Poker Goals & Challenges     Poker Beats, Brags, and Variance     That's What She Said!     Poker Legislation & PPA Discussion hosted by Rich Muny     Twitch - Watch and Discuss Live Online Poker     Televised Poker General Poker Strategy     Beginners Questions     Books and Publications     Poker Tells/Behavior, hosted by: Zachary Elwood     Poker Theory     Psychology No Limit Hold'em Strategy     Medium-High Stakes PL/NL     Micro-Small Stakes PL/NL     Medium-High Stakes Full Ring     Micro-Small Stakes Full Ring     Heads Up NL     Live Low-stakes NL Limit Texas Hold'em Strategy     Mid-High Stakes Limit     Micro-Small Stakes Limit Tournament Poker Strategy     STT Strategy     Heads Up SNG and Spin and Gos     Mid-High Stakes MTT     Small Stakes MTT     MTT Community     Tournament Events Other Poker Strategy     High Stakes PL Omaha     Small Stakes PL Omaha     Omaha/8     Stud     Draw and Other Poker Live Poker     Casino & Cardroom Poker         Venues & Communities         Regional Communities     Venues & Communities     Tournament Events         WPT.com     Home Poker     Cash Strategy     Tournament Strategy Internet Poker     Internet Poker         Global Poker         MPN – Microgaming Poker Network         BetOnline.ag Online Poker     Commercial Software     Software         Commercial Software         Free Software General Gambling     Backgammon Forum hosted by Bill Robertie.     Probability     Sports Betting     Other Gambling Games 2+2 Communities     Other Other Topics         OOTV         Game of Thrones     The Lounge: Discussion+Review     EDF     Las Vegas Lifestyle     BBV4Life         omg omg omg     House of Blogs Sports and Games     Sporting Events         Single-Team Season Threads         Fantasy Sports     Fantasy Sports         Sporting Events     Wrestling     Golf     Chess and Other Board Games     Video Games         League of Legends         Hearthstone     Puzzles and Other Games Other Topics     Politics and Society     Playground: Well Named Loves Social Science     History     Business, Finance, and Investing     Science, Math, and Philosophy     Religion, God, and Theology     Travel     Health and Fitness     Laughs or Links!     Computer Technical Help     Programming

All times are GMT -4. The time now is 07:33 AM.

 Contact Us - Two Plus Two Publishing LLC - Privacy Statement - Top