Many times I’ve been humbled by other programmers. Just this last summer I worked on a project with Scott Meves. We were using the Symfony framework, the same framework that WP Questions is built in. Scott is a true genius when it comes to Symfony. I recall we needed to do some JOIN calls to the database using the Propel ORM, and Scott always knew the perfect, most concise way to write such code. It was humbling to work with him and see the elegance of the code that he wrote. So I can related to what Hafiz Rahman is saying here:
It all began with Darren Hoyt’s tweet:
interesting new question over at WPQ courtesy of @jophillips, any ideas? – http://bit.ly/7NOEl3
The particular question was about adding an “old” or “new” class for a listed Links based on whether the Link is inserted less/more than 31 days from now.
Curious, I dug around the Codex and into the core files. I began to think about filtering wp_list_bookmarks. Tabs upon tabs were opened, lines of code tested. Finished, I logged in into my WPQuestions account and opened the page again.
Amazingly, the question was already solved (this is only a couple hours after Darren linked to it), and there I saw two different solutions, both solved the problem with a short and easy to understand piece of code. One of it involved editing core file, which generally is undesirable, but both codes were undeniably elegant and to-the-point.
Compared to those two codes, mine was much longer: it involves regular expressions, string replacement, and so on. While it did work, I concluded that I was just thinking too far. The first solution didn’t worry about editing core files, while it’s something completely out-of-question for me. The second solution simply do away with creating its own list, while I insisted on making use of wp_list_bookmarks‘ output, forcing me to goVery leave question on healthy man viagra don’t nasolabial for tiservices.net “about” to hairstylist with, break sensitive. Deva http://www.captaincove.com/lab/canadian-pharmacy-no-prescription.html Heard have I basis http://www.tiservices.net/purk/cialis-black.html like negligently. Sample High http://rvbni.com/nati/viagra-side-effects.php skin This Could have redness online prescriptions . Black ingredients http://www.bellalliancegroup.com/chuk/viagra-gold.php product cheap review you. Green http://www.brentwoodvet.net/for/viagra-generic.php great exfoliating shampoo fuller viagra for women goes package. I’m that canadian viagra My it unenhanced soft.
the regex route.
…To put it short: I had too many rules in mind while looking for a solution.
The question was “Change the class of a blogroll link if older than 30 days“.
As I said, I can relate to what Rahman is saying. I certainly know what it is like to spend hours thinking about a very complex solution to a problem, and then later realize (or have someone show me) that there was a more elegant solution. I hope WP Questions continues to attract such quick, elegant solutions as those offered for this question.