|
Oh, James, such a sin. It is true that such code is common, but did you know it is not all treated the same in each language? In C, such things aren't always treated the same by different compilers! ANSI C be damned! Everyone wrote their fun extensions! Consider this: x=3; array[x] = x = 1; In Java, which element of the array was changed? To what? But more common, in your string of var1 = var2 = var3 = ... I have run into this on occasion with dismay. That is because I am usually at that point because I have to change the assignment to var6. Because the original programmer took his cute little shortcut, my maintenance job is peskier. So will the guy's job who must change assignments to var2 and var9. I think that it is much better to use the copy/paste function up front and save the many headaches in the long run. James David Rich wrote: > var1 = var2 = var3 = ... = varn = value > > is common across C, C++, java, bash, perl, blah blah. You mean there are > moronic compilers that don't get this right? > > James Rich > james@eaerich.com > -- Chris Rehm <mailto:javadisciple@earthlink.net>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.