The JavaScript of WordPress

wpI’m surprised that web developers underestimate the significance of the JavaScript that WordPress incorporates into its standard distribution. Maybe we don’t understand the breadth of developer adoption that implies. There are sixty million WordPress sites in the world. Breathe. Let that sink in.

Adoption by WP places a demand on hosting & training resources worldwide, ensuring affordable availability and a healthy ecosystem surrounding those JavaScript libraries. They will get love. Lots of love.

WordPress 3.5 includes:

I propose that we give them some respect & attention.


Get Retina Ready, The Retro Way

retinaThe first step to becoming buzzword compliant is to remove the buzz and unpack what is real from the hype.

To be retina ready is to make the images on your website look good on devices which have a higher pixel density. That’s all.  How do you increase the pixel density of a 50×50 icon, say? Just save your original graphic as a 100px square and use CSS to cause the browser to resize it to 50px.

Could that cause the kilobytes of your images on your homepage to double, hurting your page performance? No, not double; although there will be an increase in weight if you persist in saving JPEG’s at the same level of quality. I’ve found, however, that increasing the pixel density allows me to double up the compression on JPEG, so the resulting image file sizes are actually smaller.

In the end, getting “retina ready” may have been a good thing, because it causes us to re-examine some old defaults that made sense five years ago. And, bonus: when your CSS fixes the image dimensions using percentages or em’s instead of pixels, wham your new, smaller, more beautiful images are responsive now.

That was easy.


$99 tablets mean web dominance

It’s confirmed, Acer is going to market their Iconia B1 tablet for under $100. This means that touch-based, Internet access is becoming more broadly available worldwide, as the exponential rate of paradigm shift away from the Desktop PC to mobile devices continues. Will Acer try to position their software marketplace against Apple’s or Microsoft’s or Google’s?

No, of course not. Acer is in the commodity/clone business. They’re just trying to make a small margin selling hardware that runs open standards applications built chiefly with web technology i.e. HTML5, CSS3 and JavaScript. Oh yeah, there will be some 6%-10% of apps built on the highly fragmented, tough to target Android OS, by the very large & successful software houses. But the overwhelming, lion’s share of app development for tablets will continue to be in the lingua franca of mobile: web tech.

It’s a great day to be a web developer.


When you intervene a reverse proxy between your CMS server & user, how are you going to keep those Web 2.0 pages fresh?

The bane of success is traffic spikes and high bandwidth utilization. Now what?  You shouldn’t fear or fret success, but plan for your scalability concerns.

The answer? is JavaScript.


Use Base 36 for transaction ID’s

After the transaction with your website, your customer needs a ticket number of the purchase/reservation/vote/et.al for tracking purposes. When it comes to making that a number your customer can easily write down on a piece of paper, why limit yourself to just the top row of the keyboard —why not use letters, too?

It turns out this is an easy way to cut the size of tracking codes in half. So, change the radix of your number to something higher than, base 10…

Since there are 26 letters in the alphabet, how about adding 10 + 26 = 36. The base 36 numbering system effectively uses all of the easy symbols on a keyboard which are also easy to repeat to customer service over the telephone.

Let’s use 36 as our radix. Here is how in JavaScript:


var x=+new Date,
y=x.toString(36),
z=parseInt(y,36);
console.log(x+" » "+y+" « "+z);


Simple Joys

I marvel at how benevolent an environment for us my Father created. It clearly shows His thoughtfulness, care for us, and love. Simple things like water, sunshine, sleep & oxygen are so good for us.

Men have polluted the creation but still it’s not too hard to find drinks of refreshing, rays of joy, naps of bliss, and breaths of freshness here & there.

Sometimes the cure for an ailment is found in the seed of some flower that grows on an Asian island, a berry that grows Brazilian rain forests, or in an extract from coral reefs off the shore of Okinawa, it’s true.

But we’re amiss if we neglect things that are good, near and abundantly supplied to us without much expense or travel.


PyTexas 2012

PyTexas

Here’s a quick summary of my experience attending the 2012 PyTexas conference.

On Saturday morning, Mr. Powell discussed features of Python that make the language notable, like functional programming constructs, decorators, generators, and context managers. While each of these is fair simple to understand and could be accused being mere syntactic sugar, I think they make code much easier to read and maintain, than the acrobatics which would be required without having them in the language. So for example, any of these can be done in JavaScript much less elegantly. Elegance counts! ✰✰✰

For scientific & embedded systems programming, performance matters, and compiling script to native machine code is a good way to increase code execution speed. LVVM is a compiler, like GCC, but exposes its internals to Python as a library. Dr. Schnell’s talk explored how LLVM can by used from Python directly and introduced numba & bitey. ✰✰

Luke Lee explored dunder methods, explaining what they are, why they’re useful, and how they contribute to the overall design of a fully Pythonic object. ✰✰

Tomo Popovic explained what the popular Scrum software development process is and how it works. It is an iterative and incremental agile development method for project management and software development. ✰✰✰✰

On Sunday, Gabriel Grant’s talk on Building Rich Applications with Django and Ember.js was dense. ✰✰

John-Michael Oswalt’s talk on “Finding the Balance Between Micro-Coding versus Macro-Coding” was astonishing in intelligence and candor about the challenges of developing for systems that scale well under bandwidth load and big data in the real world. ✰✰✰

The lightning talk on how to revise code to make it more readable & powerful with python-specific features was delightful; it showed me how truly kind and friendly the Python community is in Texas.  The conference was enjoyable because the people have chosen python for their livelihood are so amicable.  They may be fewer in number, but I have found that it isn’t numbers that counts when you need help understanding something; usually one or two friendly persons make all the difference.