Sunday, July 31

That brain of mine is something more than merely mortal; as time will show; (if only my breathing & some other et-ceteras do not make too rapid a progress towards instead of from mortality).

Before ten years are over, the Devil’s in it if I have not sucked out some of the life-blood from the mysteries of this universe, in a way that no purely mortal lips or brains could do.

No one knows what almost awful energy & power lie yet undeveloped in that wiry little system of mine. I say awful, because you may imagine what it might be under certain circumstances….

I am doggedly attacking & sifting to the very bottom, all the ways of deducing the Bernoulli Numbers….I am grappling with this subject, & connecting it with others.

Ada Lovelace, writing to Charles Babbage, as she struggled to develop the world’s first computer program.
Thursday, November 5

Sinatra

(No, not this guy)

[ edit: oops, I linked to Brando ;) ]

Sinatra is really, really cool for anyone with the slightest interest in writing web apps, especially if, like me, you feel comfortable with HTML and CSS but not scripting languages and frameworks like Ruby On Rails or Django.

Consider that:

first, Sinatra apps are written in Ruby, and Ruby has the good fortune to have an amazing beginner’s guide. I’ve said so before: it’s something you’ll actually read through in one sitting (unlike so many other lifeless programming books). And it’s free.

second, this is Sinatra’s “Hello World” app:

require 'rubygems'
require 'sinatra'
get '/hi' do
  "Hello World!"
end

that’s it, once you have Sinatra installed, no other files to deal with. This changes with complexity, of course, but it’s a great way to start.

third, deploying on Heroku, which is nearly painless and yes free. here’s how your code goes online:

sudo gem install heroku
heroku create appname
git push heroku head
heroku open

of course requires git (which is itself painless).

The point for me is that it’s unbelievably simple and cheap to get an app online. Going through the sequence above I had chopped up and running in a day — that includes learning the requisite Ruby and Sinatra. (I did cheat and buy this $9 screencast from Peepcode. I think it’s well worth it, though; Dan Benjamin is an excellent teacher.)

Wednesday, October 21

  It must be something difficult, even for a great scientist, to carry away the corpse of a young girl whose dress is still starched and embroidered, but whose mouth is darkly clotted purple at the corners. In Dr. Cham’s journal, he writes that he was tormented by her ghost, which glistened gold and scorched lace. His delusions grew and he ran from hellhounds and massive vengeful, angelic hands.
  
  Only weeks later, he was gone, propelled from these regrets, vanishing in the explosion that lifted him from the planet.
  
  And even as you are reading this now, sometime in these moments, the bell jar craft of our lone Dr. Cham touched down upon a distant planet after a sixty year burn. As the new world came into view, as the curvature of the planet widened, as the bell jar whisked through the upset heavens, tearing through sheets of aurora and solar wind, Dr. Cham’s eyes were shaken open.


From Why’s (Poignant) Guide to Ruby: this section is about scope (could you guess?)

It must be something difficult, even for a great scientist, to carry away the corpse of a young girl whose dress is still starched and embroidered, but whose mouth is darkly clotted purple at the corners. In Dr. Cham’s journal, he writes that he was tormented by her ghost, which glistened gold and scorched lace. His delusions grew and he ran from hellhounds and massive vengeful, angelic hands.

Only weeks later, he was gone, propelled from these regrets, vanishing in the explosion that lifted him from the planet.

And even as you are reading this now, sometime in these moments, the bell jar craft of our lone Dr. Cham touched down upon a distant planet after a sixty year burn. As the new world came into view, as the curvature of the planet widened, as the bell jar whisked through the upset heavens, tearing through sheets of aurora and solar wind, Dr. Cham’s eyes were shaken open.

From Why’s (Poignant) Guide to Ruby: this section is about scope (could you guess?)

Reading _why for an hour…

I’m already impressed, not because he’s funny or inventive or crazy or makes programming a non-boring subject — all true — but because his words are filled with energy, with his desire to teach in a wonderful way of making the world fascinating and new and potential, beautiful and intelligible, which is to say enitrely respectful of children, creativity, and developing and expanding the mind.

