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

Started by
16 comments, last by Dwiel 19 years, 7 months ago
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...
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Advertisement
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...
[s] [/s]
I can see the fnords.
Unless I'm misunderstanding you DudeMiester you need to read up on RTTI and dynamic_cast...
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.
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
-----If you thought I was helpful, rate me down.If you thought I wasn't helpful, rate me down as well.This idiot didn't read my signature and tried to insult me.
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. :)
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)
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

This topic is closed to new replies.

Advertisement