On Aug 27, 7:24 pm, Erik Wikström <Erik-wikst...@telia.comwrote:
On 2007-08-27 18:31, iu2 wrote:
Hi all,
I need your professional opinion about this. It is more a general
programming dilemma rather then a C++ one, but since the project I
write is in C++...
We handle big structs of data. We also write them to files for use by
other teams.
Here it goes - we use these files also as a means of passing the data
to other stages in our own program.
I wonder if it would be better to pass the data as it is, in structs,
not counting on files.
There is no memory problem.
Saving data to a file and then reading it in again can never be as fast
as accessing the data directly from memory, nor as easy to do (i.e. more
potential for bugs).
--
Erik Wikström
It's a PC program, and the files are read once in a while, so there
are no actual speed limitations.
Using files makes it feel like we are allowed to loosen up interfaces
among modules - no same structs/header files, each module can take
what it needs from the file. This is the main pro, I think.
So what I try to figure out is whether there is a definite "right" way
for data passing (on a PC program with huge available memory). Pros
and cons, may be, from your (and other's) experience?
I feel that using files is not the "right" way for data passing, but I
also don't see why it is "wrong" way...