Moving away from declaring functions in MODX Snippets

!function_exists() I see it in a lot of code, and I'll admit that I did it quite a bit too, but functions should not be declared in the same script that processes output, a.k.a side effects. MODX has an amazing class load structure that makes it easy to move away from this old habit, and we'll talk about it briefly here.  Using Classes in MODX You can technically set up your folders & class structure location however you want, but for the sake of this I'll show you the (my?) preferred method and you can thank me later when you're building something…

Personal Space

Being a developer is a 24/7 thing.  I never know when I'm going to get an idea and need to spend somewhere between an hour and a week on implementing it.  It's important to use the free time you have wisely and not get too sucked into the code grind. For me, I volunteer, have a family, and veg out on the occasional video game.  The hardest thing I find time to squeeze in is sleep! Volunteering I enjoy spending time giving back to the community. Volunteering is a great way to break away from your normal tasks and focus on someone else's needs. I've…

Creating Coding Standards

I've been tasked with coming up with a written document of coding standards after getting fairly frustrated with myself about having an internal set of rules, but not being able to effectively communicate them.  It creates a fairly tense atmosphere where I've become known as the code Nazi, a.k.a. a dick. Researching effective standards has resulted in an interesting discovery.  My code isn't that great! The code I write is pretty good, but in looking at models like PSR, I find that it's not always consistent. Maybe there's more to this whole…