As a general rule, write your code so that future maintainers
(INCLUDING YOURSELF) can read it easily.  Then, if you really think
you need to release a version that's hard to read, run a copy through
an automatic obfuscator[1] and release that.  (I suspect code
obfuscation isn't as useful as people think, but maybe it does a
little "good", if making reverse-engineering more difficult is
considered good.)

Of course, ALWAYS keep a non-obfuscated copy around for your own
use and for future maintenance releases!

[1] http://www.google.com/search?hl=en&q=php+obfuscator

--- "Tucker, David" <[EMAIL PROTECTED]> wrote:
> 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]


=====
PGP Key ID: 071B173D
Fingerprint: ED30 B048 6833 56B4 28C0 CE52 F12B 884A 071B 173D

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to