Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE - Why?
Message
De
02/04/2008 14:43:53
 
 
À
01/04/2008 15:18:05
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01306848
Message ID:
01307709
Vues:
6
> Having cut my teeth in the old days when every extra byte mattered, eventually I learned that "the industry" doesn't care as much as we do about efficiency. HTML, for example, is terribly inefficient in its use of bandwidth yet we all seem to tolerate that. Use of #DEFINE vs variables is unlikely to match the resource use of a busy HTML page.
And then when you compare HTML documents against MS-Word format...

When speaking of efficiency one should also take into account "people time". Back when computer time was more expensive than the time for programmers to write software, it was important to have code that would execute in as little time as possible -- even if it meant that the code was harder to decipher for humans. Now it's the other way around -- "people time" is a lot more expensive than "computer time" (and really, it's not a recent change -- it's been this way for many decades). This doesn't mean you get away with writing inefficient code -- but it does mean that one shouldn't write code to shave off microseconds of execution time or a handful of bytes at the expensive of maintainability.

Formats like HTML and XML don't bother me much. Although seemingly very inefficient in terms of storage to represent documents, they're much easier to parse and interpret with relatively generic code than would be some sort of binary format. Going with a text-only format solves two things. When dealing with different systems that have different representations (e.g. ASCII, EBCDIC, CDC, etc) for character data, sticking with printable characters simplifies significantly the task of transmission of data between these systems (it's much easier to figure out what went wrong). Single-byte binary tags sound nice, until you realize that inherently limits you to the number of special tags you can define. Although limiting oneself to only ASCII or only Unicode does seem to make moot the deciphering of data, just take a look at the problems that Notepad has in Win2000/XP (e.g. "Bush hid the facts", "Bill hid the facts", etc. -- http://en.wikipedia.org/wiki/Bush_hid_the_facts )...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform