data passing

I

iu2

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.

What do you say?

thanks
iu2
 
V

Victor Bazarov

iu2 said:
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.

What do you say?

I am honestly don't understand what the dilemma is about. You need the
files to interact with some other product, fine. But using files
to interact with pieces of your own [running] program? <shrug>

And, yes, 'comp.programming' is probably a better place for a discussion
like this.

V
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

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).
 
I

iu2

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).

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top