1 September 2015

Spaghetti Code

That’s right, there’s an actual, honest-to-goodness technical term called “Spaghetti Code.”  Basically, it’s code that’s all tangled up in itself, not elegant at all.  It does not look or smell tasty… imagine the worst experience you’ve had with that stuff they served back in school.  You know, with the green “meat.”

I avoid that shit like crazy.

I’ve written some of that shit.  Somebody smarter than me once said, “in order to make good choices, you must first have made plenty of bad ones.”  And I’ve made plenty of those.

In fact, since I have so much code that’s open source, pretty much all my mistakes are out there for people to see.

Anyway, down to the point.  As a programmer, every time you build something with spaghetti code, or in some way that is ugly and difficult to maintain, you acrue technical debt.  And that adds up FAST.

So, for PHP, you should separate code from HTML–you can use a Templating engine to do that.  Or a framework like CS-Content, or CakePHP, or a myriad of others.  Test on different servers, different versions of PHP, and/or do the continuous integration thing.


Copyright {year}. All rights reserved.

Posted September 1, 2015 by Slaughter in category "Uncategorized