I recommend Why’s (Poignant) Guide to Ruby if you’re at all interested in programming or Ruby; also this video of a talk he gave on Hackety Hack, a tool he wrote for kids to code with.

Re the video: Hackety Hack looked fine, but I’d love to see a well-done modern version of HyperCard, maybe with Ruby as the scripting language.

Friday, July 31

Thoughts on Programming

(Take the following with a large dose of sea-salt. I am not actually a programmer (yet), which should become obvious.)

The little project I was working on earlier this summer is finally up on the App store [iTunes link]. (If you’d like a promo code just ask.)

It’s a very simple app, but developing it was rather involved, at least for a beginner such as myself. Not only are there big piles of APIs to learn and become familiar with, there’s a certain way of thinking you have to get comfortable with as a developer — not just to develop apps with, but to really understand and learn from what you’re doing.

Programming is more of a discipline than “memorizing a programming language” or such. It’s the way of approaching a problem that’s important. You think through every action that you want your app to execute programmatically, which means breaking up even what appear to be the simplest things into even simpler things, and so on, until you are actually representing doing something in the most logical and straightforward terms, namely numbers. (OK maybe not that simple with higher-level languages, but same idea.) This might seem obvious, but trust me, if you’ve never written code or taken a course in logic, it’s very unfamiliar and just plain non-intuitive at first. Our brains use so many shortcuts and heuristics to understand the world that we forget how complicated they are or how many assumptions they’re built upon.

The concept of a pointer is a case in point. In the code you deal with variables:

x = 12
y = 2

x and y are variables that refer to that number. Thus you can say

a = x + y

and a will equal 14. But let’s say I want to deal with something more involved than a number… perhaps a string of letters that reads "Hello!". You can’t really represent "Hello!" as a thing because "Hello!" is a collection of things, namely letters, so you instead have to point to this collection of things. (This is exactly that “breaking things up into their simplest parts” I referred to earlier.) Thus you need a pointer to "Hello!", called p. But p is not equal to "Hello!" in this sense, p merely contains information about where this collection "Hello!" can be found. p is really equal to an address in memory, which is just a number. If you don’t explicitly use p as a pointer, and say something like print p, you might be surprised by the number that pops out when you were expecting a string.

[N.B.: Pointers are notoriously hard to explain to the uninitiated, so if I failed miserably in making any sense, don’t be alarmed or write off programming as utterly silly and confusing. In fact some higher-level programming languages try to do away with pointers, but only in the sense that the language is using shorthand, just as our brains do, so the same problems come up and eventually even if you aren’t “required” to know about pointers you probably should. In any event, if you’re interested, buy a real programming book to learn about them.]

But pointers aren’t just some programming nonsense. We use pointers all the time in language, we just don’t realize it. Every name points to a thing. If I write, “heuristic” is an interesting word, I’m referring to the word “heuristic” (as indicated by quotes). It becomes especially important in politics, because when a word or phrase — say “health care” — becomes politicized, we very often confuse the pointer with the thing being pointed at. Often when one refers to “health care” it is less of a real thing that can be studied and understood and more a phrase that evokes all sorts of emotions and identities and political affiliations and whatnot.

I guess my point (sorry, using that particular sequence of letters a lot here) ultimately is that the logical underpinnings of programming are really interesting and definitely apply to “real life” stuff. The language and APIs or frameworks you are developing in are arbitrary and idiosyncratic, but again it’s because any programming language beyond assembly code is an abstraction of the fundamental logic — a shorthand for doing repetitive and oft-used tasks. So programming isn’t just “learning the language” but really learning a way of thinking which of course also applies to learning English or Spanish or French or Chinese because they all have different kinds of shorthand. If you’ve ever experienced how a native speaker of a different language than your own communicates, how differently they construct sentences and ideas to convey meaning, you’ll understand what I mean.

([Addendum] Of course, you then start to realize how your own language and though-processes might by arbitrary and idiosyncratic, something that you’ve learned and constructed unconsciously over time and which are probably biased towards your cultural/social/individual perception of the world, and you start to wonder how you could ever possibly know anything with such a language and way of thinking, and you get a little depressed. But then you realize you can still use this perfectly uncertain and ambiguous language to order a coffee at Starbucks, and the world is right again.)