Page 1 of 2

Basic tutorial rant and rave

Posted: Mon Mar 21, 2005 1:41 pm
by Levi
DARN IT ALL!!!!

I've noticed this each time I've started a new programming language. Their first if..then statements.

The most recent to bust my bubble is this one for C++. Having been a long time since I've used the langauge I was reviewing it only to find something like this in a function for a quiz program.

if (cAnswer == 'a'){ cout << "Correct answer!" << endl;}
if (cAnswer == 'b'){ cout << "Incorrect!" << endl;}
if (cAnswer == 'c'){ cout << "Incorrect!" << endl;}
if (cAnswer == 'd'){ cout << "Incorrect!" << endl;}

Now this isn't too bad but they never teach you how to be creative with the code you've already learned. At this point I've already learned functions, if..thens (obviously), variables, operators(arithmatic, logical, $$$), and scopes.

I could easly fix this code to be shorter.

int iIsCorrect = 0;

if(cAnswer=='a')
{
cout << "Correct Answer!" << endl;
iIsCorrect = 1;
}

if(iIsCorrect != 1){ cout << "Incorrect!" << endl;}

This does the same thing. If it wasn't correct then iIsCorrect will not equal 1 and Incorrect will be written to the screen. And because of scope and the fact that it's in a function iIsCorrect will be deleted when the code leaves the function. Thus everytime you call the function iIsCorrect always = 0. A lot simpler. Why don't they teach this? Why don't they teach code optimization or any of that as you go along. NOt in detail but in short little things? Huh? Man that really grinds my beans.

Okay I'm done.

Posted: Mon Mar 21, 2005 3:40 pm
by {Nathan}
Thats cuz some people suck and wouldn't understand that... Ratt, you get what Im saying, right?!

Posted: Mon Mar 21, 2005 4:01 pm
by Mitth'raw'nuruodo
No. He doesn't lol :lol: .

Well, Levi. Some people are just plain stupid, and when somebody writes a good tut or teaches a class, they must assume that the person has the IQ of a rock. So that's the answer to your question.

Hey how about this, YOU make a tut for C++ and I'll give it to somebody that doesn't know anything about it, and see it they can learn anything from it.... :roll:

Posted: Mon Mar 21, 2005 4:05 pm
by Levi
I'm sorry I have a terrible time communicating what I'm trying to get at.

I'm not saying they should only show them my example. The first one is fine, but to simply leave it at that without showing them how to take what they've already learned and use them to manipulate the program in different ways is a waste. It teaches the basic ideas and leaves it at that. It doesn't help prepare someone for more creative programming.

I say show them the first one, then come back and say "we could shorten this up so that we only need two if statements. Look at it in this way..." and then show the shortened example. I mean sure after this chapter they got into If...else statements but it could be progressive by doing the long version, the shorter version, then the if...else version. Really be progressive with it.

Posted: Mon Mar 21, 2005 4:10 pm
by Mitth'raw'nuruodo
Oh, I knew what you said, still, try making one and see how you like other people criticising it.

PS. That would be a good thing for your site :wink:

Posted: Mon Mar 21, 2005 4:13 pm
by Levi
You make it sound like I wouldn't like people criticizing my work.

After years of writing and posting short stories you tend to get use to such things. :D

I just don't like the standard that most tutorials set for presenting programming.

Besides, it's a rant. In the end they mean nothing. I didn't even think people would post.

But a tutorial section on my site is being worked out. So long as I can get submissions. Because I'm not an articulate person in the technical writing field. My F grade in that class proves it. :D

Although, my rant was echoed by my teacher who is also a programmer.

Posted: Mon Mar 21, 2005 4:18 pm
by Mitth'raw'nuruodo
Heh, well English is a waste of a class anyways. :D

Posted: Mon Mar 21, 2005 4:24 pm
by Levi
You're mocking my chosen field Dude. :o Okay teacher is my chosen field, but an English teacher.

Posted: Mon Mar 21, 2005 10:31 pm
by Mitth'raw'nuruodo
Ok...Ummm...I still think its a waste. No meaning to mock but seriously, I can speak and write English, sooo why must I take it?

1 more quick Q: What is your Avatar? Ummm...mabey Who is the better question here.

Posted: Tue Mar 22, 2005 1:20 am
by Levi
Kurt Wagner a.k.a NightCrawler

X-men evolution.

And if you're american you don't speak English. And English is more than grammar and words. Its how the words are placed together. It's being able to take wortheless scribbles and make them into a work of art. It's the chance to share emotions and ideas like you never could before.

There's just something about English that programming and computers never held for me. To each his/her own on what they prefer, but it's not worthless. Far from it, a living language is what it is. Ever changing, ever evolving to express things. Sorry, I just love it that much.

Posted: Thu Mar 24, 2005 12:16 am
by Nodtveidt
If you live in the USA, you speak Americanese, or American English. :D And depending on what area of the USA you live in, you likely speak a different dialect of Americanese. For example...I speak "Newenglandese", a variation of Americanese spoken by people who live (or in my case, lived) in New England (that's the states in the northeastern corner of the USA for those who don't know...and NO, New York is NOT one of them). I always cite one example of variation...ever heard of a "condiment wheel"? To someone who doesn't speak Newenglandese, a condiment wheel might be thought of as something like one of those spinning spice racks (the phrase isn't common outside of New England so very few non-New Englanders have even heard of it, let alone know what it is)...but in New England, a condiment wheel is a circular rack that looks sorta like a ferris wheel that holds bowls of side-dishes (like corn, beans, etc)...they're often used in rural restaraunts, especially in tourist areas.

