Dumbest thing you did as a newbie?

Started by
95 comments, last by Promit 20 years, 7 months ago
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
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement
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
---------------------------------------------You Only Live Once - Don't be afriad to take chances.
Isn''t this discussion supposed to take place in The Lounge?
Forever trusting who we areAnd nothing else matters - Metallica
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]
"Like all good things, it starts with a monkey.."
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!!)
I am always open to feedback, positive or negative...
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.
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 );
}
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
I was also onece drivin nits with header files being devlared more the onse, like, i didnt have the #ifdef _HEADER_INLUDED thing

[ my engine ][ my game ][ my email ]
SPAM
Rate me up.
The old function syntax the AP is talking about is this:
void function (a, b) int a, int b{} 

It''s very weird. I''ve never done this but I''ve seen it.

~CGameProgrammer( );

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement