This blog has moved!

So, I’ve decided to do my own website, and am moving Buhjillions there.  Please update your bookmarks/RSS readers:  http://buhjillions.spikecurtis.com

Thanks for reading!
-Spike

Apple-Microsoft Advertising Détente

Microsoft and Apple seem to be willing to give implicit nods to one another’s products in their advertising.

Apple’s MobileMe service, whose launch coincided with the iPhone 3G, billed itself on the Apple website as “Exchange for the rest of us,” referring to Microsoft’s Exchange Server.  It seems to have recently cleansed its marketing copy of such phrases.

As pointed out on Boing Boing Gadgets, the homepage for Microsoft Office currently contains a picture of a nice shiny Mac notebook runnining Office.

Just a weird pair of weird marketing choices coming around the same time coincidentially, or is this the beginning of an Apple-Microsoft détente?

A programmer’s first language is?

My good friend and collaborator, Shawn Cornally, recently asked for my opinion on what language to use to teach programming.  He teaches science & math at Solon High School in eastern Iowa.

I’ll preface these comments by saying that choice of language is probably not as important as other things, like competence and enthusiasm of the instructor.  I started learning to program, on my own, in Apple BASIC, then QBASIC.  I can recommend neither of these, even though the B in BASIC stands for “beginner.”  Picking a poor first language is unlikely to either put off an enthusiastic student, or hinder their ability to learn better languages later.  Still, it’s worth thinking about, should you be thinking of learning to program, or are planning to teach it.

Java was the language chosen by my professor, Lynn Andrea Stein, for my first programming course at Olin, and I think it was a good one.  It has a consistent, powerful object model, and its structure encourages good practice.  And so, after a single term with Java, I was convinced.

But Java wasn’t the last language to wow me.  Several years later, a new professor (Allen Downey) arrived, and decided to teach programming in Python.  I didn’t take his course, but I did talk to him about it.  Python made a big splash across our close-knit group of engineers, and quickly became my favorite language to program in.  I’ll take the liberty to copy what he says in his course notes:

Why Python?

1) Python is a great first language

pleasant syntax

not too many exceptions

for many tasks, there is one (natural) solution, rather than an unnecessary choice

2) but it’s also powerful

can handle large programs

has lots of features and libraries

some friendly languages are limited to small, “toy” programs

By “pleasant” or “friendly” I think he means that Python syntax is often more intuitive (for English-speakers, anyway).  It’s often easier to figure out what a Python code-fragment does, even if you don’t know the language well.  This may not cause problems for professionals, who presumably do know the language well, but it’s an important consideration for beginners.  Consider the following blocks of code:

Python:

phrase = "I am Jack's Colon."
count = 0
for letter in phrase:
    if letter == "a":
        count = count + 1
print count

Java:

String phrase = "I am Jack's Colon.";
int count = 0;
for (Character letter : phrase.toCharArray() ) {
    if (letter == 'a') {
        count++;
    }
}
System.out.println(count);

The Python is just less cluttered with things which don’t have intuitive meaning (things like the “for ( : )” construction and “++,” and… you get the idea).  Don’t get me wrong, I think Java is a great language too, but Python is certainly friendlier.

(July 28th: Edited above code based on comments; thanks Christoph & tgdavis.  As other commenters have pointed out, there are more compact ways to accomplish this task in either language–but I’m just trying to explain what it means for syntax to be “friendly,” and so am trying to write an example that does the same thing in roughly the same way.)

There’s an intimidation factor involved, especially when teaching things that stretch students beyond what they know.  For beginners, convincing them that understanding programming is within their ability is important.  Programming is not difficult (at least, not at a beginner’s level), but our society is surprisingly tolerant, occasionally laudatory, of people who say things like “I can’t understand computers,” or “I’m not smart enough to do programming.”  That makes it really easy for students to give up on programming if they get too frustrated at the early stage.  I’m not saying that we need to make our courses easy—students are smart enough to see through that.  They don’t want to be spoon-fed or patronized, they want to feel comfortable… most of all capable with programming. It’s important that the path from “Hello World” to some kind of real power is as uncluttered as possible.  From that point, they’re hooked.  Or at least realize that they can’t get off the hook by claiming they’re not smart enough.

