Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Single line vs multiple lines assignment
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01499222
Message ID:
01499302
Views:
80
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform