On using hash tags in your code comments

Posted on Jun 09, 2015

I write a lot of code comments. It helps me structure my code and make it a bit easier to scan, but it helps my future self too: understand why I did something; alerts for pitfalls or not so obvious code structures; etc.  I've also written apologies to other developers who may come across my code one day. :P

Something that I've started doing in the past year is "tagging" my code: adding hashtags to act as bookmarks to help me find key lines of code that are related to something I'm working on or something I did in the past.

Some examples:

// #tags #kludge #revisit

...or...

// #tags #2015rebuild #govLimits

They always start with "#tags" so I can find all the tags later (doing a search inside project files) and remind myself of what keywords I used, and then follow up with something more descriptive about whatever I'm tagging.

Getting cron to run on Dreamhost w/ Drupal 7

Posted on Jul 16, 2011

One of the important steps you need to do when setting up a new Drupal site is creating a cronjob that hits up your Drupal install. Or at least it used to be an important step in the past.  Poormanscron is a module that simulates a crontab by keeping track of the time and then running Drupal's cron task whenever a page on your site is loaded around the right time, and it has been added to core in Drupal 7.  Finding this out explained where all these mysterious cron calls in my log were coming from!

Even still, I wanted to go through the crontab setup process anyways, as I was learning the ins and outs of my new hosting company's control panel.  (And as mentioned, Poormanscron will only run when a page is accessed, so if your site doesn't get a lot of hits, your cron won't run as often as you like)