Advertisement

Softcoding, Hardcoding

Started by January 18, 2002 08:27 PM
2 comments, last by Anidem 22 years, 7 months ago
In vb6, What would be the best way of loading items into a class? 1) Define variables in a procedure and run it when the program starts. 2) Open a text file containing ItemName, ItemNumber ... and run it when the program starts. Also sould I create a instance of a class (Use it as a structure) or create a collection class. If a collection class how, meaing how would I add a charactor, define charactor properties? Edited by - Anidem on January 18, 2002 9:31:06 PM
It depends on your needs, on the number of datum you need to put in, on whether they are likely to change from one run to another (and whether you are willing to recompile in such a case), on whether you are willing to write a parser for your file, on the complexity of your variables ...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
I hate recompiling, and I wouldn''t need much of a parser because most of the properties will be random access on new lines.
Then go ahead and put them in a text file
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement