Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Single line vs multiple lines assignment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01499222
Message ID:
01499302
Vues:
81
This message has been marked as a message which has helped to the initial question of the thread.
I think this is a perfect example of why readability is a false argument when deciding a coding practice, as I (and other posters in the same small thread) found the first option more readable than the second one and others (you included) find the other way around more readable, so which one is more readable is not an answerable question in my opinion, thus looking into other advantages each option has should be the deciding factor, never readability (of course using common sense, if someone finds more readable writing the whole program in only one line...)

For example, what if you in the future need to change the value of some of the assignments? You will need to break the line and use one or more extra lines and in the extreme case (not for your Boolean example thou) you will end up with one line per assignment anyways (each assignment with a different value). Furthermore you are more likely to make more mistakes by splitting the line than by just changing the assignment of the properties you need to change if they were in their own line.

Of course, sometimes STORE is the best answer for you can assign to a variable dynamically (ie. Store {value} to ({variable}), but then again, we are not discussing readability any longer.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform