Simon Willison’s Weblog

Subscribe

Blogmarks tagged programming

Filters: Type: blogmark × programming × Sorted by date

Cognitive load is what matters (via) Excellent living document (the underlying repo has 625 commits since being created in May 2023) maintained by Artem Zakirullin about minimizing the cognitive load needed to understand and maintain software.

This all rings very true to me. I judge the quality of a piece of code by how easy it is to change, and anything that causes me to take on more cognitive load - unraveling a class hierarchy, reading though dozens of tiny methods - reduces the quality of the code by that metric.

Lots of accumulated snippets of wisdom in this one.

Mantras like "methods should be shorter than 15 lines of code" or "classes should be small" turned out to be somewhat wrong.

# 26th December 2024, 6:01 am / programming, software-engineering

Programming mantras are proverbs (via) I like this idea from Luke Plant that the best way to think about mantras like "Don’t Repeat Yourself" is to think of them as proverbs that can be accompanied by an equal and opposite proverb.

DRY, "Don't Repeat Yourself" matches with WET, "Write Everything Twice".

Proverbs as tools for thinking, not laws to be followed.

# 17th May 2024, 12:10 pm / luke-plant, programming

scriptisto (via) This is really clever. “scriptisto is tool to enable writing one file scripts in languages that require compilation, dependencies fetching or preprocessing.”

You start your file with a “#!/usr/bin/env scriptisto” shebang line, then drop in a specially formatted block that tells it which compiler (if any) to use and how to build the tool. The rest of the file can then be written in any of the dozen-plus included languages... or you can create your own template to support something else.

The end result is you can now write a one-off tool in pretty much anything and have it execute as if it was a single built executable.

# 6th February 2024, 4:49 am / programming

A Coder Considers the Waning Days of the Craft (via) James Somers in the New Yorker, talking about the impact of GPT-4 on programming as a profession. Despite the headline this piece is a nuanced take on this subject, which I found myself mostly agreeing with.

I particularly liked this bit, which reflects my most optimistic viewpoint: I think AI assisted programming is going to shave a lot of the frustration off learning to code, which I hope brings many more people into the fold:

What I learned was that programming is not really about knowledge or skill but simply about patience, or maybe obsession. Programmers are people who can endure an endless parade of tedious obstacles.

# 14th November 2023, 4:36 am / new-yorker, programming, ai, chatgpt, llms

elite-source.asm—annotated source code for Elite on the BBC Micro (via) Mark Moxon has annotated every single line of the source code for Elite on the BBC Micro, and his annotations are so clear and in-depth that I can follow it despite knowing next to nothing about assembly code (and certainly nothing about writing it for the BBC).

# 28th September 2020, 2:30 am / programming, retro

awesome-falsehood: Curated list of falsehoods programmers believe in (via) I really like the general category of “falsehoods programmers believe”, and Kevin Deldyckehas done an outstanding job curating this collection. Categories covered include date and time, email, human identity, geography, addresses, internationalization and more. This is a particularly good example of the “awesome lists” format in that each link is accompanied by a useful description.

# 8th April 2018, 7:57 pm / internationalisation, programming

grammar.coffee (via) The annotated grammar for CoffeeScript, a new language that compiles to JavaScript developed by DocumentCloud’s Jeremy Ashkenas. The linked page is generated using Jeremy’s Docco tool for literate programming, also written in CoffeeScript. CoffeeScript itself is implemented in CoffeeScript, using a bootstrap compiler originally written in Ruby.

# 8th March 2010, 7:27 pm / coffeescript, compilers, docco, documentcloud, javascript, jeremy-ashkenas, literateprogramming, programming, ruby, selfhosting

dustin’s gomemcached (via) A memcached server written in Go, an experiment by memcached maintainer Dustin Sallings.

# 13th November 2009, 3:13 pm / concurrency, dustin-sallings, go, memcached, programming

The Go Programming Language. A brand new systems programming language, designed by Robert Griesemer and Unix/Plan 9 veterans Rob Pike and Ken Thompson and funded by Google. Concurrency is supported by lightweight communicating processes called goroutines. “It feels like a dynamic language but has the speed and safety of a static language.”

# 11th November 2009, 7 am / concurrency, go, google, goroutines, kenthompson, plan9, programming, robert-griesemer, rob-pike, unix

Toiling in the data-mines: what data exploration feels like. Useful advice from Tom Armitage on the exploratory development approach required when starting to build a project against a large, complex dataset. Tips include making sure you have a REPL to hand and using tools like gRaphael to generate graphs against pretty much everything, since until you’ve seen their shape you won’t know if they are interesting or not.

# 26th October 2009, 9:34 am / berg, data, exploratoryprogramming, graphael, graphing, programming, repl, tom-armitage

I like Unicorn because it’s Unix. Ryan Tomayko analyses Unicorn, a new, pre-forking Ruby HTTP server that makes extensive use of Unix syscalls and idioms, and asks why dynamic language programmers don’t take advantage of these more often.

# 7th October 2009, 11:42 am / exec, fork, programming, ruby, ryan-tomayko, unicorn, unix

