|
Boy am I tired of this thread. On Wed, 3 Jan 2001, Jim Langston wrote: > I have noticed, however, that C seems to be one of the few languages > that uses the obfuscated +=, -=, ++ and -- and for this I'm glad (Java > realistically just being a subset of C that is run time instead of compiled). "+=" is not obfuscated. Can it be used in obfuscated code? Yes. Does it make it easier to write obfuscated code? Thats debatable. But is the "+=" operator, by itself, obfuscated? No. Frankly, I have a lot of experience in both RPG and C. I learned RPG first, and I've been working in it for more years than C. Which one do I find, on average to be harder to follow the code in? RPG. Hands down. It is MUCH MUCH easier to write awful code in RPG with things like indicators, cycle-driven screens, input/output specs, godawful 6-character variable names, fixed-position code lines, etc. I'm sorry, but if you really and truly believe that THIS is hard to follow: Variable += 5 But you think that this isnt: C ADD 5 Variable Then it HAS to be because of what you're used to, and not whats actually easy to follow. If a new programmer can say "'+=', what does that do?" He can surely also say "Theres a C in position 6, what does that do?" "Why do I have to put the O specs after the C specs? Why do I have to put the P specs after the O specs? What is 04? Why does turning on 04 cause the program to print [something] on the screen?" > > The obvious reason I can think of this is because it's just not a good idea! > It makes code hard to maintain and debug. In practicality all we are doing is > saving a few characters typing. Whether it is a good idea or not is purely your opinion. It is certainly used in far more languages than MANY, if not ALL of the common features of RPG. The fact that you can put a "C" in column 6, and the format of the line STILL is different depending on if the op-code is "IF" or "IFEQ" is a good example of why RPG is harder to learn than C. Hard to maintain and debug? Because you typed "A += 5" instead of "C ADD 5 A"? That makes it hard to maintain and debug?! Yeah, thats why companies need to hire "variable assignment specialists" to debug C code (sarc) > There is the fact that functions will only > be called once instead of twice, but this is rather the exception to the rule > rather than the rule itself. > Huh? Are you suggesting something like function(A:B) += 5??? Where are you assigning the result of this expression to? If you don't like the += type operators, don't vote for them. If you do, vote for them. Let the majority decide. Isn't that what VOTES are FOR? Don't you feel the slightest bit guilty saying "I dont like the short form operators, so people shouldnt be allowed to vote for them!"??? +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.