Jump to content

Dear Ouch 8-s


Recommended Posts

dear ouch8s,i want to learn how to program computers. i know BASIC, but little to nothing about object oriented programming. where do i start? do you recommend a book?love, checky
Sorry for stepping on your toes here, Ouch, but you're more PC/hardware type guy than programmer, right?First I recommend that you learn an OO language. If you think that you will be using this long-term, pick either Java or C++, depending on what you want it for. I haven't used Python, but have heard that it's pretty friendly and easy to use. Any decent reference for any OO language will have examples of what OO means. For example, if you choose Java, the Sun website keeps going back to their "bicycle" class as an example (a poor one, imo, but still an example). Once you see a dozen or so examples, most of the mystery will be gone.Once you are familiar with the language so that you can read code from that language, you may or may not have reached your level of curiosity about OO. If not, and you want to get hardcore about it, Grady Booch is da man, and this appears to be his current "standard" text. I haven't read this one, but his early OO books defined the subject:http://www.amazon.com/Object-Oriented-Anal...694&sr=8-13(although this seems to be the Kindle only version, I'm not sure where the paper version is....).The basics of OO are relatively simple, but unfortunately, the nitty gritty of OO is one of those things that is hard to teach except by experience. Do it wrong and re-write 50K lines of code, and the next time you'll be a lot smarter.This is probably the best website for learning Java from scratch:http://www.javabeginner.com/with introductions to OO concepts.
Link to post
Share on other sites
  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Sorry for stepping on your toes here, Ouch, but you're more PC/hardware type guy than programmer, right?
