Advertise here with Carbon Ads

This site is made possible by member support. 💞

Big thanks to Arcustech for hosting the site and offering amazing tech support.

When you buy through links on kottke.org, I may earn an affiliate commission. Thanks for supporting the site!

kottke.org. home of fine hypertext products since 1998.

Beloved by 86.47% of the web.

🍔  💀  📸  😭  🕳️  🤠  🎬  🥔

kottke.org posts about programming

RIP Dennis Ritchie

Dennis Richie passed away last week. Richie created the C programming language, was a key contributer to UNIX, and wrote an early definitive work on programming, The C Programming Language.

We lost a tech giant today. Dennis MacAlistair Ritchie, co-creator of Unix and the C programming language with Ken Thompson, has passed away at the age of 70. Ritchie has made a tremendous amount of contribution to the computer industry, directly and indirectly affecting (improving) the lives of most people in the world, whether you know it or not.

These sorts of comparisons are inexact at best, but Richie’s contribution to the technology industry rivals that of Steve Jobs’…Richie’s was just less noticed by non-programmers.

Fave · 0

Scripting language comparisons

An extensive side-by-side reference sheet of four scripting languages (PHP, Python, Perl, and Ruby) with which you can compare how the different languages handle variable declarations, concatenations, objects, and hundreds of other things. Great cheatsheet for learning a new language when you’re already familar with one of the others.

Fave · 0

Weird software bugs

From Wikipedia, a list of unusual software bugs, including the Mandelbug and Heisenbug. My favorite is the Schrödinbug:

A schrödinbug is a bug that manifests only after someone reading source code or using the program in an unusual way notices that it never should have worked in the first place, at which point the program promptly stops working for everybody until fixed.

(via @greglopp)

Fave · 0

Regular expression tester

Related to the regex generator I posted last week, here’s a regular expression tester…you plug in your regex and it’ll match test strings as you type. (thx, chris)

Fave · 0

Magical regular expression generator

On text2re.com, you can input some text you want to use a regular expression on, click on what you want to match, and it’ll generate the regular expression for you.

This system acts as a regular expression generator. Instead of trying to build the regular expression, you start off with the string that you want to search. You paste this into the site, click submit and the site finds recognisable patterns in your string. You then select the patterns that you are interested in and it writes a fully fledged program that extracts those patterns from that string. You then copy the program into your editor or IDE and play with it to integrate it into your program.

This just totally broke my brain.

Fave · 0

On weekend web apps

Andre Torrez offers some advice for those who think that they can clone a popular web app over the weekend. The best part — or the worst, if you’re the aspiring weekend programmer — is that each item on the list is a little Pandora’s box of Alice’s rabbit holes. Like this:

Lost password flow. You’ll want to generate a key and store it someplace for when someone requests to reset their password. So that’s another email that has to go out.

If you actually want your email to arrive at its destination, you’re gonna have to worry about all this. Or go through a third-party service, which is another interface (and bill (and moving part)) that you need to worry about. You get the point…making a web app work for more than just one person is hard, way harder than it looks unless you’ve done it.

Fave · 0

Lady Gaga sings about Java programming

Ok, so it’s not Gaga (and certainly not Christopher Walken), but she does work “object oriented” into the lyrics.

This is possibly the best production of the worst idea I’ve ever seen.

Fave · 0

Ada Lovelace, the first computer programmer

Charles Babbage built one of the first mechanical calculating machines but Ada Lovelace was the first to show how the machine’s arithmetic function could be abstracted to produce things other than numbers: language, graphics, or music.

There are several other Information Pioneers shorts available on Vimeo, including profiles of Tim Berners-Lee, Alan Turing, and Hedy Lamarr.

Fave · 0

When programming errors attack!

From a bunch of security experts, the top 25 most dangerous programming errors that can lead to serious software vulnerabilities.

Cross-site scripting and SQL injection are the 1-2 punch of security weaknesses in 2010. Even when a software package doesn’t primarily run on the web, there’s a good chance that it has a web-based management interface or HTML-based output formats that allow cross-site scripting. For data-rich software applications, SQL injection is the means to steal the keys to the kingdom. The classic buffer overflow comes in third, while more complex buffer overflow variants are sprinkled in the rest of the Top 25.

Fave · 0

Programming lessons

A programmer lists 20 lessons learned in the past 20 years.

5. You are not the best at programming. Live with it. — I always thought that I knew so much about programming, but there is always someone out there better than you. Always. Learn from them.

(via @h_fj)

Fave · 0

Step by step

If you’re Dan Bricklin, co-inventor of the spreadsheet, how do you go about learning a new programming environment? Just like everyone else:

In mid-September I purchased a shiny new 24” Apple iMac and an iPhone 3GS. I signed up for the Apple iPhone Developer Program. I bought some books and started doing the tutorials, step by step. I came up with the idea for an app I needed and built a prototype, then plunged in and started creating a full app that would be good for others, too.

Personally, I find this really inspiring.

Fave · 0

A dogcow makes a moof

Hackers Can Sidejack Cookies, a poem by Heather McHugh.

Designs succumbing
to creeping featuritis
are banana problems.
(“I know how to spell banana,
but I don’t know when to stop.”)

Fave · 0

Green Eggs and Ham

After writing The Cat in the Hat in 1955 using only 223 words, Dr. Seuss bet his publisher that he could write a book using only 50 words. Seuss collected on the wager in 1960 with the publication of Green Eggs and Ham. Here are the 50 distinct words used in the book:

a am and anywhere are be boat box car could dark do eat eggs fox goat good green ham here house I if in let like may me mouse not on or rain Sam say see so thank that the them there they train tree try will with would you

From a programming perspective, one of the fun things about Green Eggs and Ham is because the text contains so little information repeated in a cumulative tale, the story could be more efficiently represented as an algorithm. A simple loop would take the place of the following excerpt:

I do not like them in a box.
I do not like them with a fox.
I do not like them in a house.
I do not like them with a mouse.
I do not like them here or there.
I do not like them anywhere.
I do not like green eggs and ham.
I do not like them, Sam I am.

But I don’t know…foreach (\$items as \$value) doesn’t quite have the same sense of poetry as the original Seuss.

Fave · 0

The Chef programming language

I have no idea how to describe the Chef programing language to you, but here is its Hello World program, in the form of a souffle:

Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes

Method.
Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the mixing bowl into the baking dish.

Serves 1.

Ok, I think I get it now…the programs look like food recipes but act like code when run through the proper interpreter. Mmmm, fibonacci with caramel sauce! (via ben fry)

Fave · 0

The Elements of [programming] Style

Read in the right way, Strunk and White’s The Elements of Style becomes an important reference for software development.

5.21. Prefer the standard to the offbeat
Young writers Inexperienced programmers will be draw at every turn toward eccentricities in language. They will hear the beat of new vocabularies abstractions, the exciting rhythms of special segments of their society industry, each speaking a language of its own. All of us come under the spell of these unsettling drums; the problem for beginners is to listen to them, learn the words, feel the vibrations, and not be carried away.

Fave · 0