Undoc'd Feature?
|
07-03-2022, 06:31 PM
Post: #10
|
|||
|
|||
RE: Undoc'd Feature?
(07-03-2022 01:03 PM)Wes Loewer Wrote:I think it's bad to increment a variable and simultaneously do an assignation, because it's confusing, I never do that myself, I always do a++ or ++a standalone and that's equivalent. If you want to do both, write 2 instructions, I'm pretty certain it's translated exactly the same way by the compiler and therefore as efficient. That kind of "compact" code is more difficult to read/fix, like oneliners in interpreted languages.(07-03-2022 11:02 AM)parisse Wrote: Not sure I understand what you mean. a++ does this: find a in the table of variables in the current evaluation context, add 1 to this value (in place). Moreover evaluation is much simpler in a compiled langage like C than in a CAS. Imagine that a evaluate to a symbolic identifier b, what should mean a distinction where we evaluate before incrementing: should b be incremented instead of a? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)