SICP and Why It Matters

Brian Harvey, who has been teaching the Berkeley SICP course for 25 years has an interesting and moving tribute to the famous Structure and Interpretation of Computer Programs, which he calls the best computer science book in the world. Irreal readers who have been around for a while know that that’s a sentiment that I share.

The tribute was written in 2011 at the request of the Boston Globe to celebrate the 150th anniversary of MIT. They asked Harvey to explain the significance of SICP for an article on the most important innovations developed there. He praises the book for its stubborn refusal to waste the better part of a semester learning the syntax of some computer language instead of focusing on what matters: the fundamental idea of abstraction. Part of what allowed that, of course, was the use of Scheme. I remember reading an article by Sussman—long before I learned Scheme or even really knew what it was—that they never bothered explicitly teaching Scheme in the course. They just used it and students picked it up as they went along. Harvey says that he spends the first half hour on notation and then doesn’t bother with explicitly teaching the language.

If, like me, you love SICP or you use and like Scheme, you should read Harvey’s tribute. It serves to remind us what a wonderful book it is and how revolutionary it was—and is—as a vehicle for learning about computer science.

Posted in General | Tagged | 1 Comment

Republicans: Copyright Skeptics?

See the afterward below for the latest information on this.

Over at The Volokh Conspiracy, a group blog by conservative lawyers, Stewart Baker writes that Republicans are repudiating 40 years of tougher copyright laws. If that’s true it can only be good news for sanity and common sense. But what evidence is there for this change of heart?

Baker points to a Republican Study Committee Policy Brief that discusses the problems with current copyright law and recommends some solutions. The report is an interesting read. It first explores three widely held beliefs about copyright, all of which are false:

  1. The purpose of copyright is to compensate the creator of the content.
  2. Copyright is free market capitalism at work.
  3. Copyright, as currently constituted, leads to the greatest amount of innovation and productivity.

Next, the report lists some of the distorting effects of copyright law. Irreal readers will be familiar with these but it’s nice to see that politicos are coming to recognize them as well.

Finally, the report discusses some reforms:

  1. Rewriting of the statutory damages laws to be proportionate and sensible.
  2. Expanded fair use.
  3. Punishment of false copyright claims.
  4. Limitation of copyright terms and the creation of disincentives for renewal.

Regardless of your political persuasion, you will, I think, find this brief compelling. Definitely worth your time.

Afterward

I wrote this on Saturday. By the end of the day the brief had already been withdrawn1. Techdirt (and lots of others) are reporting that Paul Teller, the RSC executive director, has released a memo withdrawing the brief and claiming that it was published “without adequate review.” Techdirt finds that claim silly. They say that everything posted on the RSC website goes through the same full review. What really happened here, they say, is that big media went ballistic and the RSC caved. I really don’t understand this. It’s not like big media is suddenly going to start supporting Republicans.

I held off publishing in the hopes that sanity would reassert itself at the RSC but I guess that’s not happening. I’ll leave the political analysis to others but I don’t see how the Republicans gain by looking like craven toadies for big media. I sure see a lot of ways they get hurt though. The original document is still worth a read; you can find a copy of it here.

Footnotes:

1 Providing yet another confirmation of Betteridge’s law.

Posted in General | Leave a comment

Amazon and DRM

Over at Attendly.com John Birmingham has a provocative article entitled When It Comes To DRM, Amazon Is A Bottom Feeding Hell Beast. That is, to put it mildly, a bit hyperbolic but Birmingham has a serious point. A point that we’ve made here before: DRM is allowing Amazon to establish a virtual monopoly in ebooks.

Unlike many commenting on the situation, Birmingham has some skin in the game. He’s a fiction author who, one would think, has a lot to lose from people copying his books without paying. Indeed, he starts his article with a story of a women who had so enjoyed one of his early books that she photocopied parts of it and gave the copies to her friends. At the time he was not pleased but decided in the end that she probably earned him a couple of new readers. As Tim O’Reilly says, the typical author’s problem is not piracy but obscurity.