yeah, that's right, and i was just waiting for him to post some boob pix before i said i had no idea.
Link to post
Share on other sites
yeah, that's right, and i was just waiting for him to post some boob pix before i said i had no idea.
Would you really want to see any boob pics that Checky is interested in?
Link to post
Share on other sites
dear ouch8s,i want to learn how to program computers. i know BASIC, but little to nothing about object oriented programming. where do i start? do you recommend a book?love,checky
I recommend Python over Java. I have studied Java at Uni, and taught myself Python over the last couple of months, and Python is so much easier. You'll be actually programming quicker, which will make learning more fun.Also python will make you layout your code correctly right from the beginning, a good habit to develop.
Link to post
Share on other sites
I recommend Python over Java. I have studied Java at Uni, and taught myself Python over the last couple of months, and Python is so much easier. You'll be actually programming quicker, which will make learning more fun.Also python will make you layout your code correctly right from the beginning, a good habit to develop.
Hmmm, I may have to learn it in all my spare time.... (children: ages 11 -- in sports, 3, 2), so that should be in about 15 years.I've heard it's way easer than Java or C++, so if you are learning only to satisfy a burning desire to program, it's probably a good choice. If you are learning because it may be something you would use on a job or you are planning on writing a web page, I'd still give the nod to Java. OK, now I'm going to go read some Python pages.....
Link to post
Share on other sites
OK, now I'm going to go read some Python pages.....
OK, a quick run-through a couple of online tutorials for Python.....I don't see a lot of reason to pick it over Java. It's about equal on the difficulty scale, and has a couple of things I hate, such as weak typing (which is definitely anti-OO), whitespace matters to program behavior, and arbitrary small differences from other languages that doesn't seem to gain us anything.
Link to post
Share on other sites
OK, a quick run-through a couple of online tutorials for Python.....I don't see a lot of reason to pick it over Java. It's about equal on the difficulty scale, and has a couple of things I hate, such as weak typing (which is definitely anti-OO), whitespace matters to program behavior, and arbitrary small differences from other languages that doesn't seem to gain us anything.
I thought the white space thing was stupid at first, but now I think it's genius. There's always this problem of trying to keep the formatting and the logic in synch with other languages, and Python dodges the whole matter.Disclaimer: I don't really know Python.
Link to post
Share on other sites
OK, a quick run-through a couple of online tutorials for Python.....I don't see a lot of reason to pick it over Java. It's about equal on the difficulty scale, and has a couple of things I hate, such as weak typing (which is definitely anti-OO), whitespace matters to program behavior, and arbitrary small differences from other languages that doesn't seem to gain us anything.
I was never able to read files in Java (note; I might've just sucked when I tried), and I could with Python. Much easier. Why is weak typing bad?Having whitespace matter will teach you good coding habits, great for a first language.
Link to post
Share on other sites
I was never able to read files in Java (note; I might've just sucked when I tried), and I could with Python. Much easier. Why is weak typing bad?Having whitespace matter will teach you good coding habits, great for a first language.
I think the reason it's hard to read Java is the examples blow up so quickly into really hard stuff, but the language itself is readable. Weak typing is bad because it leads to errors through types being converted unexpectedly. In a small program for a class, there is probably no difference. On a project with multiple people and long, complex code, it's inviting disaster.The reason I don't like "whitespace as syntax" is I can find plenty of other ways to introduce errors without worrying about characters I can't see. But I agree, most people could use better formatting skills. I'm a fanatic at using whitespace for readability purposes, so it wouldn't bother me, but I can see spending time debugging someone else's program only to belatedly notice a missing space....grrrrrrrrrr!
Link to post
Share on other sites
The reason I don't like "whitespace as syntax" is I can find plenty of other ways to introduce errors without worrying about characters I can't see. But I agree, most people could use better formatting skills. I'm a fanatic at using whitespace for readability purposes, so it wouldn't bother me, but I can see spending time debugging someone else's program only to belatedly notice a missing space....grrrrrrrrrr!
But the plus side is that you don't have to belatedly notice this doesn't do what the whitespace implies:
if(x==42)   foo(x);   bar(x);return y;

Link to post
Share on other sites

well, all i can say is try downloading the game again?also, "cat ciero" sounds like a girls name, and then she started talking about diagnostics and torture testing - i'm getting hard. boob pix, stat.

Link to post
Share on other sites
well, all i can say is try downloading the game again?also, "cat ciero" sounds like a girls name, and then she started talking about diagnostics and torture testing - i'm getting hard. boob pix, stat.
he did say "her" computer, so yes.A WOMAN, ON THE INTERNET!!WHO KNEW
Link to post
Share on other sites
I think the reason it's hard to read Java is the examples blow up so quickly into really hard stuff, but the language itself is readable.
Sorry I meant reading text files, not actually reading code. It's just so much easier to manipulations of and reading of files, at least for me.
Link to post
Share on other sites
Sorry I meant reading text files, not actually reading code. It's just so much easier to manipulations of and reading of files, at least for me.
Oh yeah, the Java model is a bit complex, but if you grew up through Unix it makes fairly decent sense. I wrote a wrapper so that I only had to figure it out once, then I just have a package with Open, GetLine, and Close.
Link to post
Share on other sites
What's with all this programming gobbeldy gook....I was told there'd be boob pics.
for (i=0;i++;i<1000) { view image (normal_Huge-Boobs.jpg ) up(); down(); if (!continue) return;}
Link to post
Share on other sites

Can anyone tell my why this SQL code is not working. MySQL if that helps

cursor.execute("""CREATE TABLE hands(								hand_id		int PRIMARY KEY,								number		long,								limit 		int)								ENGINE=InnoDB""")

Edit: Or better still why that code doesn't work, but this one does,

cursor.execute("""CREATE TABLE players(								player_id	int PRIMARY KEY,								name		varchar(80)	Unique,								profit		DECIMAL(20,2) Default 0.00,								no_hands	int Default 0) 								ENGINE=InnoDB""")

Link to post
Share on other sites
Can anyone tell my why this SQL code is not working. MySQL if that helps
cursor.execute("""CREATE TABLE hands(								 hand_id		int PRIMARY KEY,								 number		long,								 limit		 int)								 ENGINE=InnoDB""")

Edit: Or better still why that code doesn't work, but this one does,

cursor.execute("""CREATE TABLE players(								 player_id	int PRIMARY KEY,								 name		varchar(80)	Unique,								 profit		DECIMAL(20,2) Default 0.00,								 no_hands	int Default 0) 								 ENGINE=InnoDB""")

Are you getting an error? I'm not sure, but I think it's because long isn't a sql data type.From this link it appears your choices are: integer (or int), smallint, decimal (or dec), numeric, plus the MySQL extenesions of TinyInt, MediumInt, and BigInt. You probably shouldn't use these last 3 as it hurts portability.
Link to post
Share on other sites

I only just added the "limit int" line, up until now code has been working.Obviously this is poker program (Oh Noes, there goes the surprise) so that has to be a long, as it's the actual hand number, which is big. Code works again if I remove that line.Edit: worked it out, limit must be a reserved word, changed it to limit_id and it works again

Link to post
Share on other sites
I only just added the "limit int" line, up until now code has been working.Obviously this is poker program (Oh Noes, there goes the surprise) so that has to be a long, as it's the actual hand number, which is big. Code works again if I remove that line.
Oh, then it's because 'limit' is a reserved word, try calling it "game_limit" or something like that and try again.
Link to post
Share on other sites
for (i=0;i++;i<1000) { view image (normal_Huge-Boobs.jpg ) up(); down(); if (!continue) return;}
Those aren't boobs. Those are deformities. Calling David Sklansky!!!
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements


×
×
  • Create New...