On the east side of the USA, when you go south and get to Virginia, you start hearing Southern Americanese, which IMO is a total bastardization of the language. Grammar rules fly out the window. "I dun got nun dat". The deeper south you go, the worse it gets. Texas, being the rebel state it is, has its own version of Southern Americanese which differs somewhat from the coagulated soup that oozes from the mouths of the southeasterners. But it's still soup. :D

Once you've travelled the country a lot (like I have), you can often tell where a person's from just by listening to how they speak...accents, grammar, phrases spoken, and noun usage are all clues to where someone's from in the USA. It's quite interesting. :)

Posted: Thu Mar 24, 2005 11:54 am
by Guest
The official term for American English is General American ^_^

Or so my university teachers tell me :P

Posted: Thu Mar 24, 2005 4:13 pm
by Mitth'raw'nuruodo
Ah, I knew it looked familiar...(nightcrawler)

Levi:
English is art to you, eh? Know the feeling...not for English of course :wink:

Nek:
Hmmm...For somebody from P.Rico (don't know how to spell the first one)...you know the US's accents well, and your right.

We call the "Southern Americanese" as you call it, Southern. lol
Ummm....Ya the US is soooo culturally different that we all have different accents. And you can tell where somebody's from by the way they speak. In fact if your here long enough, you can tell which city they're from. :wink:

Posted: Thu Mar 24, 2005 4:48 pm
by Rattrapmax6
:) Okay, I have the bad habbit of typing how I speak, which leaves me to misspell words in a cluch (typing fast in this case) since not all words are spelled how they are prononced.. Now that you know that, what part of the US am I from??? heh. :wink:

Oh, Levi, I don't know much C++, life long dream, got DEV C++, but find little time now to learn.. but. would not this be even shorter?

Code: Select all

if(cAnswer=='a') { cout << "Correct Answer!" << endl; } 
if(cAnswer != 'a'){ cout << "Incorrect!" << endl;}
:) ??? :wink:

Posted: Thu Mar 24, 2005 4:56 pm
by Mitth'raw'nuruodo
Accually this would be 'less' code in C++.

Code: Select all

if(cAnswer=='a') { cout << "Correct Answer!" << endl; } 
else{ cout << "Incorrect!" << endl;} 
anyways...I saw that Rattra! You had different code there before...nice catch on that error...lol

As for where you live....hmmm....GMT -5. HA! jk
Note: I said how they speak, not how they write. :wink:

Posted: Thu Mar 24, 2005 5:28 pm
by Rattrapmax6
Mitth'raw'nuruodo wrote:As for where you live....hmmm....GMT -5. HA! jk
Note: I said how they speak, not how they write. :wink:
I write how I speak, tho I add on sometimes to make it carry with more fancy,. just not as much as Adigun,. is he a writer, poet?? he is so fluid with his post...

At least you narrowed to the east side of USA, that leaves? 13 states to chose from, aye? heh heh heh.. :wink: ..

1. Maine
2. Rhode Island
3. New York
4. Maryland
5. West Virgina
6. Virgina
7. Florda
8. Connecticut
9. Massacusetts
10.Vermont
11.Pennsylvania
12.Delaware
13.North Carolina
14.South Carolina
15.Georgia

No, 15, If I didn't forget any, hmm.... oh well, does that help? :D :lol: :D

Posted: Thu Mar 24, 2005 6:16 pm
by Levi
In truth both are. I didn't use Else because...wait you know the reason. Need to stop typing.

Okay, well cool. Later.

Posted: Thu Mar 24, 2005 10:41 pm
by Nodtveidt
Mitth'raw'nuruodo wrote:Nek:
Hmmm...For somebody from P.Rico (don't know how to spell the first one)...you know the US's accents well, and your right.
Probably because I'm not from Puerto Rico at all...this is simply where I live... :P

Posted: Thu Mar 24, 2005 10:47 pm
by Mitth'raw'nuruodo
Nek:
ohhh, well sorry Nek. he....I'm not doing to well today... :roll:

Levi:
No I don't know the reason....can you enlighten me? no that's not a lighting me. lol :lol:

Rattra:
Ya ok, that's 15 out of 50...ha ha lol. And out of the world...1 out of 24 (time zones).

You know I was talking about how say the words, that means both the words/abr. you say, grammer structure etc. AND how you pronounce them, your accent.

I cannot tell, cause I need to hear your accent. heh.

Posted: Fri Mar 25, 2005 4:06 pm
by Rattrapmax6
Mitth'raw'nuruodo wrote:I cannot tell, cause I need to hear your accent. heh.
Fine, put it this way, Nek's comment would come to a insult to some where I live... I'm right in the begining parts of the south-east, I've never talked like that, and frankly never heard anyone else speak like that in person.. :wink: , no hard feelings, it does make quite the joke..

But I can also mimick accents I hear, so, I would be the hardest to place in that since... Ausie, Egnland, if I hear it in a range of words, I can match it.. :wink:

I can also mimick some of the star wars characters too, FYI, I can mimck alot of things! :D