The Y-Combinator

Jim Weirich, of Neo gave a really nice talk on The Y-Combinator at RubyConf2012. Given the venue, the examples are, of course, in Ruby but you should have no difficulty following them: I know no Ruby at all but was able to understand the code easily. The harder part is following some of the ideas—especially the functional refactorings—that may be unfamiliar to you.

Not to worry, Weirich has a series of posts based on the talk that covers the same material so you can go over it at a slower pace after you watch the talk to fill in anything you missed. Currently only two of the three posts are up but they cover the background material that you need to understand the rest of the talk. The posts are very lucid and stand on their own well.

If you’ve ever wondered what the Y-Combinator is (other than an angel investor) and what it’s used for, this talk is an excellent introduction. Weirich is an engaging and entertaining speaker and the material is very interesting. Again, don’t be scared away by Ruby: the examples are easy to follow.

Posted in Programming | Tagged | 1 Comment

Why We Use IDEs

Wille Faler over at recursivity.com has a nice post on IDEs and why we need them. His take is that if you need an IDE it’s because of shortcomings in the language you’re using. He has in mind, of course, Java but it’s a good general principle. Languages like C, Lisp, Python, Ruby, etc. don’t need IDEs; they’re relatively simple and small and most of them have a REPL available that makes interactive development easy and rewarding. Even in C, which does not, of course, have a REPL, development is straightforward and any of the standard editors can easily integrate the compile/edit/debug cycle.

To be clear, neither Faler not I claim that using an IDE is bad; only that if you claim you need one to do your work then that’s an indication of problems with the language you’re using. There’s some interesting (and heated) discussion in the comments including the question of what, exactly, constitutes an IDE. Does Emacs with its language awareness and ability to send code directly to the REPL count? Faler says no. He clarifies that he was mostly thinking about IDEs like Eclipse and IntelliJ that are targeted at a single language and duplicate functionality that could reside in a REPL or build system.

If you’re interested in the question of what constitutes a good tool for development, you might find the post and comments interesting. I know I did.

Posted in Programming | Tagged | 1 Comment

Bashisms

Russell Power over at rjpower.org has a nice post on some Bash tricks. Despite over 20 years of Bash use I learned something new. It turns out that if you type【Ctrl+x Ctrl+e】Bash will bring up an editor session that allows you to edit the control line. The editor called is specified by FCEDIT if set, then EDITOR, and then defaults to Emacs. This will do the right thing for almost everybody. Almost everyone sets EDITOR and almost no one sets FCEDIT so【Ctrl+x Ctrl+e】 will do the right thing for most people.

This isn’t the type of thing you use everyday but if you have a complicated command line that fails and you want to change it a bit this is a nice way of doing it. All the powers of Emacs on your command line. What’s not to like? And don’t forget the other tips—also useful.

Posted in General | Tagged | 2 Comments

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