Shawn specifically asked me if I thought it was a good idea for him to teach in PHP, since wanted to teach them to build internet applications.  I think internet programming is really exciting, and a very relevant teaching ground for programming.   Doing interesting things with web pages is accessible to beginners, and lets them do things that they might find actually useful.  It’s not often that pedagogical and practical problems have as much overlap as they do in this sphere.

While I wholeheartedly endorse internet programming as a good place to do examples and assignments, I can’t really recommend PHP as a teaching language.  In the first place, I don’t think PHP enjoys any particular claim to fame as the language of choice for internet programming, and in the second I think Java and Python have strengths as general languages which make them better suited for elementary concepts and examples.  While PHP is used almost exclusively for internet programming, the reverse is definitely not true.  I’d venture to say that there will be plenty of opportunity for internet programming (especially at a beginner’s level) almost irregardless of the language chosen.

Unfortunately, PHP is comparatively less capable for more general programming tasks.  Java and Python code can be written and easily run on students own machines without the need for a webserver.  They also both have large built-in libraries of well-documented, consistently designed classes which make it easy to incorporate relatively sophisticated behaviours like graphics and network communications.  While there are plenty of PHP libraries out there, they are not all well-designed or well-documented.  Again, I don’t think PHP is a bad language–just not a good choice for teaching.

Some colleagues in my research group also point out that FORTRAN, for example, has intuitive syntax.  I can’t, however, recommend languages that are not object-oriented.  Object-oriented programming (OOP) is simply too important a paradigm in modern programming to not introduce it from the start.  It encourages good programming practice as well as scoping and modularization—all of which are fundamental concepts to writing elegant and maintainable software.

Allen Downey, the professor from Olin, has written and released textbooks for introductory programming in Java and Python.  They are free, released under GNU Free Documentation License, so you can download PDFs of the books to distribute, or print your own copy.  The Python one (Think Python) is also being published by Cambridge University Press, should you desire a hardcovers.  The Java one was updated this year, and specifically addresses the AP syllabus.

PayPal drops fees for personal payments (UK)

PayPal just sent me an email saying that starting July 9th, they’ll stop charging for “Personal Payments” if they are funded from a bank account (i.e. not a credit/debit card).  I’m guessing this is an attempt to cut into the market share that online banking gets for making these types of payments.  It may also be a direct response to the move by banks to make these transfers instant (see post on card readers).

I have to admit, it’s pretty attractive.  No more messy exchange of bank details, just the email address of your recipient is all that’s needed.  However, I imagine that it will take somewhat longer than the new “instant” transfers offered by banks.  I wonder if I can move money overseas this way?  Also, what’s the difference between “personal” and “commercial” payments?  Is there anything to stop ebayers from getting their cash monies as personal payments and avoiding paying fees to PayPal entirely?

Businesses engage in internet skirmish

Criminal elements like scammers, spammers, and botnet overlords using internet-based attacks are nothing new.  Things got interesting last year, when an army of computers (which appeared to be controlled from Moscow) launched an attack against the government of Estonia, crippling their servers and forcing a shut down of international network access.  It was the first incident on my radar where a national government was the target of a computer attack.  Then, earlier this year, the US Air Force announced the formation of their Cyber Command, an attempt to build up our military’s capability to deal with internet- and computer-based threats, both defensively and offensively.

So criminals and national governments are putting together their attack armies to wage war on the internet.  What’s new to me, however, is that some private companies are doing the same.  Revision3, an internet television company, claimed that they were attacked over Memorial Day weekend by MediaDefender, a company that disrupts P2P networks in an attempt to discourage the spread of copyrighted works.

For years people have expected this day to come: real-life battles happening in cyberspace; and the internet is comparatively less safe than the places most (first-world) people are used to doing business.  It will be an interesting evolution over the next few years to see how we as a society deal with this new frontier.  The US military is justifyably concerned that foreign or domestic elements could use the internet to do serious harm to the US and our interests, but I’m now becomming aware that it isn’t just governments that need to be concerned.  This incident will be an interesting test case to see if our laws and law enforcement agencies are strong enough to extend an arm of protection to legitimate businesses operating in American jurisdictions.

My first look at extending Enso (with Skype!)

