The other week I was working on my compilers homework – the semantic analysis part is an object-oriented nightmare. Something called the visitor pattern to traverse trees and do weird stuff. It made me want to curl up in a fetal position in the corner, rocking back and forth in a padded room, while mumbling [...]
Using Backbone to improve multiselects
Sometimes you need to ask a users for multiple answers to a single question. But what’s the best way to go about it? A multiselect input field is kind of strange for the user, sticks out and doesn’t really behave like everything else on the web. A bunch of checkboxes is better for the user [...]
What Refactoring is, and what it isn’t
This post is my first test of zemanta’s Blogspire, please tell me if you find this style of reblogging useful and I should do more in the future, or maybe I _should_ reblog, but differently. Thanks Nikos Maravitsas writes about What refactoring is and what it isn’t over at Java Code Geeks. Sometimes a programmer will [...]
I wish this existed
Just realized 90% of my blogposts rape the word “actually”. — Swizec (@Swizec) March 19, 2012 This happens because not a single writing tool can tell me Hey you, yes you, you’re using too many filler words, yo! Ever since the 1990′s programmers have been using a key piece of technology. An ubiquitous piece of [...]
Closure and currying magic for cleaner javascript
Sometimes you find a piece of javascript, a perfect piece of javascript, it does exactly what you need! Perfect! You could spend hours, even days, getting something to work and someone’s already done it, shared the code on the internets even! Hooray! But … the code looks something like this: // to populate later var data [...]
How to make your django app slow
The task every developer fears “Hey, I sometimes get a timeout when I want to see the last gazillion days of activity in the dashboard. What gives?” This problem started happening for a project I work on a few months ago. Through a lucky sequence of events I was able to push the problem back [...]
Unit testing is for lazy people
The other day I was talking to a guy about a possible freelancing gig and he said how wonderful it was that I should bring up the topic of unit/automated testingwithout being asked. Said that most (many?) developers don’t have the level of rigor to use automated testing. My reaction was one of disbelief “Rigor!? [...]
The commonest javascript bug
Every couple of weeks somebody will come running to me: “Swizec, Swizec, I did everything right, but this javascript isn’t doing what it’s supposed to! Whatever I click only the last item works. Halp!” Every time it’s the same bug – people just don’t understand how loops and closures play together in javascript. Invariably they loop [...]
Heroku, mongo, node.js – a problem
A couple facts about three cool technologies node.js is a powerful way of writing backend code in JavaScript; why JavaScript? Because you have the kind of problem that benefits from asynchronous code (the average web app) and you like using the same brain for backend and frontend work mongoDB is an awesome NoSQL data store [...]
Appcelerator Titanium might’ve made it to my toolbox
Last time I played around with Appcelerator Titanium I didn’t get a chance to really put it through its paces. Mostly because I wasn’t getting anywhere … I remember spending hours, even days, just figuring out how to get a Hello World to run in a simulator. Yesterday was my lucky day! Not only did I [...]
Comments Off
