What: Code

Learning to Program in Python

Monday, 26 September 2016 · 2 minute read

A drawing Monty Python’s foot from the original in Venus, Cupid, Folly and Time.

The Python programming language was named after the BBC’s comedy series Monty Python’s Flying Circus created by, among others, John Cleese. Perhaps this in itself says much about the language.

A friend with no programming experience asked how to learn to program a computer using the Python language, so I wrote this list:

  1. Read What is Code.
  2. Download and install a nice free and open source text editor.
  3. Try these tutorials aimed at new coders. You can also try an interactive tutorial directly in the browser.
  4. Dig in by working on a personal project. Making a website about something that is meaningful to you is a good choice. Django is a web framework — a set of programming patterns to make websites — written in Python. It is one of the best ones, with plenty of good tutorials.
  5. Read Pragmatic Thinking and Learning and keep practicing the fundamentals.

Remember the Zen of Python:

Continue reading…

Code.org #

Every student in every school should have the opportunity to learn computer science.

HTML Form to File.txt

Wednesday, 13 July 2016 · 4 minute read

Summary: HTML/JavaScript form that saves user input into a text file in Markdown format with YAML front matter for use on your local computer. Use to quickly create a post for publishing with a static website generator such as Hugo or Jekyll. After my recent site redesign my photo publishing workflow is as follows: After choosing a photograph in Lightroom, I export it into the images folder of my Hugo-powered site on my computer.

Continue reading…

Designers That Code #

Jenifer Tidwell:

So, it’s possible to be seen as both a designer and a coder. But it requires very, very careful management of your personal brand. Set expectations clearly, and defend your personal boundaries — if you’re doing more coding than you like, you’ll have to decide when and how to push back or ask for more design responsibility.

Script to Convert Django Flatpages to Hugo Markdown Files with YAML Frontmatter

Thursday, 23 June 2016 · 2 minute read

I needed to export a lot of entries stored in the SQLite database of my previous Django site for importing into the new Hugo-powered SimonGriffee.com. Thankfully, Sam Kingston had already written a script to export Mezzanine blog posts to Jekyll, so I modified it to make djangoflatpage2hugo.py, below. To use it: Save the the code below in a file called djangoflatpage2hugo.py and put it in the following location: yourdjangoproject/ management/ commands/ djangoflatpage2hugo.py.

Continue reading…


table#webwork h2 {margin-top:0;} table#webwork th {padding:5px 15px 5px 0;} table#webwork td {padding:20px 15px 40px 0; vertical-align:top; border-top:1px solid #eee;} Websites Various websites I’ve worked on. Sketch of the homepage with a drawing of Darwin who I imagined at the time would be a potential user of the site if he were alive. Homepage. Admin page. Text editing system. Design documentation page example. Latest version (2015), built with Django and Mezzanine CMS.

Continue reading…

What is Code? #

Excellent, epic writing by Paul Ford. The lead ‘Hello World’ picture is by nice person and photographer I’ve coincidentally met in NYC: David Brandon Geeting. I warmly recommend his book ‘Infinite Power’ if you can get a copy!

A few highlights from the gigantic, in web parlance, ‘wall of text’, to help convince you to go read the whole thing:

Compilation is one of the denser subjects in computer science, because the lower down you go, the more opportunities there are to do deep, weird things that can speed up code significantly—and faster is cheaper and better. You can write elegant, high-level code like F. Scott Fitzgerald, and the computer will compile you into Ernest Hemingway. But compilers often do several passes, turning code into simpler code, then simpler code still, from Fitzgerald, to Hemingway, to Stephen King, to Stephenie Meyer, all the way down to Dan Brown, each phase getting less readable and more repetitive as you go.

You rarely see TMitTB in person, because he’s often at conferences where he presents on panels. He then tweets about the panels and notes them on his well-populated LinkedIn page. Often he takes a picture of the audience from the stage, and what you see is an assembly of mostly men, many with beards, the majority of whom seem to be peering into their laptop instead of up at the stage. Nonetheless the tweet that accompanies that photo says something like, “AMAZING audience! @ the panel on #microservice architecture at #ArchiCon2015.”