I decided to take a stab at writing my own commands for Enso, the command interface by Humanized Inc. I really can’t say enough about how much I like this bit of software: it’s simple, elegant, and free.

Humanized released a “Developer Prototype” some time ago, and I’ve only just gotten off my lazy-ass to have a go with it. I decided that a handy, but relatively unambitious command to add to Enso’s growing list would be to use Skype to place a call. Simple idea, really — if I enter “skype home,” into Enso it should be able to find the Skype contact called “home” and place the call. For some added flair, it could also work by highlighting a phone number or Skype contact name and issuing the command without the second argument. (See the Enso explanation videos if this bit doesn’t make sense).

Enso extensions work by implementing an XML Remote Procedure Call (XML-RPC) service—basically a standard way of allowing software to interact without the programmer having to work out the gory details. This means, among other things, that Enso extensions can be written in any language that has an XML-RPC implementation. Naturally, being a Python junkie, this is my lingua of choice. How lucky that Humanized’s example code is written in Python! Even better, is the fact that some kind soul has already written a Python interface to Skype, called Skype4Py. It doesn’t get much better than this, folks.

In about 2 hours of poking (including distractions like trying out Adobe’s new Photoshop Express service), I’ve got Enso and the Skype API acknowledging one another’s existence (in the form of Enso reporting what Skype thinks my name is).

Skypesays

Hopefully tomorrow I’ll have a go at implementing a rudimentary call command.

Intel bares its silicon in ads

intelad.jpg

I’ve noticed that Intel has been putting images of the bare dies (dice?) in their advertising campaign. Above is an image I screen-grabbed from an article on NYTimes.com. The pink-blue-orange photo of a Core2 processor before it gets packaged up into an installable chip is actually quite beautiful. Of course, this resolution doesn’t really do it justice: see for example this press-kit photo: cnrmrm-die.jpg (sans crazy-electric color scheme). I wonder if this is indicative of a wider change in people’s perception of computer equipment, i.e. that a chunk of silicon can be sexy, or if it’s simply an appeal to a specific subset of internet-types who get all excited about MIPS and such. Intel has a history of advertising on TV—anyone seen their ads recently? Do they show any naked silicon? I’d take a TV ad as a much wider appeal to the public’s senses than the Times. I’d like to think that people aren’t as intimidated by computers these days as they once were, and the idea of seeing their innards has become more of a turn-on than a turn-off.

iRex iLiad: I wants it.

Ars Technica has a review up of the iRex iLiad ebook reader. The Amazon Kindle got fairly positive reviews from the likes of David Pogue of the NY Times, and the Ars review is pretty positive on this one as well. Has the time finally come for ebooks?

For one thing, the technology has finally stood a fighting chance with what it’s up against: real books. This was the much decried problem with ebooks from bygone days–it was just too damn uncomfortable to read any significant amount of text. The resolution was too low, as was the contrast ratio. There was the glare and the problem of short battery life. The now-famous (in some circles, anyway) eInk technology has now come down in price and performance to put in a handheld. They ain’t cheap, but within the reach of early adopters and people with lots of disposable income.

The inexcusable flaw in the Amazon Kindle, as far as I’m concerned, is the inability to display documents without some crazy-ass conversion process on their end. As far as I understand, you can’t get it to display ordinary PDF files.

As a scientist, I download and read journal articles pretty often. They come in PDF and I print them off to read them. That’s one of the reasons why the iLiad is so exciting–I wish I had £449 to drop on one, but I don’t. It will display “anything you can print from your PC.” So all my papers, as well as documents I’m working on, could go with me in one tiny package. Bonus is the fact that it has an integrated Wacom drawing tablet, which lets you mark up documents just like real paper (well, almost: you’re limited to black ink). If only I could get digital copies of Horowitz & Hill’s The Art of Electronics and Sakurai’s Modern Quantum Mechanics I’d be all set.

I’m hopeful that other electronics manufacturers take notice and drive the price of these babies down so I can pick one up in a year or two.

iRex Website

Enso is free! Stop dawdling and download it.

Further to my previous post about Humanized Enso, I’ll pass on the word that Humanized have decided to make Enso free.  That was nice of them!  Now stop reading this and give it a try.