Functional Programming

A couple of years ago, I wrote about Kris Jenkins’ wonderful video that demonstrated interactive programming while building a Spotify client in Emacs Lisp. It’s one of my favorite videos and I’m still seeing it mentioned as new people discover it. Now Jenkins has a two-part post on functional programming that’s also worth your time.

Part One considers the question of what, exactly, functional programming is. Jenkins shapes his answer for the working programmer. It’s not, he says, about map and reduce or anonymous functions—although functional languages generally support these—but about recognizing and controlling side effects. This is more subtle than you might suppose but Jenkins does a good job of explaining what it means and why it’s important. All programmers should read this whether or not they’re interested in functional programming.

Part Two looks at several programming languages and asks to what extent they could be considered functional. These range from Java, the anti-functional language, to Haskell, a functional language on steroids. He also considers, JavaScript, Scala, Clojure, Perl, and Python. Of course, it’s possible to write in a functional manner in almost any language but some, like Java, actively discourage it.

If you’re a working programmer, you should definitely take a look at these two posts. Jenkins raises issues that you should consider regardless of the language you’re writing in or the paradigm you’re using.

Posted in Programming | Tagged , | 2 Comments

Integrating iCal and Org Mode

Rob Rohan has a very nice video up on integrating Org mode and OS X1 iCal. In his case, he wants to create a physical training schedule that will be reflected in his desktop calendar as well as on his iOS devices. Even if your idea of exercise is getting up to get another cup or coffee, you can use the same ideas to export Org events to your calendar for any purpose.

As the Org Manual puts it, “Some people use Org mode for keeping track of projects, but still prefer a standard calendar application for anniversaries and appointments.” In this case the techniques that Rohan describes make it easy to integrate Org mode with iCal. Even if you keep everything in Org mode, you may want to export it to iCal so you can see it on your iOS (or other remote) devices.

The video is short (7 minutes, 46 seconds) so it’s easy to watch. If you’ve been wishing for a way to get Org events into your calendar or your New Year’s resolution involves getting serious about your exercise regime, take a look at Rohan’s video.

Footnotes:

1

Since iCal uses the standard icalendar format, you could probably make this work on any platform and calendar application that supports the icalendar standard.

Posted in General | Tagged , | 1 Comment

Operator Precedence

This seems funny until you realize that it’s true:

Posted in General | Tagged | 2 Comments

The Eighties Called…

…with a message for today’s new Luddites moaning about smart phones and the end of times.

Just as calculators didn’t result in widespread innumeracy, I’m pretty confident that we’ll somehow muddle through the smart phone apocalypse. Not that that will make the new Luddites leave us alone.

Posted in General | Tagged | Leave a comment

Learning the Right Tools

I was going to let this go

but it kept bothering me so here we are.

I don’t understand this attitude and I find it insulting not only to those who have bothered to master their tools but also to younger engineers who are assumed to be too stupid or lazy to do the same.

If you want a best-in-class editor then you take the effort to learn Emacs, Vim, or perhaps one or two others. You don’t declare that Notepad++ is good enough and you certainly don’t, if you know what you’re talking about, declare that Notepad++ won the Vim/Emacs holy war.

Today’s younger engineers are not, in any real sense, kids. Nor are they special snowflakes that need to be protected from the disciplines of our profession. If you want to be more than today’s equivalent of yesteryear’s “Web specialists” that ran scripts to build rudimentary Web sites, then you better learn and master the basic tools. That means learning some language in addition to Javascript, moving beyond Eclipse, and getting comfortable with the command line.

Call me a dinosaur but if your idea of software engineering is pushing a button to generate great glops of code that you don’t understand then your idea of our profession is very different from mine.

Posted in General | Tagged | 6 Comments

The EFF Talks Encryption

Everyone interested in the encryption wars knows that the EFF has done yeoman’s service defending our right to have access to strong, uncompromised encryption. Certain parts of the government hate this and insist that they need—for our own good, of course—to be able to read our emails, texts, and other communications.

Recently, the EFF, Access Now, and a few other nonprofits and tech companies met with White House officials seeking to discuss their concerns and to secure a commitment from the administration to ensure Americans the right to have and use strong encryption free of back doors or other crippling measures.

