AS7: Syntax checking for JavaScript

Ever make a change to your app, run it, and have it die on a simple syntax error?

Wouldn’t it be great to catch it while still in the Code Window?

AppStudio 7 has a sophisticated JavaScript syntax checker built into the Code Window. It does more than just check for coding errors: it also encourages you to code using good style. It will give dozens of suggestions on ways to make your code follow the latest best practice standards for JavaScript.

Here’s how to use it: Right click in the Code Window, click on Check syntax using Eslint. A window will pop up with a list of errors and warnings.

Checking is done using the well known eslint utility. Eslint uses a set of customizable rules. For rules, we use the widely accepted AirBnB Style Guide.

If you’re a JavaScript programmer, you should read this document: it’s full of simple examples, good and bad. You’ll be a better programmer as a result.

If you have a team of developers working on a project, it will also help enforce a consistent programming style for all members of the team: they will be able to read and fix each other’s code much more easily.

iOS 4.3 brings better performance.

Apple’s iOS 4.3 includes a new JavaScript runtime engine. Since NS Basic/App Studio works by translating BASIC code into JavaScript for execution, we tested to see what difference the new version makes.

iOS 4.2.1 iOS 4.3 diff
iPhone 4 180,428 282,674 +57%
iPad 208,276 264,293 +27%
iPad 2 437,853

The test is a simple one: how many times can you go through a loop, adding a number each time, in 1 second? It’s useful as a test of straightline processing power, but as in any benchmark, will not necessarily indicate what will happen to a particular app. Reports in other media are that the real world results are often much better than we found.

Still, the marvel is that more than quarter of a million statements can be executed in less than a second on a handheld device, be it iOS or Android. This really expands the types of apps NS Basic/App Studio can be used for.

Update: As of 4.3.0, this improvement only appears in apps running directly in the browser. It has not been extended to apps saved to the home screen yet.

Here are a couple of interesting links if you like this kind of benchmark:

SpeedTest is the standard benchmark we have been using on many devices. Results are shown for almost 50 devices. (The slowest was the BlackBerry Pearl, at just 671!) It also shows some desktop results. Let us know if you have some numbers to add!

Win CE Benchmarks shows the speed of NS Basic, eVB and .NET on various devices. Tops is NS Basic/CE on a souped up PocketPC 2003 at 55,511. As a bonus, results are also shown for a variety of desktop systems.