The Little Manual of API Design (PDF). A concise, highly readable guide to designing APIs that are “Complete, Easy to learn and memorize, lead to readable code, hard to misuse, and easy to extend”, based on lessons learnt over many years of development of the Qt framework.

# 18th May 2009, 10:14 am / api-design, apis, programming, qt

Switching from scripting languages to Objective C and iPhone: useful libraries. Matt Biddulph collects together some very useful libraries for developers just getting started with Objective-C (though I’m not too keen on the title).

# 27th January 2009, 5:50 pm / iphone, matt-biddulph, objectivec, programming

Coding Horror: A Scripter at Heart. Sigh. I cannot believe that the false distinction between “scripting” and “programming” is still being discussed.

# 26th January 2009, 6:06 pm / ffs, flamewars, jeff-atwood, programming, scripting

Learning to Think Like A Programmer. Outstanding advice aimed mainly at journalists, but important to anyone who collects information for a living and might want it to be automatically processed at some point in the future.

# 22nd January 2009, 6:06 pm / data-journalism, journalism, programming, tom-armitage

The History of Python (via) “A series of articles on the history of the Python programming language and its community”, being compiled by Guido plus guest authors.

# 14th January 2009, 9:42 am / guido-van-rossum, history, programming, python

why’s potion. why’s latest project is a small, fast language (JIT to x86/x86-64) which seems to take ideas from Ruby, Lua, Python and who knows where else. Everything is based around objects, closures and mixins, with the delightful inclusion of scoped mixins so you can modify an object only within a certain module (hence avoiding Ruby’s action-at-a-distance problems).

# 8th January 2009, 6:37 pm / closures, jit, languages, lua, mixins, potion, programming, ruby, whytheluckystiff

Blocks in Objective-C. Closures are coming soon to Objective-C - interesting syntax, a regular curly brace block preceded by a caret ^{ ... }.

# 29th December 2008, 7:38 pm / blocks, closures, objectivec, programming, syntax

The Universal Design Pattern. Steve Yegge presents a small book on key/value pairs and prototypal inheritance. “I call it the Universal design pattern because it is (by far) the best known solution to the problem of designing open-ended systems, which in turn translates to long-lived systems.”

# 20th October 2008, 11:13 pm / design-patterns, keyvaluepairs, programming, prototypes, steve-yegge

Reia. The most common complaint I see about Erlang is the syntax. Reia is a Python-style scripting language (with a dash of Ruby) that runs on the Erlang virtual machine. Looks promising.

# 25th September 2008, 6:12 pm / erlang, programming, python, reia, ruby

Core Techniques and Algorithms in Game Programming. Scarily detailed online book on games programming, including 2D and 3D graphics, AI, multiplayer network code, indoor and outdoor rendering, character animation and much more. UPDATE: Removed the original link, which appeared to be a pirated copy.

# 1st May 2008, 12:26 am / algorithms, games, programming

Good architectural layering, and Bzr 1.1. Mark Shuttleworth on the growing importance of plug-in architectures as an open source project evolves, as they allow new developers to release their own components without needing commit access to the project. Django is pretty good for this, but more hooks (and a faster event dispatch system) would be useful.

# 9th January 2008, 2:06 pm / bazaar, bzr, dispatch, django, events, hooks, mark-shuttleworth, open-source, programming, python

Naming twins in Python and Perl. Simple anagram problem solved in Perl and Python, with a bunch more solutions in the comments. The C# solution provides an interesting example of LINQ in action.

# 7th January 2008, 11:03 am / anagrams, brad-fitzpatrick, csharp, linq, perl, programming, python

The D Language and Server Logs. Neat example of a simple D program for crunching log files.

# 3rd December 2007, 9:02 pm / d, joe-gregorio, logs, programming

Bit Twiddling Hacks. I’ve never been much of a bit twiddler, but I’ve always felt I should learn.

# 2nd November 2007, 6:49 am / binary, bits, bittwiddling, hacks, programming

Programming Nu (via) Interesting new programming language—Lisp style syntax, Ruby style semantics, built in Objective C bridge so you can access Cocoa APIs directly.

# 1st October 2007, 9:49 pm / cocoa, lisp, nu, objectivec, programming, ruby

Want To Learn Web Programming? Write A Blog Engine. I couldn’t agree more. Weblogs are an ideal starter project—simple enough to get your head around, complex enough to teach you a bunch of important lessons, ideally suited for eating your own dog food.

# 20th September 2007, 1:17 pm / dogfood, programming, weblogs

An Introduction to Erlang. Erlang gets the ONLamp tutorial treatment from Gregory Brown.

# 13th September 2007, 5:47 pm / erlang, gregory-brown, onlamp, programming

Brad Neuberg’s Personal Research Agenda. Inspiring; lots of interesting problems to solve. I also liked the idea of moving to Thailand during a tech downturn and hacking on interesting projects while spending $200/month on living costs.

# 23rd August 2007, 1:40 am / brad-neuberg, hacking, programming, thailand

19 Eponymous Laws Of Software Development. I normally loathe anything that’s bundled up as a numbered list, but this one is actually really useful.

# 18th July 2007, 12:29 am / lists, programming