Regardless, he’s come to realize that the main effect of DRM is to make Amazon into a monopolist by trapping people in the Kindle ecosystem. Much the same can be said, of course, for Apple iBooks and the Barnes and Noble Nook ecosystems. Still, it is Amazon that everyone worries about. Notice who’s benefiting here. It’s not the authors and it’s not the publishers; it’s Amazon.

It is, then, an absurd irony that the authors and publishers are the ones insisting on DRM. Birmingham, for his part, is having no more of it and is now selling his books without DRM. We can only hope that the publishers will get on board before it’s too late.

Posted in General | Tagged | Leave a comment

Xah’s Unicode Gallery

Speaking of Unicode, as I did yesterday, Xah Lee has updated and rearranged all his pages dealing with Unicode and added a single, unified Unicode Gallery & Tutorial index page. I really like this because it provides a single page that serves as a portal to a vast amount of information about Unicode.

If, like me, you don’t use the rarer Unicode symbols everyday, this is a good resource to bookmark. If you are an Emacs user who often needs specialized Unicode characters, Lee lists some tools that may help. Regardless, it’s worth looking at the page just to see what’s there in case you need it later.

Posted in General | Tagged | Leave a comment

Encodings and Unicode

David C. Zentgraf over at Kunststube.net has a useful post about character encodings, Unicode, and UTF-X. The post is entitled What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text, which is a pretty good summary of its content. I’m confident that almost all Irreal readers will already know this material but if you’re confused about the difference between Unicode and UTF-8 or some other UTF encoding then you may find this post enlightening. Similarly, if you have non-technical friends who want a succinct explanation of why they’re getting a stream of gibberish characters in their browser this may be a good resource.

Posted in General | Leave a comment

Further Evidence for the Demise of Cursive

I’ve written a couple of times about the demise of cursive handwriting. Its proponents’ arguments have pretty much been reduced to (1) it is the apotheosis of all that is good and holy in written communication and (2) if we don’t learn to write in cursive, we won’t be able to read cursive. If you’re like me, you won’t find either of those arguments compelling.

Recently, I came across a column in The Washington Post Magazine by Gene Weingarten entitled Cursive, Foiled Again in which, with tongue firmly in cheek, he talks about cursive handwriting and how young people simply aren’t learning it. What struck me was the ages of the “young people.” I had imagined that today’s elementary school children weren’t learning cursive but Weingarten relates how neither a 28 year old colleague nor his son, also 28, had been taught cursive. Surprised by this, Weingarten checked and discovered that schools have been deemphasizing cursive for the last 20 years. Of course that will vary by state and school district but the trajectory is clear.

Weingarten’s column is amusing and worth a read. I especially like that he confirms my suspicion that the real reason the traditionalists maintain their death grip on cursive is, to quote Weingarten,

Why shouldn’t kids today have to suffer through learning cursive the
way we did, and from the same idiot book, which seemed to have been
designed by 19th-century French fops with perfumed doilies in their
sleeves.

Yes. I remember those books. Whether or not they were written by French authors, I recall that even as a third grader I found them annoying.

I am more than ever convinced that cursive—and probably all handwriting—is in a death spiral. It won’t bother me but there seems to be a lot of people for whom it appears to be the apocalypse.

Posted in General | 1 Comment

Some Common Sense on OOP

A few days ago, I ran across an interesting and commonsensical article on OOP by James Hague over at programming in the twenty-first century. In it he says that while OOP is sometimes useful, it’s not a fundamental particle of computing. Too often, he says, OOP is blindly applied to inappropriate problems. Problems that aren’t complicated enough to warrant its use and the difficulties that it brings.

It is, as I say, an interesting post and I was going to blog about it in a little more detail but Rob Pike beat me to it with his own post on OOP that makes the same point—and even mentions Hague’s post—in a more provocative way. Pike points to an example of OOP run amok that can be characterized only as terrifying. Pike says of it

Local discussion focused on figuring out whether this was a joke or
not. For a while, we felt it had to be even though we knew it wasn’t.

