background preloader

Les joies du code

Facebook Twitter

Journal.stuffwithstuff.com. Baby's First Garbage Collector – journal.stuffwithstuff.com. December 08, 2013 — c, code, language When I get stressed out and have too much to do, I have this paradoxical reaction where I escape from that by coming up with another thing to do.

Baby's First Garbage Collector – journal.stuffwithstuff.com

Usually it’s a tiny self-contained program that I can write and finish. The other morning, I was freaking myself out about the book I’m working on and the stuff I have to do at work and a talk I’m preparing for Strange Loop, and all of the sudden, I thought, “I should write a garbage collector.” Garbage collection is considered one of the more shark-infested waters of programming, but in this post, I’ll give you a nice kiddie pool to paddle around in. (There may still be sharks in it, but at least it will be shallower.) Reduce, reuse, recycle The basic idea behind garbage collection is that the language (for the most part) appears to have access to infinite memory.

Of course, machines don’t have infinite memory. “Garbage” in this context means memory it previously allocated that is no longer being used. Simple.

Python

Code editors. Hijax. Deploying Django on Heroku - Minutiæ by Mike Tigas. Alert: Extremely long tutorial post ahead.

Deploying Django on Heroku - Minutiæ by Mike Tigas

If you want to follow along, I’ve made an example project available here. Said example site is running here. An extremely abridged tldr version of this (containing just the shell and code snippets, sans explanation) is located here: tldr.markdown. I've been toying around with Heroku in my spare time over the past couple weeks because "NoOps" is the new hotness and the promise is cool enough: wouldn’t it be great if you could write and deploy a high-performance website without having to micromanage the infrastructure? (See also: erosion and whatnot.) In any case, the pricing structure of Heroku (750 free hours) is such that you can run a low-end, low-traffic website in Heroku for free, which is useful for trying it out.

The Heroku Django starter doc isn't bad, but leaves out some bits that I think are important in any production environment: …So I’ve decided to tinker with Heroku and write a step-by-step tutorial as I go. Preliminaries Install git. try: Io-cost.png (509×362) PHP + Apache Stack vs Node.js - Thomas Hunter - Web Development Tutorials and Personal Opinions.

This is an apples to oranges comparison.

PHP + Apache Stack vs Node.js - Thomas Hunter - Web Development Tutorials and Personal Opinions

PHP is an older language, running behind the Apache web server in a request/response fashion. Node.js is a non-blocking event-loop framework running JavaScript within the V8 engine, with an optional web server built in. Then again, is it really an apples to oranges comparison? Both technologies are commonly used to serve webpages to browsers. If you’ve been following my blog through the years, you’d know that I’m a big PHP fan.

If you’ve been reading my blog as of late, you’ll also notice that I won’t shut up about this new thing called Node.js (Browser-Less JavaScript). Honestly, I’ve been using both languages recently. Both environments have their pros and their cons, and neither language is the perfect solution for every project. Why am I only covering PHP+Apache and Node.js? Strengths of PHP PHP is by far the most widely used server-side web programming language. Some of the biggest websites use PHP, such as Facebook, Wikipedia.

PHP

Javascript.