Archives For web development

Screen Shot 2014-01-08 at 7.59.38 PM

EJS “cleans the HTML out of client-side templates.” From that description, you’ll quickly realize that EJS was at first a client-side template library. It has been repurposed successfully to also be a good server-side client library for Node.js.

In my opinion, using the word “clean” in the same sentence as EJS is a bit misleading. It does have the benefit of being included as part of the Express library for Node.js, which makes it easy to get started with, however like some other libraries, it lost functionality when Express made the jump to 3.0.

By the way, this is one part of a 5 piece series, so if you want to explore other options, don’t forget to visit the series start where I explain the biases and summary information and link to all of the tutorials.

Continue Reading…

Jade logo

According to the Jade website, “Jade is a terse and simple templating language with a strong focus on performance and powerful features.” Similar to Python, it uses indentation to help keep track of tag nesting which forces you to keep your markup looking clean. Because there are no closing tags, the end result is very concise. I suspect that if you used CoffeScript and Stylus, Jade would feel very comfortable.

Furthermore, it is the default template language enabled in new Express.js apps. Therefore it is commonly featured in beginners tutorials and documentation. At first glance I found it very confusing. The tutorial featured on the homepage is quite trivial, and therefore isn’t very representative of real-world work. However, there is decent documentation that you can dig into. You’ll find that much of the documentation focuses on standard HTML syntax and less on the dynamic capabilities.

By the way, this is one part of a 5 piece series, so if you want to explore other options, don’t forget to visit the series start where I explain the biases and summary information and link to all of the tutorials. Continue Reading…

Standing Ovation for Davey Richards

Recently I was using a Node.js library that incorporated EJS and I wondered what factored into the decision to choose that template engine over some of the others. I realized that because of my familiarity with Mustache, when I started using Node.js I immediately started with Hogan.js (see my tutorial on how to supercharge Hogan with Express) and I hadn’t checked out the other popular options. What are the differences between Jade, EJS, Hogan, Handelbars and JSHTML? I’d never used most of them in a real project.

I decided it was time to change that, and figured that if I were going to do the research I might as well share the results with you. I thought I could just make one long post but wow it turned out to be long so I’ve chosen to split it into 5 separate articles, which I’m linking below. Before we get into the specifics, let me take a moment to explain my biases and tell you what I value so you can use my comparisons to make your own decisions. Continue Reading…

stackmob-vs-firebase

Last night Des Moines Web Geeks had a code dojo focusing on Firebase, a tool I’d seen demoed by a few locals, including Brad Dwyer‎ from Hatchlings. In under 2 hours three teams each built a secret santa app using only client-side HTML5, CSS and Javascript. It was awesome.

Firebase makes this possible by providing an abstracted server side component accessible using a pure client-side javascript API. This is called a Backend as a Service (BaaS) or in some cases a Mobile Backend as a Service (mBaaS) platform.

Another BaaS I’ve used, and one that has been in the headlines this week, is Stackmob, which was just acquired by PayPal. I’ve used Stackmob and am quite fond of it. Now, having some exposure to both, I realize that Stackmob and Firebase are very different products offering unique types of services, even though both are considered BaaS products. I thought I’d write up a little comparison of the two. Continue Reading…

php-logo

Ruby has it. Node.js has it. Python has it. Java has it. And now, finally, PHP has it too! A built in web server for developing and testing applications locally! Let’s be fair, PHP has had this capability since mid-2012, but it wasn’t available on Mac OS until Mavericks launched in October 2013.

So now you don’t need MAMP to do local development. You probably just need a database, either the included sqlite3, the fabulous PostgreSQL.app or MySQL (brew install mysql). Here’s how to get going: Continue Reading…

How to scale Django: Finding the bottleneck

I’ve published an article for DigitalOcean on scaling Django. This article focuses on isolating performance problems. This is the first of several articles on performance, particularly targeting resource constrained configurations.

Django is an excellent Python based platform for building modern web apps. One of its biggest strengths is that it helps developers work faster.

You’ve built your awesome app and deployed it. Things are great, but now that you’re loading it up with larger amounts of data and you’re starting to have several people use it at the same time, it’s not as fast as you’d like.

It’s a common problem. Fortunately, we have some tools to help alleviate the problems. First, let’s check for a few of the more obvious issues:

Read the article at DigitalOcean: How To Scale Django: Finding the Bottleneck

Sailboat

As you may know, I prefer to use Hogan.js for my Express projects. Mustache, Handlebars and Underscore are also good. And actually, Jade is a very good framework, I just like HTML and find the Jade syntax abstracts that away. One thing I don’t like is old fashioned PHP-style logic and templates mixed together.

For that reason, template frameworks like EJS are definitely not my style. EJS not only allows you to mix Javascript into your templates, it essentially requires it. If you want to iterate or do an existence check, you need to write Javascript and stick it in your template. Ick.

What does this have to do with Sails.js? Continue Reading…

sails-preview-200-3

I’ve played with this for about 30 minutes now and my instincts tell me it is a great project. It borrows from the philosophies of other popular MVC frameworks such as Ruby on Rails and Backbone.js to create a server-side tool-suite to simplify the work of modern web developers, particularly front-end developers.

It’s called Sails.js and, from the fine manual: “Sails makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app development. …Sails is especially good for building APIs, single page apps/sites, and realtime features like chat.” Continue Reading…

screenshot

It’s well over due: I’ve updated my website’s theme and I’ve chosen “Lean,” a clean, developer friendly theme. I know the author, Jason Bradley, and he is extremely concerned about performance. This is one of the fastest loading themes I’ve ever used (though admittedly, Disqus and Google Adwords are slowing it down a little on my site).

Lean was born from the ashes of Standard, so it inherits all the awesome SEO and ease-of-use features. The Bootstrap template was updated to version 3 to be responsive out of the box. The HTML has been reworked to make it full of HTML5 goodness (sections, articles, oh my!). But the best part is how developer friendly it is. Here are a few things you can do with it: Continue Reading…

ghost

I’ve been poking around at Ghost, a new high-performance and light-weight blogging platform. If you follow the instructions to checkout the latest code from Git you may bump into the same issue I encountered, cryptic errors related to Sass and Bourbon. Fortunately, this is easy to fix.

The errors I received were:

Running "sass:compress" (sass) task
Running "shell:bourbon" (shell) task
Syntax error: File to import not found or unreadable: bourbon/_bourbon.

You must have the Sass and Bourbon gems installed local. After you’ve checked out the git branch simply run: sudo gem install sass bourbon on Mac or Linux to fulfill these requirements. Then follow the instructions in the contributor’s guide. To be fair to the developers, the instructions do list these as dependencies. However, it wasn’t clear to me how to fulfill them (I tried using npm at first which didn’t help at all). It was pretty effortless to get it working once I had the Gems installed. Continue Reading…