I can’t begin to describe the horror of it so you’ll have to go over to Pike’s post and follow the link that he gives.

The problem itself is to determine the operating system you’re running on and output a value judgment about it. As Pike says, this is a trivial problem that can be solved easily with a simple table look up in any language. Here it is in Elisp, for example:

(defvar systems '((usg-unix-v "UNIX" "good")
                  (gnu/linux "UNIX" "good")
                  (windows-nt "Windows" "bad")
                  (darwin "Mac OS" "far superior")))

(let ((box (assoc system-type systems)))
  (if box
      (message "This is a %s box and therefore %s." (cadr box) (caddr box))
    (message "This is not a box.")))

Simple, extensible, and not a class to be seen.

Posted in Programming | Tagged | 3 Comments

An Optimal .emacs File

I recently stumbled across this old post from Nickel’s Worth on optimizing your .emacs file. It’s from 2009 so it is, in some parts, dated but it still contains a lot of good ideas.

To me, the most controversial piece of advice is to avoid using load or require in your .emacs. I’ll let you read the post for the reasons for that but I will say that the suggestion is not without merit.

Another idea that solves a problem I seem to keep having is to use eval-after-load so that you can set various package-configuration variables without loading the package. For example, you might have the autoloaded package foo that requires that you configure the foo-blah1 and foo-blah2 variables. The way to do that is

(eval-after-load "foo"
  '(progn
    (setq foo-blah1 "some string")
    (setq foo-blah2 "some other string")))

That way, the setting of the foo-blah1 and foo-blah2 variables is not executed until the package is actually loaded so you won’t get a void-variable error. This suggestion alone makes the post worth reading.

This is a short post so there’s no reason not to give it a look. You may get some ideas that hadn’t occurred to you before.

Posted in General | Tagged | 9 Comments

Traveling Salesmen, NP, NP Complete, and NP Hard

Ron Hilton over at Absolutely No Machete Juggling has an excellent post on the traveling salesman problem. Hilton explains that when people say the traveling salesman problem is NP Complete they are almost always wrong. Almost because there are two formulations of the problem but only one of them is NP Complete and it’s not the formulation that everyone associates with the problem.

You can follow the link for the details but what I found especially interesting in the post was his explanation of the meanings of NP, NP Complete, and NP Hard. It’s one of the best explanations that I’ve seen. The short summary is

NP A proposed solution can be verified in polynomial time
NP Hard The problem is as hard or harder than any NP problem
NP Complete The problem is both NP and NP hard

but be sure to read Hilton’s more complete explanation. He also has a nice Venn diagram that shows how the three properties relate to each other.

You often see problems described as NP or NP Complete so if you have any doubt as to what that means, spend a couple of minutes on this post. It will be worth your while.

Posted in General | Leave a comment

Advanced Dired Tips

Xah Lee has updated his Emacs Advanced dired Tips page. I thought I knew all this stuff but Lee has some tips I wasn’t aware of. For example, you can configure what dired does when you try to copy or delete a directory. You can have it ask once for the top directory, ask for every directory and subdirectory, or not allow it at all.

At the bottom of the page he has a pointer to his Using Emacs’s “Dired+” (DiredPlus) Mode page. Almost every time I blog about a dired feature someone will comment that the feature doesn’t work for them. That’s because I use dired+. I’ve been using dired+ for so long I always forget that I’m running it instead of plain dired. Everyone should be using it. There’s no reason not to and it’s easy to install with ELPA. There’s virtually no configuration either. Here’s what I have in my init.el:

(require 'dired+)
(put 'dired-find-alternate-file 'disabled nil)  ;enable `a' command

The put command enables the 【a】 command that replaces the current dired buffer rather than opening an additional buffer when you move to another directory. If you don’t include that, Emacs will ask you if you want to enable it when you try to use it so it’s not necessary to include it.

Take a look at Lee’s Advanced dired page and for goodness sake install dired+ if you haven’t already.

Posted in General | Tagged | Leave a comment