Skip to content
Prev 393632 / 398503 Next

return value of {....}

Avi,

Please do not mistake my posting as being a BASHING of R. I greatly admire R and the progress it has made from its roots in S. I thank the may people who contribute to the development and growth of R. 

Just because a language allows a given syntax does not mean (1) that the language is bad or (2) that the syntax should be used (except in rare occasions). There may well be a few occasions when using a global variable in a function makes sense and in that instance the global variable should be used, and the usage should be documented in the comments that are part of the source code. Please note that I stated "A general recommendation  use of a global variable in a function"; I used the words "recommendation is to AVOID". I did not, and would not forbid the use of a global variable in a function. 

English has the word "or" which is not clearly defined; is it an exclusive or or an inclusive or? I don't bash English because of this semantic ambiguity. What I try to do is make certain that when it is essential to understand if the "or" I use in a sentence in exclusive vs. inclusive (or conversely) I make certain my meaning is clear. e.g. You can use bleach or ammonia to clean the stain, but NEVER use ammonia and bleach together as the combination produces a deadly gas. I try to follow this philosophy when I program. I don't use global variables in a function unless there is an overwhelming reason to do so. When I do, I indicate that that a global variable has been used in my comments. In the same vane, I rarely use call by reference in my programs (when this is allowed by a programming language); I try to use call by value whenever possible as call by reference can be fraught. On the other hand when working with extremely large data objects (especially in the old days when I had perhaps 20k of memory rather than 100 gig), I have used call by reference to save storage. Despite this, I know that call by reference is not recommended just as using a global variable in a function is not recommended, but can, and should be used when needed.

John

Thread (32 messages)

akshay kulkarni return value of {....} Jan 9 Valentin Petzel return value of {....} Jan 9 Rui Barradas return value of {....} Jan 9 Bert Gunter return value of {....} Jan 9 akshay kulkarni return value of {....} Jan 9 akshay kulkarni return value of {....} Jan 9 Bert Gunter return value of {....} Jan 9 akshay kulkarni return value of {....} Jan 9 Andrew Simmons return value of {....} Jan 9 akshay kulkarni return value of {....} Jan 9 @vi@e@gross m@iii@g oii gm@ii@com return value of {....} Jan 9 Jeff Newmiller return value of {....} Jan 9 Bert Gunter return value of {....} Jan 9 akshay kulkarni return value of {....} Jan 10 @vi@e@gross m@iii@g oii gm@ii@com return value of {....} Jan 10 akshay kulkarni return value of {....} Jan 10 Richard O'Keefe return value of {....} Jan 10 akshay kulkarni return value of {....} Jan 11 Valentin Petzel return value of {....} Jan 12 Heinz Tuechler return value of {....} Jan 13 Bill Dunlap return value of {....} Jan 13 akshay kulkarni return value of {....} Jan 15 akshay kulkarni return value of {....} Jan 15 akshay kulkarni return value of {....} Jan 15 Richard O'Keefe return value of {....} Jan 15 Sorkin, John return value of {....} Jan 15 Bert Gunter return value of {....} Jan 15 Sorkin, John return value of {....} Jan 15 Bert Gunter return value of {....} Jan 15 @vi@e@gross m@iii@g oii gm@ii@com return value of {....} Jan 15 @vi@e@gross m@iii@g oii gm@ii@com return value of {....} Jan 15 Sorkin, John return value of {....} Jan 15