AKAramis said:
I'm an old spaghetti coder... but I've been doing OOP since about 1995.
Keeping the FI/O R/W code in discrete function calls is a good thing.
Spaghetti coder - sounds like the <insert expletives here> asp pages I'm having to convert. Everything is all mixed up: formatting, logic, I/O, VB, javascript. And no formatting so it is really difficult to figure out.
I only started OOP a couple of years ago - the software I generally maintain/write is based on 80's tech. Functions, yes; OOP, no. But when I had to write a new inventory system I decided that was the time to start figuring that out.
Functions are just the 1st part. OOP actually breaks all object handling into the object, not really part of the program directly. So, in my case, for instance, I do something like:
Code:
WorldSystem myworld = new WorldSystem(system name, file that contains that system)
The WorldSystem class figures out the file format from the file extension, finds the world details in the file according to the format, and calculates a few things (such as trade codes - for human readability I can see having trade codes in there, but from a data perspective, since you can derive the codes from the data it seems silly, which is why my odd XML format does not contain that data) and then you have access to things like:
myWorld.WTN = the Gurps world trade number
myWorld.size = size
myWorld.T5Codes = an array list of T5 trade codes (based off that CSV table, so it is user-modifiable & not hard-coded into the software; in fact, almost all of the pgm uses external text tables)
myWorld.agri = a boolean (on/off) for LBB2 trade code agricultural status
and yes - the program does span a few versions....I do have the Mongoose Marches book, and I'm this close to getting the Mongoose core book (holds fingers really close together) so it may eventually have Mongoose stuff in as well!
The functions are part of the class. In theory I can take that class, which is a self-contained file, and use it in another project, such as one for my phone (which also runs .Net). Heck - I could even make a DLL for it and people could use in in VB or other COM-compliant programs. But that is unlikely because the people who want programs usually end up writing them themselves.
sorry for the length of this post - I get excited when other people program interesting things and come up with neat ideas (and I do really like your expanded system records).