The EFF has posted the results of that discussion and some suggestions for moving forward. They are asking for all those concerned to make your opinions known to the White House through an on-line form. Please take a few minutes to leave a message in support of strong encryption and asking that the FBI and others in the government stop their disingenuous campaign to force tech companies to provide them with back doors and other means of accessing private, encrypted data.

Posted in General | Tagged | Leave a comment

We Don’t Care About No Stinkin’ Keys

In a world in which the FBI is intent on bullying tech companies into giving them “golden keys” that they can use to unlock encrypted communications, the TSA’s compromise of their own golden keys (used to open luggage for inspection) seemed like an object lesson worth considering. After all, the government asked for special access and ensured us that our baggage would be safe from petty thieves while still allowing the TSA to keep us safe. Instead, the TSA carelessly allowed pictures of the keys to be published and now anyone who wants a set and has access to a 3-D printer can get one.

The TSA’s loss of the master keys seemed like a cogent argument against trusting the government with the far more important and potentially devastating access to our digital communications. Here’s another: the TSA’s reaction to the loss of the keys is “Meh. Most people don’t lock their bags anyway. Besides, the bags are under our control so they’re safe.”

Even if you believe that anodyne fairy tale, it says nothing about, say, a hotel bell hop who suddenly has access to your luggage. As a practical matter, the locks are terribly insecure with or without the master keys but the government did promise that the locks would ensure the safety of your luggage while enabling legitimate government access.

Yet when that same government lost control of the keys, their attitude was, “So what? It’s not our problem.” Is there any reason to believe that the FBI would be any less cavalier if they lost the encryption master keys? Is there any reason to believe that the FBI would be more competent than the TSA is safeguarding those keys?

The possible loss of the encryption master keys is only one—and not the strongest—argument against the imposition of these keys but it’s worth remembering what the government says when they mess up and compromise their exceptional access: “It’s not our problem.”

Posted in General | Tagged | Leave a comment

Adjusting Text Size in Emacs

For some reason I have a hard time remembering this. If you have a hard time too, consider this my Christmas gift to you.

Although Green doesn’t mention it, you can skip the 【Ctrl+x】 after the first invocation. So 【Ctrl+x Ctrl++ Ctrl++】 will increase the text size two jumps.

Posted in General | Tagged | 4 Comments

Productivity Packages for Emacs

Adrien Brochard over at Xmodulo has a list of 10 productivity packages for Emacs. Some of them are actually built-ins but they’re all something that every Emacs user should consider installing or using. I’m a user of almost all of them and wouldn’t want to live without them.

One that I’m not using is auto complete but Brochard’s writeup has convinced me to give it a try. With ELPA it’s trivial to try a package out and revert it if it doesn’t work for you.

I won’t ruin your Christmas surprise by revealing the rest of Brochard’s list so you’ll need to follow the link. Really, there’s no reason you shouldn’t be using—or at least seriously consider using—these packages. They can help speed you on your way to being an Emacs master.

Posted in General | Tagged | Leave a comment

Org-Ref Update

I’ve written about John Kitchin’s org-ref package a couple of times before [1, 2] but now it’s available on Melpa. If you write papers or reports that have references (either internal or external), you need this package. It makes handling citations easy and transparent.

Kitchin has a new video out describing the updated org-ref. I suggest that you first watch the original video to get an idea of some of the things you can do. The new video starts with an empty file and builds a toy article with the purpose of demonstrating how you would use the org-ref package during the preparation of an article or paper.

The amount of functionality can seem overwhelming but Kitchin also provides a very nice manual that documents the package and the functions it contains. Kitchin built the package for his own use in preparing papers—he’s a researcher in Chemical Engineering—so it really does solve the citation/reference problems that a researcher encounters when writing up results. If you’re a student or an engineer producing reports, the package will be just as useful for you.

An important fact about Kitchin’s workflow is that he writes his papers in Org mode. That has lots of advantages as he has as he has demonstrated before. Now we can count one of those advantages as the automating of a large part of the citation/reference process. As I wrote before, handling citations isn’t really hard but it can be fiddly. The org-ref package makes it much less tiresome to deal with.

Posted in General | Tagged , | Leave a comment