Total Eclipse

Don't know what to do, always in the dark? Totally get the Eclipse debugger!

🎶 Once upon a time I was calling printf, my debugging skills were falling apart... Nothing I could do but then I found Eclipse, now I ❤️. 🎶

I have plenty of experience with debuggers: db, ladebug, gdb, jdb, NetBeans, WinDbg (affectionately known as WindBag), Xcode, and perhaps my all-time favorite, SoftICE. I've used them almost exclusively to debug low-level device driver code. This is my first time since last working on cutting-edge web code circa 1999-2001 that I've had the need to debug server back-end scripts.

PhpStorm seems to be the most highly praised option out there, but they don't offer discounts to non-profits, and it's pricey at $199 for the first year! The next most popular is Eclipse for PHP Developers, and the price is right: free. It uses PHP's Xdebug extension, and worked like a champ. I was setting breakpoints in my PHP functions, actually hitting them, inspecting variables, stepping through code, and fixing bugs (in 3rd-party code of course, not mine) with hasty abandon!

After three all-nighters in the past week, I'm really starting to get the hang of web development again. Don't get me wrong, I miss needing a debugger that lives below the operating system, and sifting through PCI buffer traces for broken command packets caused by multithreaded race conditions. Really, I don't. But someone has to make sure deadbeat donors with expired credit cards receive an encouraging email with a link to remedy the situation, right? That someone is me.

Introducing Benj, Charitocracy's fastest coder

Who’s Gonna Ride Your Wild Horses

Cowboy coding, I wish I knew how to ⌘Q you

The sun has set on my unbridled "cowboy coding" for the last time. (Geek alert. You've been forewarned.)

Traveling 5+ weeks and not touching Charitocracy the entire time was never my plan. I thought I would have remote access to my home server, but something went wrong. (I still don't know what, but I have some suspicions.) I set up a more reliable VNC connection as an immediate countermeasure when I returned home so this particular obstacle wouldn't repeat itself.

Really, though, I needed to rethink my overdependence on an old Mac Mini (MM). I chose it as my main staging server by virtue of it being the only unutilized Mac in my house, purchased as a home theatre PC before Apple TV made it obsolete. I used dynamic DNS to direct ch-y.org traffic to my home network, then my router port-forwarded to the MM. It just worked... except when it didn't. Namely while on my trip, and about half the times I tried logging into it from neighborhood coffee shops.

Meanwhile, I have a powerful mid-2015 MacBook Pro (MBP) at my fingertips any time I'm working. It runs circles around my circa 2009 MM. I never need to access it remotely over a questionable net connection. So why am I trying to use it as a dumb terminal into an ancient machine across the house, across town, or across the world as the case may be, with mixed success at the best of times?

Last week I declared an end to amateur hour by doing the following:

  1. I installed MAMP on my MBP.
  2. I set up a git source control repository (with origin backed by my iCloud drive) to host Charitocracy web code and database.
  3. I rebuilt the Charitocracy beta site from scratch on my MBP, submitting to git at intervals along the way, using my MM's site as a reference.
  4. I created a pre-commit hook that automatically adds a SQL database snapshot whenever I commit code changes.
  5. I installed and configured PageKite, a pay-what-you-want tunneling service which allows me to receive Charitocracy network traffic (including TLS/SSL) wherever I like, including on my MBP, even if I'm in a random waiting room or coffee shop (as I am right now).
  6. After proving the new beta site worked as well as the MM's, I pulled all the code and data back from git and proved I could easily clone the site on my MM, redirect PageKite to serve it up externally, make changes to the site on MM, and pull the changes (code and DB) back onto my MBP.

So I'm finally baking some real engineering discipline into my coding process. Nothing falls through the cracks. I can go back to previous snapshots of code and data. I can easily view and search through changes, even if they were in the DB or in code I didn't write myself, like plugins. I can travel. And all of this is quick and robust, because 99% of it is happening right on my laptop (credit card processing is one exception, but that traffic works seamlessly through PageKite, too). And if I get hit by a bus stagecoach tomorrow, you'll all be able to pick up where I left off, right?!

I still have plenty of engineering discipline yet to adopt, the sorts of things truly necessary when working in teams with fluid requirements and actual deadlines. So I reckon I'll just ⌘H the cowboy coder until the coast is clear. Yeehaw!

Callin' the VT100 a dumb terminal? You sure you wanna be doin' that, Benj?

Back in the Office

Looks like you've been missing a lot of work lately, Benj.

"I wouldn't say I've been missing it, Bob." I packed 6 months of travel into 6 weeks, but got it out of my system. Let's hope.

You'll recall before I left, the IRS totally punk'd us with a letter saying "We got your application, now sit tight for 6 months while we think about it." Then after I left town, they followed maybe two weeks later with a letter saying, "Just kidding, we love you guys, don't change a thing, you're totally in." I'm paraphrasing, the actual letter of determination is here.

If you want to know what goes into a full-fledged Form 1023 these days (not the shortened -EZ version) you can take a look at that here.

I thought I'd be taking my time getting the web site up, and that the IRS making donations to Charitocracy tax-deductible would be the long pole in the schedule. Suddenly I'm the weakest link! Charitocracy's only obstacle to going live is me. The pressure is back on, friends. Jessica be all like:

Yeah... I'm going to need you to come in on Sunday, too. Usual Time.