Archived

This topic is now archived and is closed to further replies.

Promit

Dumbest thing you did as a newbie?

Recommended Posts

Promit    13246
What is the dumbest coding thing you ever did as a newbie? It may have been because you didn''t properly understand the language, or the way it works, or whatever. One of the dumb things I did was after I learned escape sequences in C. I''d go into games and type \n in the middle of my chat. Needless to say, "\n" is very different from ''\n''. It gave ppl who knew C properly quite a kick when my message was "hey!\nsup?" ____________________________________________________________ Direct3D vs. OpenGL

Share this post


Link to post
Share on other sites
Dark Star    100
When I was a newbie to C++ in DOS the dumbest thing I ever did after successfully setting the mode to 320x200 was thinking that I could just automatically write a pixel to the screen by doing something like this

char *screenPtr = 0xa000;

and then doing something like this:

screenPtr[1000] = 12; // trying to write red colour to pixel
// to the screen


I can''t remeber the exact code but all I do remember is that the computer reset and then would not boot to windows but just to DOS after a whole load of error messages and then I wrote

DIR in DOS to view all the files to find that my whole computer''s directory structure had been ruined and all files either deleted or curropted. The moral of the story was not to fool around and think you can write to any memory location, even though I thought 0xA000 or Ax0000 was the memory location but does require one to disable the DOS protection and add a linear base address for which I still dont really understand why and how it works. But I did get some good code for it at GameDev.net

Dark Star
UK

Share this post


Link to post
Share on other sites
monkeyman    253
When I first started playing with C, I got pretty comfortable with the syntax quickly, but coming from qbasic I didn't understand the difference between '=' and '==', or even know that '==' was valid syntax..

Of course, none of my comparisons worked..after being driven to the verge of tears wondering why something like "if(x=y)" didn't work, I finally got fed up with the whole thing and thought "Damn this newfangled C language...I'll just wait until they work out the bugs and release a more stable version.."..

I went back to qbasic and didn't get back into C for almost 2 more years.

"Like all good things, it starts with a monkey.."

[edited by - monkeyman on April 30, 2002 4:13:06 PM]

Share this post


Link to post
Share on other sites
Teric    204
Not so much a newbie thing, but still pretty stupid.

During my first year working at my current job, I was building a database application in Visual Basic. I wanted to streamline the database by deleting any ''deadweight'' records (data records that are no longer associated with master records--the original database was NOT set up with DB integrity functionality, go figure).

So I built a function to go through and delete any data records where there was no master record associated with it. However, I was not aware that my database access prevented me from ''seeing'' certain master records, so it appeared that some data records were deadweight when they really weren''t.

When I ran my delete function, I soon had the team leader from the other database group pounding on my door wondering where all his data went.... (OOPS!!)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
When I heard about C I wanted to program in it, but I had no idea where to get a compiler (this being 7 years ago). I had no internet access, and being 14 wasn''t able to drive to whatever Computer Store and purchase Overpriced Compiler: Worthless Edition. I was finally able to get one off of my math teacher at the time, who programmed in C. I installed the compiler (I don''t remember what one it was) and tried compiling some examples. Any examples with functions that had parameters wouldn''t work...very frustrating. It wasn''t until a couple years ago I learned about ''old syntax'' where you had to do something like:<br>
void function() int x, int y; { /* do something */ }
I am pretty sure that is the cause of my newbie distress but to this day I still wonder.

Share this post


Link to post
Share on other sites
Melraidin    128
Hrmm.... to the previous AP, I think that was always a second option for the syntax. I believe you could always enclose the function parameters inside the brackets. Problem may have been with a C compiler you have to either prototype the function before use, or give a full definition of it.

ie:

void MyFunc ( int a );

int Main ( void )
{
MyFunc ( 6 );
}

void MyFunc ( int a )
{
printf ( "Yarg\t%d\n", a );
}

Share this post


Link to post
Share on other sites
Siebharinn    122
Early in my programming career, I had to write a utility that would read text records off of a CD, convert them to a more compact form, and save them on the hard drive. This was in the early days of CD; it was a bulky extra box the size of my computer case, and it was slow.

It didn''t help that my algorithm was to open the file on the CD, seek to the next record, read it, close the file, convert, open the binary file (on the hard drive), write the data, close it. Rinse and repeat.

When the tool first started running, it was projecting that the entire process would take 47 days (!!) of continuous processing. I came up with this complicated scheme to divide the source file up into 10 meg chunks which would allow them to be processed on multiple computers at a time, and then get merged back with the binary file.

About a year later, when I''d actually learned a thing or two, I went back and twiddled the tool to read 5400 records at a time (that''s all that would fit in 64K, die DOS die) and would cache the output as well. The result? The new tool could process the entire CD in a little over 4 hours.

A learning experience, to be sure.

Take care,
Bill

Share this post


Link to post
Share on other sites
Tac-Tics    197
Well, when I was like 8, my dad showed me the very basics of BASIC. I made some really cool programs out of it (actually, my greatest achievement in basic was probably more than what I''ve ever been able to do in C++). Anyway, I did this all not understanding the concept of data types. And so a few times, I try to run my program and I get these seemingly random errors. I failed to realise I could not subtract two strings of numeric characters =-/

Share this post


Link to post
Share on other sites
Miserable    606
Whilst using (or abusing) tutorials on assembly language to write a keyboard handler for a DOS game, I overlooked the need to release the keyboard after I was done with it, which somehow resulted in my game effectively remapping the keyboard (I noticed when I pressed the F key and it produced the letter H, as I recall).

Share this post


