Re: [Audacity-devel] PATCH: export multiple format restructuring
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Markus M. <me...@me...> - 2006-08-19 17:03:13
|
James Crook schrieb: > the external representation of a choice, right? My compiler isn't smart > enough to check that the program and data in repository are compatible > at compile time, whether it is done as a string or as a number :-) > The patch in question changes the internal _and_ the external representation. I would have no problem writing a string to the config file but using an integer internally, though that would need conversion code which is not worth the trouble IMHO. I just think that there is a reason why C++ has an enum type. Using strings for something where an enum could be used * uses more storage than necessary * wastes clock cycles * is more error prone because there is no way for the compiler to report a mistyped value ("if (s==wxT("mp3 ")") > I would have no problem at all with a change over to strings in the > external representation, and would see it as a small improvement. > Maybe, but at least backwards compatibility of the settings file should be maintained. > I argued exactly the opposite way on using strings-vs-ints *within* > Audacity for bitmap ids. In that case the 'magic numbers' are not > visible even in the code, instead we see the symbolic names and the > compiler/linker *is* ensuring no mismatches. In that case we get better > readability, better efficiency and better correctness checking by using > ints. > As I said, we're talking about internal _and_ external representation here. Markus |