View Single Post
Old 02-24-2004, 08:03 PM   #2 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
it's always a good time to use structs! of course, i program in c most of the day, so i never use classes.

but really, a struct is a class with no private data and no member functions. so, if you are going to be manipulating the object's members directly, and don't need any real functions to handle it, a struct is probably appropriate. structs are also crucial where binary compatibility is required. reading and writing binary data to a file, using sockets and interprocess communication, and accessing hardware directly is very much the domain of structs.

on the other hand, where abstraction is key, code modularity and reuse, encapsulation of functionality, and maintaining interfaces is more important (usually true for large projects involving many developers), classes seems to be the popular thing.
joe_bruin is offline   Reply With Quote