Your meetings, by comparison, go for hours, with people arranged around a table—sitting down. You wonder how he gets his programmers to stand up, but then some of them already use standing desks. Perhaps that’s the ticket.

C is a simple language, simple like a shotgun that can blow off your foot. It allows you to manage every last part of a computer—the memory, files, a hard drive—which is great if you’re meticulous and dangerous if you’re sloppy. Software made in C is known for being fast. When you compile C, it doesn’t simply become a bunch of machine language in one go; there are many steps to making it really, ridiculously fast. These are called optimizations, and they are to programming what loopholes are to taxes. Think of C as sort of a plain-spoken grandfather who grew up trapping beavers and served in several wars but can still do 50 pullups.

But there’s another way to interpret all this activity around Python: People love it and want it to work everywhere and do everything. They’ve spent tens of thousands of hours making that possible and then given the fruit of their labor away. That’s a powerful indicator. A huge amount of effort has gone into making Python practical as well as pleasurable to use. There are lots of conferences, frequent code updates, and vibrant mailing lists. You pick a language not just on its technical merits, or its speediness, or the job opportunities it may present, but also on its culture.

Python people, generally, are pretty cool.

Back in the 1980s, while the Fortran programmers were off optimizing nuclear weapon yields, Lisp programmers were trying to get a robot to pick up a teddy bear or write a sonnet.

HyperText Markup Language, the encoding format for Web pages since the Web began. Programmers argue over whether HTML is “programming” or not because they are paranoid about status and don’t want to allow mere tag-wranglers to claim blessed programmer status. So the text that appears here doesn’t count as “code” but as “markup.” The difference between an expert markup person and an expert coder is, from experience, somewhere between $20K and $70K in favor of the programmer.

Oracle makes you pay thousands of dollars to use its commercial enterprise database, but more and more of the world runs on free software databases such as PostgreSQL and MySQL. There’s even a tiny little database called SQLite that’s so small, so well-behaved, and so permissively licensed that it’s now in basically every smartphone, available to apps to help them save and load data. You probably have a powerful SQL-driven database in your pocket right now.

Academic researchers often produce things that basically work but don’t have interfaces. They need to prove their theses, publish, and move on to the next thing. People in the free software community often code to scratch an itch and release that code into the digital commons so that other people can modify and manipulate it. While more often than not this process goes nowhere, over time some projects capture the imagination of others and become part of the infrastructure of the world.

Anything Java can do, Clojure can do. And since it’s built atop the JVM, it can do it on any computer. There were already Lisp editing tools out there, and it was pretty easy to modify them for Clojure. It was joined to Java like a remora to a shark. Or more accurately, it’s a remora attached to a remora, because the JVM itself is a fake machine running inside real machines.

The point is that things are fluid in the world of programming, fluid in a way that other industries don’t seem to be. Languages are liquid infrastructure. You download a few programs and, whoa, suddenly you have a working Clojure environment. Which is actually the Java Runtime Environment. You grab an old PC that’s outlived its usefulness, put Linux on it, and suddenly you have a powerful Web server. Now you can participate in whole new cultures. There are meetups, gatherings, conferences, blogs, and people chatting on Twitter. And you are welcomed. They are glad for the new blood.

An ecosystem. “Ecosystem” is another debased word, especially given what we keep doing to the real, physical one around us. But if a few hundred thousand people are raising their kids and making things for 100 million people, that’s what they call it.

Drakon Visual Language #

DRAKON is a visual language to represent any knowledge that explains how to accomplish a goal. See also: Using DRAKON to generate code from flowcharts:

Human eyes and brains are optimised for looking at shapes and patterns - not lines and lines of text. Drakon allows you to spot errors in your algorithms before you commit them to code.

Once you have drawn out the code using the visual editor, it can automatically produce clean and efficient code in Java, C#, C/C++, Python, Tcl, Javascript, Lua and Erlang.

New Coder #

Five life jackets to throw to the new coder.