You're telling him to be careful about errors, but:
I'm just being picky though
I thought that was pretty organised for Quick BASIC though. I can't tell you how bad some peoples code organizing is though! I found the source code for this one game called "Roboraider" and the organizing was atrocious! Everything was in a single line down the left hand side with no line spacing, and he didn't have anything to the actual program in the main page either. Everything was in it's own subscript and the only line in the main page was:
CALL INTRO ()
There were about 30 other subscripts and it was impossible to fallow his code.
I thought that was pretty organised for Quick BASIC though. I can't tell you how bad some peoples code organizing is though! I found the source code for this one game called "Roboraider" and the organizing was atrocious! Everything was in a single line down the left hand side with no line spacing, and he didn't have anything to the actual program in the main page either. Everything was in it's own subscript and the only line in the main page was:
CALL INTRO ()
There were about 30 other subscripts and it was impossible to fallow his code.
I was referring to the grammatical errors in your post :/
If you're looking for a good introductory Java book I'd recommend the 3rd edition of Bruce Eckel's "Thinking in Java" which is available for free online: http://www.mindviewi.../downloads.html Reading through the first few chapters and trying to get a couple of the examples running should give you a good idea of what to expect for your course.
The 4th edition of the book is available on Amazon for purchase: http://www.amazon.co.../dp/0131872486/ however, the 3rd edition still contains plenty of relevant information and should cover enough to get you started.
For game programming a great resource is http://www.gamedev.net/ They have a great community on the forums and plenty of articles for beginners.
Don't take the path I took. (I learned C++ as my first language.)
The moment you start playing with pointers and run your programs, you will get this friendly message:
Segmentation fault: 11
That means you accessed memory that the OS doesn't want you to. (The memory location might also just flat-out not exist.) It's a nasty error, and you have to be constantly watching for uh-ohs like that.
Huh? C++ was my first language and that's only happened to me once, which was a simple bug.
I thought that was pretty organised for Quick BASIC though. I can't tell you how bad some peoples code organizing is though! I found the source code for this one game called "Roboraider" and the organizing was atrocious! Everything was in a single line down the left hand side with no line spacing, and he didn't have anything to the actual program in the main page either. Everything was in it's own subscript and the only line in the main page was:
CALL INTRO ()
There were about 30 other subscripts and it was impossible to fallow his code.
K, so you're hounding him for putting source code in seprate files and then keeping the least amount of code in the main page? Oh god, he should be locked up for his crimes.
You realize that's actually good programming practice, correct?
-----------------------------------
Ugh, the posts posted before can make a C++ fanboy (like myself) go insane.
K, so you're hounding him for putting source code in seprate files and then keeping the least amount of code in the main page? Oh god, he should be locked up for his crimes.
You realize that's actually good programming practice, correct?
No, all the source code was saved in a single .BAS file, he was calling subscripts from inside of subscripts, he re-coded the robot movement every level, and there were no third party databases, bsaved images, nothing. It was all just one single .BAS file.
Your supposed to have the main loop of the program in the main section, not just "CALL INTRO ()" and then go into sub-scripting. This is not C++ for Windows or anything, this is Quick Basic 4.1 for MS-DOS and compatible systems. Big difference.
This makes no sense at all. C++ exists in multiple platforms.
this is Quick Basic 4.1 for MS-DOS and compatible systems.
Cool, I know what it is. I don't understand where you're going with this?
No, all the source code was saved in a single .BAS file, he was calling subscripts from inside of subscripts, he re-coded the robot movement every level, and there were no third party databases, bsaved images, nothing. It was all just one single .BAS file.
Okay, I thought you meant it was saved in multiple different source files and you were hounding him for it. Can you give me a link to the source so I can give it a proper review?
Your supposed to have the main loop of the program in the main section, not just "CALL INTRO ()" and then go into sub-scripting. This is not C++ for Windows or anything, this is Quick Basic 4.1 for MS-DOS and compatible systems.
Big difference.
Uh, I know how a program is supposed to be designed. I know how QuickBASIC works.
Okay, I thought you meant it was saved in multiple different source files and you were hounding him for it. Can you give me a link to the source so I can give it a proper review?
Wow. Trying to copy the source code into the post keeps freezing my browser! I have to copy it 1 sub script at a time (201 KB)
No, all the source code was saved in a single .BAS file, he was calling subscripts from inside of subscripts, he re-coded the robot movement every level, and there were no third party databases, bsaved images, nothing. It was all just one single .BAS file.
Your supposed to have the main loop of the program in the main section, not just "CALL INTRO ()" and then go into sub-scripting. This is not C++ for Windows or anything, this is Quick Basic 4.1 for MS-DOS and compatible systems. Big difference.
No, he was doing it properly. YOU were doing it wrong. Having any substantial code execute outside of subroutines (They are called SUBROUTINES, not subscripts, I Suggest you stop referring to subroutines as "subscripts" unless you want to paint yourself further into the amateur corner) is generally accepted good practice and is enforced by most textbooks. I have a college textbook from the mid 80's which effectively says that if your version of BASIC supports subroutines, you should be simplifying your top-level code as much as possible, which includes using subroutines.
Of course, the code in this case is amateurish garbage- but that is absolutely no surprise, since 100% of quickBASIC code is in fact garbage made by people that don't know what they are doing.
I don't know what's worse- The lack of indentation, or the lack of a repetable programming style.
The worst part is that it's actually better than most QuickBASIC stuff being produced. Consider how Ham62 keeps referring to subroutines as "subscripts"; this is most likely because the idea of subroutines is confusing and strange to him, just as it is to almost any person who still things QuickBASIC is a viable development platform.
C++ is a pretty good language to start the struggle of programing . Start with simple stuff like showing some text on a window.Never try to get into the bread from the very start , like trying to make a game or stuff.And if you learn one of the main languages , the others will be a piece of cake to learn . They are pretty much the same thing with different syntax.
This is what I did actually. I like it. But I did have some experience with Ruby and GML before I actually started C++. Didn't help me much since it's really different from the two.
The worst part is that it's actually better than most QuickBASIC stuff being produced.
Of course, the code in this case is amateurish garbage- but that is absolutely no surprise, since 100% of quickBASIC code is in fact garbage made by people that don't know what they are doing.
Yes... because when my dad was doing Quick Basic programming in the lab in the 90's everything was complete garbage...
The worst part is that it's actually better than most QuickBASIC stuff being produced. Consider how Ham62 keeps referring to subroutines as "subscripts"; this is most likely because the idea of subroutines is confusing and strange to him, just as it is to almost any person who still things QuickBASIC is a viable development platform.
Subroutines are not confusing or strange to me. My dad taught me to program in this language (after I kept begging to him to), so I know how to use subscripts and that you should avoid using the GOTO statement at all costs. Instead of using a long list of IF statements after a INPUT command, it is more efficient to use the CASE SELECT command etc.
I could also do graphics. I made an Etch-a-Sketch program after all.
Yes... because when my dad was doing Quick Basic programming in the lab in the 90's everything was complete garbage...
Then we agree. Though your sarcasm is obvious it has the flaw that it's still accurate. The fact that somebody was using QuickBASIC for technical computing doesn't make it less garbage, it just means they make poor choices. MatLab is superior for that application in almost every perceivable way.
Subroutines are not confusing or strange to me.
You called them subscripts. subscripts are something completely different.
My dad taught me to program in this language (after I kept begging to him to), so I know how to use subscripts
You called them subscripts again.
This is a subroutine:
Sub someroutine()
'stuff
End Sub
This is a subscript:
SomeArray(0)
They are simply not the same, and confusing them in any capacity means their particulars are clearly not clear to you.
and that you should avoid using the GOTO statement at all costs.
Great, so you are subscribing to cargo-cult programming. He told you you should avoid using goto. Did he tell you why? did he tell you what situations arise when it's used a lot? Probably not. And even if so the fact is that Goto, like any language element, has it's place. Trying to follow some idea of purity get's in the way of getting things done. Following numerous control flow statements that require early exits is tricky in QuickBASIC because the control flow is limited; (no continue statement, for example). So you end up using a flag, exiting the inside loop, and then each iteration of the outer loop, checking a flag:
Dim FoundA as Integer, FoundB As Integer
Dim I As Integer
Dim Flag as Integer
For I = 0 to 100
For J = 0 to 100
If SomeArray(I,J) = SearchValue Then
FoundA = I
FoundB = J
Flag=1
Exit For
End If
Next J
If Flag=1 Then Exit For
Next I
Dim FoundA as Integer, FoundB As Integer
Dim I As Integer
Dim Flag as Integer
For I = 0 to 100
For J = 0 to 100
If SomeArray(I,J) = SearchValue Then
FoundA = I
FoundB = J
Goto LoopExit
End If
Next J
Next I
LoopExit:
The first example takes structured programming purity as gospel- because QuickBASIC doesn't have a way to break out of a specified control structure (the only one I can think of off-hand that does is Java), it basically ends up as a gross hack all in the interest of avoiding the use of goto statements.
Instead of using a long list of IF statements after a INPUT command, it is more efficient to use the CASE SELECT command etc.
Select Case, and it's a statement, and doesn't apply in all situations unless every single test in the Else-If ladder is only checking your input, and not checking anything else. It's analogous to a C/C++/C#/Java switch, but switch's are more limited since they intend to compile to jump tables. Usually I go for a switch(true) or Select Case True and have each Case be an expression; the first true statement block is executed, pretty much the same as with an elseif with the advantage of a jump table, of sorts.
Great, so you are subscribing to cargo-cult programming.
I had never heard of them before this. My dad said not to use the GOTO statement because he said over use of it makes your program like a bowl of spaghetti; to hard to fallow one action because it takes you all over the place when your making a complex program. Same thing with GOSUB. That's why we have the CALL statement for calling subroutines.
I don't know how to do Java programming, or C#, or Turbo C, or really anything to do with C. I know Commodore BASIC (yes I know, the most irreverent language now), Quick Basic, and a wee bit of Visual Basic. Would you suggest I learn C# or something? My dad just does Visual Basic programming now, should I just continue with this instead? I'm, not going to stop with Quick Basic though, not until all 3 of my MS-DOS systems die.
Yes for the love of all that is good switch to something like C# or Java. You will go nowhere if you stick with dead languages. Just because your dad chooses to live in the past doesn't mean you should too. A good programmer knows when it's time to move on. As technology evolves, programmers must evolve as well to keep with the times.
Rollback Post to RevisionRollBack
Quote from TheFieldZy »
Nobody's perfect, so neither is Hannah Montana Linux, but it's pretty great.
Quote from BC_Programming on Operating Systems »
They all suck. They just suck differently. Sort of like prostitutes.
I don't get it... what is ironic about it exactly?
At least 86% of what I say is always correct.
You're telling him to be careful about errors, but:
Unorganized code is to hard to fallow
I'm just being picky though
I thought that was pretty organised for Quick BASIC though. I can't tell you how bad some peoples code organizing is though! I found the source code for this one game called "Roboraider" and the organizing was atrocious! Everything was in a single line down the left hand side with no line spacing, and he didn't have anything to the actual program in the main page either. Everything was in it's own subscript and the only line in the main page was:
CALL INTRO ()
There were about 30 other subscripts and it was impossible to fallow his code.
At least 86% of what I say is always correct.
I was referring to the grammatical errors in your post :/
As a long time member of TheNewBoston forums (since 2010), I have to say, his tutorials suck.
The 4th edition of the book is available on Amazon for purchase: http://www.amazon.co.../dp/0131872486/ however, the 3rd edition still contains plenty of relevant information and should cover enough to get you started.
For game programming a great resource is http://www.gamedev.net/ They have a great community on the forums and plenty of articles for beginners.
Good luck, and I hope that helps!
This is what I did:
A small error really.
------------------------------------
K, so you're hounding him for putting source code in seprate files and then keeping the least amount of code in the main page? Oh god, he should be locked up for his crimes.
You realize that's actually good programming practice, correct?
-----------------------------------
Ugh, the posts posted before can make a C++ fanboy (like myself) go insane.
No, all the source code was saved in a single .BAS file, he was calling subscripts from inside of subscripts, he re-coded the robot movement every level, and there were no third party databases, bsaved images, nothing. It was all just one single .BAS file.
Your supposed to have the main loop of the program in the main section, not just "CALL INTRO ()" and then go into sub-scripting. This is not C++ for Windows or anything, this is Quick Basic 4.1 for MS-DOS and compatible systems. Big difference.
At least 86% of what I say is always correct.
Cool, I know what it is. I don't understand where you're going with this?
Okay, I thought you meant it was saved in multiple different source files and you were hounding him for it. Can you give me a link to the source so I can give it a proper review?
Uh, I know how a program is supposed to be designed. I know how QuickBASIC works.
Wow. Trying to copy the source code into the post keeps freezing my browser! I have to copy it 1 sub script at a time (201 KB)
Roboraid.BAS
Error - Post to long
Edit: To much trouble to copy... Here's a link.
http://www.mts.net/~...oboraid.BAS.TXT
It was more crowded in the Quick Basic IDE, but it is easier to view, because it splits up your subscripts into separate windows, in Quick Basic 7.1.
At least 86% of what I say is always correct.
No, he was doing it properly. YOU were doing it wrong. Having any substantial code execute outside of subroutines (They are called SUBROUTINES, not subscripts, I Suggest you stop referring to subroutines as "subscripts" unless you want to paint yourself further into the amateur corner) is generally accepted good practice and is enforced by most textbooks. I have a college textbook from the mid 80's which effectively says that if your version of BASIC supports subroutines, you should be simplifying your top-level code as much as possible, which includes using subroutines.
Of course, the code in this case is amateurish garbage- but that is absolutely no surprise, since 100% of quickBASIC code is in fact garbage made by people that don't know what they are doing.
The
"copyright by Kevin" is a nice touch.
The worst part is that it's actually better than most QuickBASIC stuff being produced. Consider how Ham62 keeps referring to subroutines as "subscripts"; this is most likely because the idea of subroutines is confusing and strange to him, just as it is to almost any person who still things QuickBASIC is a viable development platform.
Seriously?
Yes... because when my dad was doing Quick Basic programming in the lab in the 90's everything was complete garbage...
Subroutines are not confusing or strange to me. My dad taught me to program in this language (after I kept begging to him to), so I know how to use subscripts and that you should avoid using the GOTO statement at all costs. Instead of using a long list of IF statements after a INPUT command, it is more efficient to use the CASE SELECT command etc.
I could also do graphics. I made an Etch-a-Sketch program after all.
At least 86% of what I say is always correct.
Then we agree. Though your sarcasm is obvious it has the flaw that it's still accurate. The fact that somebody was using QuickBASIC for technical computing doesn't make it less garbage, it just means they make poor choices. MatLab is superior for that application in almost every perceivable way.
You called them subscripts. subscripts are something completely different.
You called them subscripts again.
This is a subroutine:
This is a subscript:
They are simply not the same, and confusing them in any capacity means their particulars are clearly not clear to you.
Great, so you are subscribing to cargo-cult programming. He told you you should avoid using goto. Did he tell you why? did he tell you what situations arise when it's used a lot? Probably not. And even if so the fact is that Goto, like any language element, has it's place. Trying to follow some idea of purity get's in the way of getting things done. Following numerous control flow statements that require early exits is tricky in QuickBASIC because the control flow is limited; (no continue statement, for example). So you end up using a flag, exiting the inside loop, and then each iteration of the outer loop, checking a flag:
The first example takes structured programming purity as gospel- because QuickBASIC doesn't have a way to break out of a specified control structure (the only one I can think of off-hand that does is Java), it basically ends up as a gross hack all in the interest of avoiding the use of goto statements.
Select Case, and it's a statement, and doesn't apply in all situations unless every single test in the Else-If ladder is only checking your input, and not checking anything else. It's analogous to a C/C++/C#/Java switch, but switch's are more limited since they intend to compile to jump tables. Usually I go for a switch(true) or Select Case True and have each Case be an expression; the first true statement block is executed, pretty much the same as with an elseif with the advantage of a jump table, of sorts.
I had never heard of them before this. My dad said not to use the GOTO statement because he said over use of it makes your program like a bowl of spaghetti; to hard to fallow one action because it takes you all over the place when your making a complex program. Same thing with GOSUB. That's why we have the CALL statement for calling subroutines.
I don't know how to do Java programming, or C#, or Turbo C, or really anything to do with C. I know Commodore BASIC (yes I know, the most irreverent language now), Quick Basic, and a wee bit of Visual Basic. Would you suggest I learn C# or something? My dad just does Visual Basic programming now, should I just continue with this instead? I'm, not going to stop with Quick Basic though, not until all 3 of my MS-DOS systems die.
At least 86% of what I say is always correct.
Irrelevant.
Anyways, yes, learn something modern such as C# or Java.
And what is it your dad actually does?
"Programmers never repeat themselves. They loop."