By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

data passing

P: n/a
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

Aug 27 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
iu2 wrote:
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[s], 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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 27 '07 #2

P: n/a
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
Aug 27 '07 #3

P: n/a
iu2
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...

Aug 27 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.