programming

A Detailed Explanation of JavaScript Game Loops and Timing

Sat, Jan 17, 2015 - 10:31pm -- Isaac Sukin

The main loop is a core part of any application in which state changes over time. In games, the main loop is often called the game loop, and it is typically responsible for computing physics and AI as well as drawing the result on the screen. Unfortunately, the vast majority of main loops found online - especially those in JavaScript - are written incorrectly due to timing issues. I should know; I've written my fair share of bad ones. This post aims to show you why many main loops need to be fixed, and how to write a main loop correctly.

Command-line tip: replace a word in all files in a directory

Wed, Jun 26, 2013 - 11:37pm -- Isaac Sukin

I need to use this command every once in awhile and I always forget how to do it off the top of my head.

grep -lr --exclude-dir=".git" -e "oldword" . | xargs sed -i '' -e 's/oldword/newword/g'

If you're on Windows you'll need unix command-line tools installed. The easiest way to do that is with Gow.

Here's what each piece does:

Asynchronous Requests in PHP

Mon, Nov 12, 2012 - 4:04am -- Isaac Sukin

I recently wrote an API callback script that performed some heavy calculations and took a long time to return. To keep the user from having to wait, I wanted to have the script immediately return cached results and asynchronously process the calculations. There are a few partial solutions on the web but none of them properly deal with sites using HTTPS, so here's my solution:

"I want to learn programming. How should I start?"

Wed, Aug 22, 2012 - 10:21am -- Isaac Sukin

This is a slightly edited response I recently wrote to someone who asked how to learn skills that would be useful at a hackathon. It's my usual response when someone asks how to get started programming.

You should start by approaching the problem from a different perspective. You should be thinking "I want to build X. Now what do I need to learn to build that?" not "I want to learn to build stuff. What can I learn?"

Programming's Impact on Personality

Mon, Aug 20, 2012 - 3:08pm -- Isaac Sukin

Tim from Crowdcademy recently wrote about the ugly side of programming:

I've also discovered that learning to code can have a big impact on your personality. Coding uses a lot of thinking patterns that I hadn't really used since my math and statistics classes in college, and even back then not in this intensity. As a result I've become more focused, more logical and smarter. But I've also become more detached from everyday life and less fun to hang out with.

Pages

Subscribe to RSS - programming