Re: Structured Code vs. Performance

From: Date: Thu, 29 Nov 2007 12:46:18 +0000
Subject: Re: Structured Code vs. Performance
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-265212@lists.php.net to get a copy of this message
Thank you for the answers. My abstract: Use separate files for separate code. Easy to maintain, no real loss in performance. That's fine, as I'm just doing so (like if I need a database abstraction, I include dbas.php and if dbas.php needs some miscellaneous functionality, it includes misc.php by itself - so no worry for me to think about the dependencies of the scripts). Yes, that makes use of require_once() et al., but as I didn't plan to use something like ACP, it seems to be no problem so far. Use absolute pathnames when including. That's too what I do, as I don't want scripts to be found accidentally - see the thread about inlcuding config.php for that ;-). Caching code might be another possibility for gaining speed - I will think about that later, thank you for the hints. And last but not least: First make your code work in a proper and maintainable way. Then think (and ask) for speed. And don't expect people to assume you have done it this way ;-). If someone wants to complete this abstract, it would be appreciated, otherwise I'm done. Thank you again! Thomas

« previous php.general (#265212) next »