Is JavaScript's eval really evil?

"eval() is evil."

If you're a Web developer, you've probably heard this, along with other JavaScript commandments like "don't use with()" and "don't use ++ or --". Doug Crockford's list of "bad" JavaScript language elements is pretty long, and they're pretty subjective.

Meanwhile, Crockford had for much of his JavaScript career been a driving force behind what I call the "Javafication of JavaScript". That is, making complex hunks of code in JavaScript to simulate Java idioms and behaviors (like classical inheritance).

While Crockford has since recanted much of that "Javafication", the ripple effects are still with us today. Further, his "bad parts" of JavaScript stem from the same mindset. Basically: JavaScript is somehow "broken" and we must avoid tangling with complexities like when you need curly braces.

An open-minded approach

We should all be aware of the features and complexities of JavaScript. Instead of blindly following word from on high about

Continue...

Web developers: support a mobile OS that supports the web

<preachy>  

You know who you are:

  • You're building a mobile web app, but you're only supporting iOS and Android. Neither of which are exactly "web friendly" (I'm especially looking at you, iOS).

  • You're making a hybrid app with PhoneGap, but you're only using the iOS or Android build options. Because, well... because.

  • You see things with amazing mobile HTML5 support like BlackBerry 10, Tizen and FireFox OS and say "well, if they ever get more marketshare, we'll spend some time supporting them".

You're the "chicken" in the "chicken and egg" problem

Stick with me, this analogy holds. You know how developers like to wait for a platform to gain marketshare before they spend time supporting it? Well, that means less apps and compatible websites will launch on that platform. Less apps and websites means less curb appeal for consumers. Less consumers means... less marketshare.

Mobile OS Market Engine

By chickening out, you're

Continue...

Adding syntax highlighting to Ghost

I wanted to enhance the syntax highlighting in the default Ghost theme (Casper). I dug around and while there are a ton of solutions out there, I settled on Prism because it's simple and lightweight. Notice the colorful goodness:

// here is some JavaScript
var x = new joButton("Hello World!");  

Prism is easy to install in your default ghost theme (I'm using Casper). Don't let the length of this tutorial fool you; it took me about five minutes total to get up and running.

Installing Prism

  1. Go to http://prismjs.com/download.html

  2. Select a few options; basically, which theme you want and what languages you want to support

  3. Scroll down to the bottom and download your custom-made prism.js and prism.css files; put them someplace you can find

  4. Copy these files to your server, and login there

  5. Copy prism.js into your ghost/content/themes/casper/assets/js folder

Continue...

Pondering the future

I've worked on a lot of cool stuff over my career, both as an employee and on my own. I've met a ton of awesome people along the way (and some not; you know who you are), and I wouldn't change any of it.

Here's the thing:

I can't say that I've been happy

I've worked up and down the food chain, as a developer, an architect, manager, evangelist; heck I even made my living as a designer for a few years. Lately I find that I appreciate the allure of the steady paycheck less, especially given the trade-offs in working as an employee. Typically, I have very limited creative control, and end up making a lot of compromises between my passions and my employers' expectations. More than I'd like.

Boiling it down, here's what I like:

  • learning things
  • creating things
  • helping others to learn and create things

So what

Continue...

Moving my blog to Ghost

I haven't been blogging regularly. I have a litany of excuses, but one I wanted to eliminate was dealing with WordPress.

It all started with Medium

Medium is a relatively new lightweight blogging service created by Twitter co-founder Evan Williams. I'd been using (some would say avoiding) WordPress for some years now, and the thought of something simpler caught my attention.

Medium is simple. I tried it. I like it. I can't use it:

  • It's very aggressive with formatting pasted text in code blocks. It quietly changes normal double quotes into pretty matched (and completely un-usable) double quote characters, among other things. This would make adding usable source code examples tedious and potentially error-prone.

  • It funnels my readers to, well, other writers. I got you to read my blog, and I want you to read a little more before you fly off to someone else who is being promoted by

Continue...