Re: Programming Practices
Code Complete by Steve McConnell is a book that might interest you...
Regards,
Tim
Re: Programming Practices
Quote:
Originally Posted by XYZ-R
Code Complete by Steve McConnell is a book that might interest you...
Thanks, I'll check it out.
Re: Programming Practices
You don't HAVE to use classes...EVER! However, the idea behind a class is that you are encapsulating some variables, and any functions which work on those variables. Data, and the methods that work on that data. The purpose behind that is that if you write to a bunch of files, you could encapsulate the readers, streams, or whatever, in a class, and just have some subs or functions which control all the rest. Far easier to call MyFile.Write(string1) to write string1 to a file than it is to set up the stream every time, and you might write another program that needs the same file functionality, so you could just drop that class in there, knowing how it works already.
I can see how you don't need classes, but I'm wondering how you got around using functions? The difference between a sub and a function is that a function returns something. Did you never write a procedure that returned anything?