PHP, Classes, Camel Case, and Underlines
When I first started PHP programming, I wrote code like the PHP inventors wrote code, using lowercase characters and underlines, like: $my_favorite_variable = 5; function add_numbers($first_number, $second_number) { return $first_number + $second_number; } $answer = add_numbers($my_favorite_variable, 1); But this became tiresome. The thing is, the underscore character is harder to type and using all lowercase really makes the [...]
WordPress Function do_action – Very Useful
Today, well, really the last few days have been incredibly productive and incredibly hectic. I finished up some complex code for a customer and ever since then I’ve had so many epiphanies that I’ve practically been typing constantly ever since. I will say that I really like when I am inspired like this, but I [...]
JQuery.post Recursion, or not…
Today I spent some time making some data import code work better. At the start of the process I had a PHP function that I would call to import some data. The problem is, that process would take longer than 30 seconds after which it would time out. A while ago, I changed the function to [...]
WordPress Plugins and AJAX
The last couple of days I’ve been doing a ton of AJAX programming on some WordPress plugins. Wordpress actually does have one very handy AJAX feature that makes using AJAX just a little easier. I also use jQuery because it’s really nice for a lot of things including AJAX work. AJAX is a great technology, and [...]
MySQL Counters
Today I went to Panera (free wi-fi) to get some work done away from the distraction of my dachshund. I’m changing a lot of my PHP code to use classes, and needed to focus. After enjoying some soup on a bread bowl (it must be fall) I started working. I didn’t get far. I realized what [...]
ECMAScript is Junk, JavaScript Sucks
I just watched this video to see what was coming up in ECMAScript 5. What this video taught me is the JavaScript is junk and that design by committee always leads to bad solutions. When looking at some of the ridiculous code examples in this video, I just couldn’t believe it. It is so difficult just [...]
Standardizing and Simplifying WordPress Themes
I’ve mentioned before that I’m working on a redesign of this theme. That work is very graphics intensive so it goes slower and has to wait for inspiration. But the way I work is that I have one common theme for all my sites and then I retheme each site as appropriate. Each time I focus [...]
PHP and Other Internet Languages
I have an issue, I’m kind of unhappy with PHP. I have used many languages, but as a developer at Microsoft I used C, C++, and C#. I would consider C and C++ to have been naturally selected as the “best” languages, but at this point, we also know what’s wrong with them and want [...]
printf float syntax (%f)
Throughout my years as a developer I have had to figure out the syntax for formatting floating point numbers using printf, sprintf, and the like repeatedly. I always remember the basics, but as soon as I have questions about details it’s very difficult to find a good explanation. The man pages and web sites just [...]