Are you implying that you are intentionally trying to make your code harder to understand? If so, I think most people will tell you that is a BAD idea.
dave -----Original Message----- From: Jacob Albretsen [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 4:21 PM To: UUG Discuss Subject: [uug] Scripts vs Compiling My question is for coding "etiquette" for scripting vs that of code that will be compiled (C for example). Here, I am showing off that I am not a CS major so I don't know the "science" of all this. Basically, should things generally be passed by reference in scripting? Example with some PHP I am working on that has no relation to trying to get articles working for MUG: $categories = get_article_categories(); foreach( $categories as $category ) { $name = $category['name']; $id = $category['id']; // do stuff } Now, I did C a long time ago and I learned if you really wanted to confuse people and eliminate lines of code, I could do something like: foreach( get_article_categories() as $category ) { $name = $category['name']; $id = $category['id']; // do stuff } Note that I have not tried this in PHP to even know if it will work. In C, you compile, get 1's and 0's and never know where it came from. But PHP is scripting. So it is a good thing to try to code like my example above (assuming it would work) to confuse people, or is doing the reference thing a better idea for security, etc? -- Jacob Albretsen [EMAIL PROTECTED] ____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list ____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
