Computer coding from the outside

Programming from the outside

Tangled code is one of the easiest programming paradigms to implement. It is that common that nearly all of us create tangled code without even knowing. Adding little bits of code to existing code without planning is one of the biggest culprits. We think to ourselves, "it's just a few lines of code, that won't hurt if I just add it here". At first it won't hurt but very quickly the few lines of code turns out to be a hundred lines of code and suddenly everything is a mess.

One way to solve our problem is to code from the outside. Javascript practices have shown this for a while now. We don't see anymore onclick tags within our HTML documents.

What we need to do is continually think about this paradigm. Try coding from the outside, that is try coding from an external file and keeping all your new changes separate. Don't insert new code where ever you want, the more you insert, the more of a mess you will make. For example a lot of PHP parameters such as memory limits and file upload sizes can be set within our .htaccess files.

### set php variables, this only works if php is running as a module and not cgi ### php_value upload_max_filesize 100M php_value post_max_size 100M php_value max_execution_time 200 php_value max_input_time 200 php_value memory_limit 100M

By keeping these commands in a .htacces file, we can transfer the configurations to many different websites without having to add code into PHP files.