Why JavaScriptMVC?

There's something missing from JavaScript development tools

JavaScript is the most important programming language of this century and despite imposers to the throne (Silverlight/Air), it's only going to get more important.

This statement might ruffle a few feathers but it's difficult to argue against. Over the past 8 years, the most important applications have been web-based. Of the 20 most popular websites, Craigslist is the only site that does not use JavaScript. It's true that most of these websites have small JavaScript components. The parts that aren't JavaScript can be substituted with other languages (C, C++, Ruby, PHP, Java, .Net, etc), but there is no substitute for JavaScript. Ignore it at your peril.

JavaScript is considered by many a difficult language to use. This has less to do with the language itself, and more to do with inconsistent browser implementations. Fortunately, over the past 4 years, a host of freely available libraries started to make those problems disappear. These libraries typically focus on:

In 2008, a JavaScript developer CAN build almost anything in a cross-browser manner. But, this stops short of providing a cozy development environment that developers crave. Libraries have rightfully focused on the CAN aspect of development. Now that CAN is complete, the JavaScript community is focusing on tools that provide an answer for HOW to develop an application.

As evident by you spending time reading this article, you're probably a highly intelligent and thoughtful developer. You've probably asked yourself the following:

If you've found yourself wondering HOW to build your application, you're in luck. JavaScriptMVC answers the question of HOW to develop JavaScript. So start using JavaScriptMVC right now, or at least download it and keep reading how it guides you to successfully completed projects by promoting best practices and maintainability.

Language and Browser abstractions

To enable JavaScriptMVC's high level goals, JavaScriptMVC contains the basic language and browser abstractions of other libraries.

And JavaScriptMVC has few advanced features such as:

Maintainability

Maintainability is a sore spot of JavaScript development. It is an extremely dynamic language and lacks some of the familiar structures of other Object-Oriented Languages. This often results in rather unsavory spaghetti code.

JavaScriptMVC straightens out code in two ways. It provides a Model-View-Controller (MVC) pattern and forces logically separated files.

Model-View-Controller

The MVC architectural pattern isolates business logic from user interface concerns, resulting in an application where it is easier to modify the appearance of the application or the underlying business rules without affecting the other. This pattern is highly applicable to JavaScript.

Models manage the application's underlying business rules. In JavaScript, models add business rules to underlying Ajax requests.

Views render data into a form suitable for interaction. In JavaScript, these are client side templates that help avoid mixing HTML and JavaScript.

Controllers respond to events. JavaScriptMVC's controllers organize event handlers deterministically by the HTML they reflect.

Logically organized files

There is a high cost to using multiple files in a JavaScript application. Not only do you have to create and include the file, you have to make sure the file gets added to your compression or packaging scripts correctly. Even worse, you have to decide where to put the file as no standard folder organization exists.

Using JavaScriptMVC, a developer can effortlessly include and compress other JavaScript files no matter how complex the dependencies. Because it's so easy, there's little incentive for developers to lazily group unrelated functionality in the same file. JavaScriptMVC organizes application files with the following folder organization:

File Structure

Faced with adding new functionality, a JavaScriptMVC developer knows how it should be built, and where it belongs, enabling them to correct defects and meet new requirements with ease. A MVC pattern, simple file include mechanism, and standard folder structure are a powerful combination for maintainable applications.

Best Practices

JavaScriptMVC wants you to develop the RIGHT way and gives the developer a gentle shove in that direction. Some of the best practices you enjoy with JavaScriptMVC include:

Fewer HTTP requests

Performance is paramount. One of the most important ways to improve performance is to minimize HTTP requests. JavaScriptMVC creates a simple way to combine all of your scripts with Include.

Minimal script size

Small download size is another important performance improvement. In JavaScriptMVC, everything is a plugin. The developer includes only absolutely needed functionality. This makes JavaScriptMVC terrific for applications big and small. Even better, with Include, you can effortlessly compress your application code into a smaller file for increased download speed.

Working with other libraries

A wealth of useful JavaScript functionality is available for free. It would be plain stupid not to work with all of these tools. JavaScriptMVC's no-conflict mode and Object.prototype protection allows you to use JavaScriptMVC with any third party library.

But, JavaScriptMVC goes one step further and provides library INTERdependence with jQuery and Prototype. Library interdependence means that JavaScriptMVC will replace its own functionality with that of another library. It results in less redundant code and a smaller download.

Testing

Automated testing has well-known advantages, but JavaScript developers rarely write test code. In fact, JavaScript developers cite testing as their second biggest pain point in making web sites.

JavaScript testing sucks. It sucks because most applications are event driven, and although libraries exist that simulate some events, none are complete. Existing test libraries are also complicated to set up and use. JavaScriptMVC's Test plugin finally makes JavaScript testing achievable by being the most comprehensive and easy to use testing suite.

Error notification

Getting JavaScript to work perfectly across all browsers is extremely challenging, if not almost impossible. JavaScriptMVC sends you an email when your application breaks by integrating with the DamnIT service.

JavaScript Evolved

JavaScriptMVC is the next generation of JavaScript tool and can make your life a lot easier.

To get started, download JavaScriptMVC and read the getting started guide. Check out the Learning Center's documentation for more technical details.

JavaScriptMVC is supported full time by two experienced developers who are probably too easy to reach out to. If you ever have any questions, let us know by:

forum, email, phone: (847) 247-0530, or smoke signal.