I like debugging JavaScript in Chrome. The console is pretty excellent for stepping through code, logging, checking for bounds events etc. The one issue that I kept running into was that of caching. As I was making changes to my JS file, I found myself having to go through a couple of menu settings every […]
JavaScript
Use Ant and Closure Compiler to compress every JavaScript file in a project if you have lots of files
In a previous post, I set out how to use an Ant script to run every JavaScript file in a project through the Closure compiler. For the most part, this has been working fine for me. Then I ran it against a project with some 50-odd JavaScript files and it started to throw PermGen OutOfMemoryError […]
Getting Started With Node.js Part 1: A Quick App
Node.js is a server platform built on Google Chrome’s JavaScript runtime. It has an event-driven, non-blocking I/O model so it’s a fast and efficient as you could want. It’s also probably a good glimpse into the future of server technology. With the server running pure JavaScript, it’s a great plaform for development of JavaScript-centric applications. […]
Simple JavaScript Method Chaining
Method chaining is a way to return an object from a method call that allows for further methods to be called. It’s easier to see than to describe. Instead of this: var people = helper.getPeople(); var bob = people.find(“bob”); var email = bob.getEmail(); You could do this: var email = helper.getPeople().find(“bob”).getEmail(); We get code with […]
Use Ant and Closure Compiler to compress every JavaScript file in a project
There’s an updated version of this script in this blog post. At work, we use TeamCity to automatically build and deploy to dev projects as we check in changes. One thing that’s always been a bit of a nuisance is dealing with the compression of JavaScript files that we’ve written for the projects. Developing locally, […]
Starting to write JavaScript that doesn’t suck
A couple of people I’ve spoken to in the past few days have made comments about how much they hate JavaScript and how bad it is as a programming language. I’d agree that this is true for the code that people new to the language can sometimes create. Take this wrapper for the Google Maps […]