PHPNews

I do not think DRY means what you think it means

Perhaps this developer decided it would be better to create convenience methods than to litter their codebase with date format strings. Nothing wrong with trying to DRY up your code, but creating 13 inscrutably named date formatting functions ain’t the way to do it. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 …

Continue reading »

Written by CSI: PHP - - Aggregated on Friday August 31, 2012


data-attributes are an anti-pattern

HTML5 has a lot of cool things in it, but the one thing I wish I could remove are data-attributes, because of the crimes against clean front-end code that it seems to encourage. What is this clean web code you speak of? We have 3 technologies that go into building a web app, HTML, CSS, and JavaScript. All three …

Continue reading »

Written by Matt Briggs - - Aggregated on Friday August 10, 2012


Are PHP developers functophobic?

There is this one thing that I noticed recently and that concerns me: PHP devs don’t use functions. Now, that was overly general, so let me clarify: PHP developers who have reached a certain degree of sophistication basically stop using plain functions - instead everything goes all classes and methods. At least …

Continue reading »

Written by Nikita Popov - - Aggregated on Friday August 10, 2012


How Shall We Define Design?

I love object-oriented design. It’s like open source software in general; perfect strangers come up with ideas that can save me time and money and then, out of the goodness of their hearts, go to a fair amount of trouble to pass these ideas on. I benefit from their efforts every day. However, you don’t have to go …

Continue reading »

Written by Blog - Sandi Metz - - Aggregated on Thursday July 5, 2012


PHP is much better than you think

Rants about PHP are everywhere, and they even come from smart guys. When Jeff Atwood wrote yet another rant about PHP, it made me think about the good parts of PHP. The biggest problem of these rants is that they come from people stuck in the old days of PHP. They either don't care or they don't want to admit that …

Continue reading »

Written by Fabien Potencier - - Aggregated on Wednesday July 4, 2012


Cron Expression Parsing in PHP

As a PHP developer, I’ve often been faced with the task of ensuring something happens on a recurring schedule or determining the next date in time an event will occur. At my previous job, we needed to run scheduled Gearman jobs on a recurring basis. We chose to use cron as the serialization format of our schedules, …

Continue reading »

Written by unknown - - Aggregated on Sunday June 3, 2012


Cron Expression Parsing in PHP

I’ve often needed to ensure that something happens on a recurring schedule. At a previous job, we needed to run scheduled Gearman jobs on a recurring basis. We chose to use cron as the serialization format of our schedules, and implemented a database driven system for storing these schedules. Storing the cron …

Continue reading »

Written by unknown - - Aggregated on Sunday June 3, 2012


The Many Faces of Ruby Callables

One of the most valuable ideas from functional programming is the idea of Higher Order Functions , or functions that take functions as an argument. It is such a good idea that it has become part of pretty much every modern language, whether functional or not. Amoung the OO imperative languages that have embraced this …

Continue reading »

Written by Matt Briggs - - Aggregated on Saturday May 5, 2012


Awesome Emacs Plugins: CTags

I wanted to write a series of posts on awesome emacs plugins I use, since I have put a lot of time and effort into my emacs configs . The funny thing I find about emacs though is that there is such a massive amount of functionality already provided, most neat things plugins do is augment stuff that is already there. …

Continue reading »

Written by Matt Briggs - - Aggregated on Sunday March 18, 2012


Why I like Object#tap

In a recent Destroy All Software screencast, Gary mentioned how he really doesn’t like Object#tap . He was using it in this sort of context 1 2 3 4 5 6 7 8 9 10 class StoreCache def self.for_term(term) begin CachedScore.for_term(term) rescue CachedScore::NoScore RockScore.for_term(term).t…

Continue reading »

Written by Matt Briggs - - Aggregated on Thursday March 8, 2012


Awesome Emacs Plugins: Evil Mode

I want to do a series of posts on some of the cool emacs plugins I use. Before I do that though, I want to talk a bit about why I use and love emacs. The saying “Care about the code, not the tools” is an anathama to me, it is like “Care about breathing, but don’t worry about drinking”. Breathing is incredibly …

Continue reading »

Written by Matt Briggs - - Aggregated on Monday February 27, 2012


Repository Pattern In Rails

I have been working a lot on an app using MongoDB as the datastore, and Mongoid as the OR/M (or ODM to be more specific). In a relational database, you keep your data as segregated as reasonably possible, and then join it together in appropriate ways when you need it. The up side to this is that it is incredibly …

Continue reading »

Written by Matt Briggs - - Aggregated on Thursday February 23, 2012


Concatenation is not a parser error

CSI: PHP isn’t big on the perp walk , but if your crime is (1) public and (2) licensed with an Attribution-NonCommercial-ShareAlike Creative Commons license, then you kinda perp walked yourself . 1 2 3 4 5 6 7 8 9 <?php // What will this print out in php5? $earth = 'World'; $string1 = "Hello " …

Continue reading »

Written by CSI: PHP - - Aggregated on Thursday February 23, 2012