Simon Willison’s Weblog

140 items tagged “programming”


How should one go about designing a simple web based collaborative text editor?

Take a look at the open source ShareJS library, which implements a bunch of the fundamental (and extremely tricky) algorithms you need to get collaborative editing in the browser to work well:

[... 53 words]

Any source available to download sample data (in 10+ GB) for testing?

Wikipedia has some pretty interesting dumps, in both XML and SQL format:

[... 100 words]

How can I learn more about server-side technologies?

Get yourself a VPS, set it up from scratch and run some non-critical websites on it (nothing with private user data since you can’t be sure you’ll set it up securely). Both Slicehost and Linode offer a good set of guides to a whole host of common tasks:

[... 109 words]

Is it bad practice to have a variable that has the same name as a function?

Yes, it’s definitely not a good idea. In Python functions and variables share the same namespace, so if you create a variable with the same name as a function you won’t be able to call that function.

[... 93 words]

What is a development framework?

The most useful distinction, in my opinion, is to think about the difference between a framework and a library.

[... 271 words]

Did Mark Zuckerberg have any knowledge on building scalable social networks prior to starting work on Facebook?

I’m going to bet he didn’t have this knowledge, simply because back when he launched Facebook in 2004 almost NO ONE had this knowledge—there simply weren’t enough “web scale” products around for the patterns needed to run them to be widely discussed.

[... 143 words]

Should I use Dropbox instead of Git for 2 coders? In terms of going really fast and working on things at the same time, I’m thinking it may be uber productive to use Dropbox for it’s instant syncing instead of Git/Github. What are the pros/cons?

Dropbox is definitely the wrong tool for this—you’ll find yourself running in to all sorts of weird problems very quickly if you attempt to use it this way.

[... 119 words]

Do country/city IP addresses always stay the same?

Yes, they can change—and there isn’t much central control. IANA dish out IP blocks to regional authorities, who hand them on to ISPs,who distribute them to end users... But the ISPs might cover multiple cities or even countries. You can read a bit about this process here:

[... 154 words]

Does Amazon have a API for websites to utilize order and delivery fulfillment?

The Amazon Fulfillment Web Service used to handle this—but their site now says "Effective June 2012, Amazon Services will no longer support Amazon Fulfillment Web Service (Amazon FWS). All functions and services currently supported by Amazon FWS are currently available through Amazon Marketplace Web Service (Amazon MWS)." So I guess you want the Amazon Marketplace Web Service: https://developer.amazonservices...

[... 82 words]

What’s the best way to learn how to scale web applications?

Read “Building Scalable Websites” by Cal Henderson. It’s a few years old now but still very relevant—it basically covers everything he learnt the hard way scaling Flickr. It’s a really fun read, too.

[... 98 words]

Will I be able to make a decent eCommerce website just by learning coding from Codecademy?

I have more than ten years experience building dynamic sites, and I’d still personally much rather use a hosted service like than build an eCommerce system myself.

[... 51 words]

What are the best resources for learning regular expressions?

The O’Reilly book on Regular Expressions is absolutely superb. It will help you build a much deeper understanding if how they actually work than any online tutorial I’ve seen.

[... 62 words]

Why are front end developers so high in demand at startups if front end development is relatively easier than other fields of engineering?

You’re starting with an invalid assumption. Front end development is absolutely not “easier” than other forms of engineering.

[... 333 words]

Which core programming principles apply to all languages?


[... 17 words]

Wouldn’t an ASCII cellular automaton in javascript be the simplest starting point to teach/learn programming?

Absolutely not. The first step in learning to program is understanding that a computer can be quickly made to do something useful by executing lines of code. Personally I’m a big fan of firing up something with an interactive prompt (like Python, or even Firebug or the Google Chrome JS console) and demonstrating that typing a line of code hitting return will get a useful response.

[... 87 words]

Can Scala gain wider usage than Java any time soon?

No, because Scala is harder to master than Java.

[... 54 words]

What is an intuitive explanation of Unicode and why a programmer needs to know it?

Check out “The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)” by Joel Spolsky:

[... 55 words]

Tech Startups: What skills/technologies would the ideal technical co-founder possess?

The most important indicator is: can they ship? Can they prove that they know how to take a project from idea to running code deployed to a server somewhere with actual people interacting with it?

[... 109 words]

Where does one start in programming?

Go to this site:

[... 39 words]

Do people still write and compile programs from the command line, instead of an IDE? Why or why not?

Being an expert with command line tools gives you super powers.

[... 94 words]

Does version 1 of a startup always take much longer than expected?


[... 112 words]

What are some more glamourous careers a computer programmer can pivot into?

I don’t really know how you would define “glamorous”—personally I prefer a career that’s rewarding, exciting and helps make a difference. On that basis, I’d suggest looking in to data journalism. Computer Programming is most rewarding when you combine it with another discipline. Personally I think using programming to help journalists discover and explain deep truths hidden within large data sets is a fascinating way to make use of those skills.

[... 106 words]

If you were to build homeaway or vrbo from scratch, which software would you use?

HomeAway and VRBO are user-submitted content marketplaces, not traditional content management systems—using a CMS such as Drupal or Joomla would in my opinion be a mistake, as you’ll find yourself spending most of your time writing custom code. The benefits of a CMS will mostly be irrelevant for this application, and you’ll spend a bunch of time coding around their limitations and disabling default functionality that doesn’t fit your purposes.

[... 139 words]

What is a good programming language to learn after bash scripting?

Python is a good natural progression from bash in my opinion. It has an interactive prompt which supports bash-style exploratory programming, and it has libraries that mean it can be applied to an enormous range of problems—everything from game development to scientific computing to web applications.

[... 65 words]

Is there a method to programmatically clear browser cache in JavaScript?


[... 18 words]

Is there any reason for a new programmer to choose C# over VB.NET (or vice versa)?

My understanding is that VB.NET was mainly created to help make existing Visual Basic programmers more comfortable with the transition to .NET

[... 65 words]


Would having a maths degree put you at that much of a disadvantage against a CS student when it comes to jobs?

No. Plenty of the great programmers I know have maths, physics or even literature degrees. Read a couple of classic computer science text books and get some programming projects under your belt and you’ll be fine.

[... 64 words]

What is a good video series on learning Python?

It probably won’t teach you the basics, but we’ve collected 190 videos from conference talks about Python here:

[... 35 words]

Does one still need to learn C/C++ if one just wants to build web applications?

No—you don’t need any knowledge of C or C++ to get started building web apps—I know plenty of extremely smart and talented web developers who have never written a line of production C in their while careers.

[... 122 words]

What’s the difference between a software engineer, developer and programmer?

Absolutely nothing. Job title differences like those only really matter when working for a large organisation that sets compensation based on title—in which case you want to figure out which title gets you the best deal at that particular company.

[... 58 words]