Link to post
Share on other sites
Dan DAMAN    122
My biggest newbie mistakes (besides the = and == mixup)
# of errors caused
First time i used C and i kept forgetting the semicolins
Thus a 20 or 30 line program would result in 100+ errors

Amount of frustration
I was programming a simple (HA scrolling game similar to Chips Challenge when i was about 13 using VB 3.0. When scrolling the level for seemingly no apparent reason would blank out to the default floor tile. After a full tearing apart and rebuilding of the engine the bug turned out to be a > instead of a < and a < instead of a > >

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
A few years ago when I took my first introductory class we learned about reference parameters in C++. Instead of using a & in the prototype of a function I used a %. Since I had been staring at it for so long I thought the % was a & and couldn''t figure out the problem. After a few days I finally figured it out and ever since then my editor has been set to use an 18 point font.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
quote:

My biggest newbie mistakes (besides the = and == mixup)



As a TA at my university I must say that confusion between = and == is the single most common mistake made by beginners in C/C++ courses. In conditional statements is almost always comes up true and students think is a problem elsewhere. Pascal had it a bit better with := and =, but oh well. I still prefer eq?

Share this post


Link to post
Share on other sites
Johnny Watson    508
The stupidest thing I used to do as a complete newbie is personify computers, and think that by typing in words they''ll know what I''m talking about (like, using a function I made up off the top of my head without writing it first ). Fun times, fun times.

Share this post


Link to post
Share on other sites
DrPizza    160
quote:
Original post by Anonymous Poster
As a TA at my university I must say that confusion between = and == is the single most common mistake made by beginners in C/C++ courses. In conditional statements is almost always comes up true and students think is a problem elsewhere. Pascal had it a bit better with := and =, but oh well. I still prefer eq?

Tell people to put the constant (wherever possible) on the left-hand side of the comparison.

This causes a compile-time error if they omit an equals sign, and if it becomes habitual enough, will cause them to take more care in those situations where there is no constant.

Share this post


Link to post
Share on other sites
VisualB4BigD    122
The first time I ever used Visual Basic was to make my science fair project for last year. I didn''t know how to use arrays or any of that data managing. So I used a listview control, Very Limited, Very Slow. And when I was giving then demo to the judge, I had just work out some of the bugs at the science fair. and he asked me to give him an example and it took half an hour for this guy to judge me because it was so slow. Lucky enough, I was the only he had time to judge. I win!

I sure hope this world isn''t one big joke, because I don''t get it.

Share this post


Link to post
Share on other sites
GBGames    217
Dr Pizza, that is an awesome solution.

My newbie error story:
I come from Applesoft BASIC, and then graduated to QBasic, and now I use C++ (I still use QB though).
I was used to my programming language running my programs as an interpretor, so I spent a couple of hours finding the equivalent of RUN in VC++. I didn''t understand the concept of the need to compile a .exe file at first.
What makes it worse is that my high school math teacher had explained to me the difference between an interpretor and a compiler many times, and I never understood it until then. B-)



-------------------------
(Gorgeous graphics)+(beautiful sound effects)+(symphonic music)+(no gameplay) != Good game

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Spending years programming for the commodore 64 and Amiga Computers, thinking it was the future. It will wipe windows out because it''s so much better....

Share this post


Link to post
Share on other sites
Frankie68    122
My newbie mistake:

When I just started to program in BASIC (C64), I was nine and I wanted to make something in my own language (Dutch). I got I book from the library that had sources of all kinds of games. One of them was about running a farm, selling crops, thinking about the wetter, and so forth. But that was all in English, and I wanted to make something that my brothers also would like, so I translated it in Dutch, but I didn''t know whitch words were BASIC words and whitch were English, so I ended up with something that woud never work, and after a few days "debugging" I promised myself never to program anymore and I went back to my LEGO...

...for two years, after that I regained the interest .

Share this post


Link to post
Share on other sites
Massif    122
Well, when I was about 8 or 9, I bought a book for $1 called "Write your own Programs".

I was like "Sweet! People can make their own programs?"

Anyway, I brought it home, read through the whole thing about fifty times and then went on my computer. The book referred to something called BASIC and I had no idea what that was. I just started typing the code into DOS. It goes without saying that it didn''t work. I got very discouraged and buried the book in my closet...Later on (a few years), I was reading through the DOS for Dummies command reference and I found a command called QBASIC which opens a program to write BASIC code in!

I was like "AHHH! I''m so stupid!"
Then I found the book and started coding...

Massif - "It means mountain."

Share this post


Link to post
Share on other sites
theNestruo    138
When I was 8 years old, I tried to make a "Question & Answer" game in my MSX Computer. But I checked the answer like that:

[...]
60 IF A$="A" THEN GOTO 1000
70 IF A$="AARON" THEN GOTO 1000
80 IF A$="ABACA" THEN GOTO 1000
90 IF A$="ABACK" THEN GOTO 1000
100 IF A$="ABAFT" THEN GOTO 1000
110 IF A$="ABANDON" THEN GOTO 1000
120 IF A$="ABANDONED" THEN GOTO 1000
[...]
980 PRINT "YES!!!"
990 STOP
1000 PRINT "WRONG ANSWER!"
1010 PRINT "TRY AGAIN!"
1020 GOTO 10

Of course, after typing two or three pages of the dicitionary, I thought the proyect was interminable.

theNestruo

Syntax error in 2410
Ok

Share this post


Link to post
Share on other sites
davepermen    1047
well u dunno really remember my first big faults, but after two years of programming in opengl i had to look for one whole day finding out why my program created a bluescreen-hang (on win2k!)..

it was a forgotten glEnd()...

well.. that was quite annoying, wasn''t it?

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites