Sign in to follow this  

i have 1000 lines of code that.............

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

took me six hours to do and i DONT want to see if it works right, im hiding from it, wheres that directx9 project around here that incorporated animated x files?(it used the same character as in the directx sdk, if someone shows me i might do a tutorial on loading them)

Share this post


Link to post
Share on other sites
Quote:
Original post by cdrw
took me six hours to do and i DONT want to see if it works right,


heh, how do you write 1000 lines of code without testing it along the way? that's insane.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by cdrw
its all compiles in its header file,

but i dont call the main function


ya but that's what i mean. generally in 1000 lines of code there are components that can be unit tested as you develop them. like input parsing, loading, processing, drawing, whatever. as you develop each small piece you can test that rather than just coding the entire thing and then only testing when everything is there. whatever, i'd just run it and start the debugging festival. :)

-me

Share this post


Link to post
Share on other sites
what im most worred about is how i hooked up things like the device caps, the timer, and the backbuffer structure,

all new things to me,

just cause i seemed to initialize and store the the backbuffer and device caps, doesnt mean i did it right,

and the timer,

new things

and then theres the bulk of the code,

which i dont know why something would be buggy there,
cause i got it from somwhere else.

where be the code!
(heh)
bring on the file!

Share this post


Link to post
Share on other sites
I think Palidines trying to say you should really think about debugging your code as you go, if theres something in the bulk of your code that effects the backbuffer, you could be looking through the backbuffer code for ages when the problem isnt there at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Palidine
well, they say there's, on average, one bug for every 10 lines of code written, so looks like it's a nice long debugging festival for ya. :)

-me


Really? I probably single handedly effect those averages with the amount of bugs I usually write...

Share this post


Link to post
Share on other sites
If you factor in unintentional errors (spelling, Caps, etc.), I probably make a few per line... Actual errors though, it varies on what I am doing. In basic initialization of D3D, I usually can get by with only a couple minor errors. It is when I start doing heavy math and such that the debugger starts sputtering...

Share this post


Link to post
Share on other sites
Oh god, when you start mucking about pushing the programming language (C++) to it's limits like I like to do, the errors you get are just ungodly. One tiny mistake in one class will affect stuff all the way on the other end of the program, arg!

Anyways, I just finished a memory mangement system, and a system that allows me to determine the type and base classes of an unknown class, and convert to those bases at run time. Basically, it just exposes the class tree at run time. W00t! But getting there was a pain in the ass. Especially cause each time I thought I had it perfected, I would go over my entire code library to use it, haha. That must be like 10000 lines of code there. I've done it 3 times now, going on my 4th. But I've got it nailed this time, I'm sure of it...... Although, I'm a bit worried about performance. Well I expect it to be at least 90% as fast as no memory mangement most of the time. Only during contruction and destruction is it really any slower, so... arg, I dunno. compile, profile... compile, profile...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by andrew_j_w
Unless I'm misunderstanding you DudeMiester you need to read up on RTTI and dynamic_cast...


Perhaps he implemented a RTTI system that doesn't generate information for all classes, just those he needs it for.

Share this post


Link to post
Share on other sites
Quote:
Original post by cdrw
took me six hours to do and i DONT want to see if it works right,

im hiding from it,


I know what you mean. EXCEPT, that waiting to compile until now is gonna make debugging a whole lot harder.

I think cdrw is the little coder inside of us. I think the above all the time. :-p

Share this post


Link to post
Share on other sites
Back when I was fairly new to programming, I wrote a compressor for an implementation of the shannon-fano compression algorithm. I jumped into the thing withough doing any real planning, and hammered the whole thing out without doing any real testing along the way. It took me 2 days to code, and another week and a half to debug (see rewrite).

So yeah, have fun. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Sr_Guapo
If you factor in unintentional errors (spelling, Caps, etc.), I probably make a few per line... Actual errors though, it varies on what I am doing. In basic initialization of D3D, I usually can get by with only a couple minor errors. It is when I start doing heavy math and such that the debugger starts sputtering...


oh dear, you should try visual assist - since i started using it, i guess my error rate is down to 1 or 2 per file (always logic errors. spelling errors are impossible to make once you start using it)

Share this post


Link to post
Share on other sites
I also use visual assist, and the number of errors I get is very very low. Then again, I dont really consider compiler errors as ones that cause troulbe. Unless of course they affect the way your code can be designed (my current problem where I want an array of stl::vectors... bah)

VisualAssist really kills the spelling, ./-> mismatch, etc, errors though.

Last time I wrote a large ammount of code (read 1500~2000) it actually all worked (once I got it to compile which wasnt bad), but that is very rare I was damn lucky. The other time I did that with 500 lines, it took nearly 2 weeks to debug, so I guess you'll need some good luck :P

Dwiel

Share this post


Link to post
Share on other sites

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this