Using techniques from statically typed languages in JavaScript

Tags:

I wrote an article discussing some techniques from statically typed languages. Head over to SitePoint to check it out! Here’s what you can expect: JavaScript type system, and how it tries to bite you Expanding more about the rule of consistent types with more details on using it to reduce bugs Dealing with type-checking and type-conversion in a way that …

In order to become a better developer, you must first become a teacher

Tags:

The headline might sound pretentious, but what is the most important skill for a developer besides actually writing code? Communication. What do you typically do when you communicate as a developer with someone else? You explain problems, you describe solutions, you talk to non-programmers about what you’re doing. You could also say that you’re teaching others about what you’re doing. …

Hello World Open 2014 thoughts

Tags:

I participated in the coding world championships, or Hello World Open, 2014. The challenge was to write an artificial intelligence for a slot-car racing game. I wrote my bot in Haskell, and managed to rank 11 out of 856 competitors in the first qualification round, and 78 out of 203 in the second qualification round. Read on for some general …

AngularJS best practices: Refactoring existing code to Angular

Tags:

I’ve been involved in several projects where I worked on moving an existing codebase into using AngularJS. Some involved refactoring a small codebase, which is relatively straightforward in most cases, but I’ve also refactored much larger projects where moving everything at once is not an option. Here’s some best practice type stuff that I’ve learned along the way.

Library author: Don’t provide an exploitable interface

Tags:

SQL injection is a pretty big deal. Its cousin shell injection is also a common issue, demonstrated quite well by a recent post to the PHP reddit. Although some suspect it was a troll, I heard echos from a variety of people who had seen pretty much exactly the same vulnerability in production. This got me thinking: People writing libraries …

3 ways to get backend data to AngularJS

Tags:

It seems this is a rather common conundrum with Angular code: You have some backend data, say in PHP or Rails, and you want to output it when rendering the page so that Angular can display it. Since Angular is designed to work more as a single-page app framework, it isn’t immediately obvious how to do this without Ajax, so …