[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] C++ programming: keeping count of data items read from file



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/08/08 21:32, H.S. wrote:
> s. keeling wrote:
[snip]
>> Man, does C++ produce ugly, obtuse code (no offence meant to C++ code
>> posters; thanks), and this from a perl programmer.
> 
> The problem may be quite trivial in the languages you mention as far as
> the mechanics of reading of lines from a file are concerned. However,
> the experiments under question (for which I am writing the code) involve
> reading large number of files which may be huge in size (thousands of
> lines and many numbers on each line in each file). For that, I very much
> doubt languages like Perl or Python are going to outperform C or C++ in
> efficiency.

Most of the time will be taken up by disk IO, and (in Python, at
least) the IO routines are written in C.

So if all this particular app does is read in text and write out
binary, Python (and Perl, if it's IO routines are written in C)
would have been the better choice.

> Had I been sure to get the same efficiency with Perl or bash or Python
> (awk, sed, cut, and so on ... ), I would have taken that route.
> 
> Like they say, right tool for the right job ....

But with all the time taken to figure out how to write the program,
the Perl/python program would have completed long before the C++
app, even if it took 10x longer.

Remember, there's developer scale as well as execution scale.

- --
Ron Johnson, Jr.
Jefferson LA  USA

We want... a Shrubbery!!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIJEmuS9HxQb37XmcRAhT1AJ42FTJHFrpshoyQDLejbtwudZD2JACfYlo2
tFPMSPbSIFFbDNFSfVF/ALI=
=wu2p
-----END PGP SIGNATURE-----


Reply to: