Posts tagged ‘programming’


Next weekend there is a Ruby on Rails Outreach for Women I overlooked it at first, figuring they would want women teachers as well. Last week the organizer corrected me by making the request for help to an all-male room. As much as I feel like I spend all my time doing volunteer work, there are two reasons that this is interesting.

One: I’ve often felt uncommonly blessed to have quite by change stumbled my way into a technology and community going gangbusters. While I don’t know if I can say I’ve received job offers, I’ve had several job inquires. I’m turning away work – of course it may just be the Chicago Ruby vacuum I wonder if I should be giving back – although most of the time I think that I should get a steady income for myself before giving it away.

Two: I sometimes think I might enjoy teaching. Perhaps it’s my problem solving nature – you don’t know something, lets fix it. Perhaps it’s a socially acceptable form of showing off – if you’ve got a question, allow me to distill my experience into something clear, concise, and understandable at your place on the journey.

And yes, there probably is a three; I won’t meet someone if I don’t meet anyone. Invariably somebody will take that the wrong way, and surely if I wasn’t sworn to brutal honesty one might say it was better left unsaid. The problem is: it’s there whether you say it or not, and few people would miss the elephant in the room. The only ‘active’ thing I’ll be doing is slightly tilting the balance in favor of showing up and helping out. From there, we’re all just people.

Complication is, there is a martial arts seminar the same day as the main event. Given the particular circumstances, there is likely to be a great deal of inconvenience if I’m not there. Thus, the great conflict. I’d probably enjoy teaching technology a lot more, but I can also see the harm done if I can’t help out at the seminar.

Of course the short notice aggravates planning. The best I’ve been able to make of it is to show up for the installation Friday night, and perhaps see about next time – the outreach group already has a big enough waiting list for another workshop.

Update: I forgot the fourth reason: because it’s harder.

It is the engine that drives itself
But it chooses the uphill climb

Rush, Cut to the Chase

Back to the Future

A few weeks go I went to Toronto for FutureRuby (whose website seems to have died with the event) I wasn’t in any hurry to leave, hoping to avoid rush hour going around the lake. I checked the chicago traffic site, however, and found that there little variation in travel times, and in fact it tended to increase throughout the day, rather than showing a rush hour spike.

Once I finally did get going, I realized several hours in that I had forgotten my shoes. I was wearing sandals, and since the shoes are normally in the entryway, I overlooked them while packing.

I figured I’d take the trip in two strides. I thought I actually made it to Flint in time to look at the art museum, but I forgot to account for the time change. So I headed off to a couple of parks, including stepping stone falls, a great monument of concrete and algae.

For a change of pace, I stayed the night at a bed and breakfast outside Flint. Fairly nice place; housing for a large family turned to new uses, but very quiet during the week. One good idea was the outdoor play area for children.

The Canadian boarder guard seemed very wary, but she let me through with any trouble. The people at the BNB had assuaged my fears about currency conversion; there is a currency exchange just on the other side of the gate (almost too close, really) The dollar coins worked out fairly well; it’s a shame the US gave up too early it’s on dollar – these kinds of shifts take time for the novelty to wear off.

Toronto is a nice place, although if the hotel is any judge I don’t know if it’s affordable. Toronto is a city of neighborhoods. I could walk from the main shopping strip, through chinatown, to eclectic areas proclaiming organic food. It’s probably a good thing it’s so walkable. The FutureRuby kit included a weekend transit pass, which I promptly lost. As best I can figure, it fell out of my pocket while getting dinner Friday night.

I started following the #futureruby tag on Twitter for breaking news. It looked kind of interesting when people were discussing the restaurant recommendations. It looked kind of scary when the conference started and the floodgates opened.

There were some excellent and varied talks, though of course I didn’t have to go to Canada for the straight up talks – they are already starting to appear on InfoQ. I went to try and pick up some programmer society, which is of course is a struggle. I was fairly lost during the parties, though I did manage some conversations, and met Collin Miller, a fellow dreamer looking beyond text editors. One thing I’ve run across during this is that I don’t have a good name for textless programming. Structural editing is the best I’ve come up with.

Coming back across the border, I got in a slow line and figured “great, I’ve got a tough one” but I got passed through pretty quickly. I guess I don’t look too suspicious.

I figured I’d keep going until I got tired; I was getting a little weary at one point, but after stopping for dinner, I was good to go the rest of the way home.

The local ChicagoRuby group had a meeting the following weekend, and had put out a call for lightning talks. I thought that an overview of FutureRuby would be topical, and a lightning (short) talk would be a manageable way ease into presentations. I didn’t really consider how hard it would be to compress even my meager notes into ten minutes, however. All and all it went pretty well, although it took a day of writing, editing, and practice runs to compress it down.

Shortly after finishing that out, I moved my bookmarks from MyHq to Delicious (a long planned project) so that I could make all the FutureRuby links more accessible.

Billing and paying the bills.

I’m just a little conflicted about money. Perhaps a sheltered life has left me without clear guidance. I’ve always had ‘enough’, and often more. Less since I started working four days a week; still enough that I can set aside some savings, but little enough that the eventual demise of my car threatens that savings. Meanwhile, other people, many of them surely more dedicated and hard working then myself, starve or struggle to get to a place of equal safety and comfort.

There was a particular incident that triggered this latest reflection. Recently one of my fellows in the martial arts school asked what I would charge to upgrade her reality shows web site, and I wasn’t comfortable naming a price.

Some of it I’m sure stems from a weak self confidence. I’ve heard a number of high consulting rates thrown around. At work we price engineering projects based on $75 per hour, although we don’t then track hours. That’s pretty low compared to others I’ve heard. Even on the condo board, we can’t get much of anything done for less than $40-50 per hour.

All rather more than minimum wage. Is the difference skilled versus unskilled labor? The woman who cuts my hair charges rather less than $50. She told me a while ago about the tough parts of beauty school – cataloging individual muscles, sufficient grounding in chemistry to avoid nasty or even dangerous combinations of chemicals, and enough knowledge of ethnic backgrounds to predict how hair and so on is likely to respond to various treatments. Perhaps the price is set by the typically brief male haircut and widespread competition.

The different cases don’t offer much guidance. Even skilled gets called into question – while I have a long history taming troublesome pieces of software, I had no experience with the Xoops package in question. At an hourly rate, figuring out the thing would undoubtedly be a expensive process, but I don’t feel comfortable changing people for my own incompetence.

In the end I picked a rate closer to the landscapers, but capped the bill at four hours, which seemed more than adequate for someone who knew what they were doing. I spent rather quite a bit more than that setting up a test environment and getting a handle on things. I actually came to the conclusion that the originally requested version upgrade was completely orthogonal to the features she was hoping to achieve with it. We set up only those changes, and now it’s back to ambiguity: if she chooses to upgrade for future proofing, technically I haven’t finished was I was asked to do, but I have spent considerably more time than originally allotted. I also found out during the course of the work that my bill was considerably more than the trickle of ad income the site generates.

Of course it’s complicated further by knowing the person. I’ve passed over requests for web site help from less familiar people before. When it comes to a closer associate, there is question hanging out there of whether it should even be a favor. A lot of things in the world run by volunteer effort alone, and a world without community driven organizations might very well be worse off. One of the reasons that I often feel rushed is because I’m involved in a couple of volunteer organizations.

Condo board members may not be paid by law. Yet someone has to watch over the common interests of the association, and volunteers are perhaps predictably scarce. If it’s not me, then it might be no one, leaving things undone.

Then there is martial arts, where I spend one or two nights a week in unpaid instruction. The martial arts is immersed in a tradition of mutual obligations – as you were taught, so teach. But it’s still out there when I start counting up where my time went. I’ve actually been pulling back lately. I cut out one class, and I’ve been going to the board game design group again, which intersects one night every other week.

I confront valuation again in software. My lifetime earnings from personal software projects is $5. Not a single solitary soul has seen fit to make use of the Disk Clock donate button. I’m considering marking the next version shareware, while still avoiding nagware.

Software is a nasty problem. A program has a duplication cost which rapidly approaches zero. Copying is free and easy, unless extra non-feature-related effort is spent to put artificial restrictions in place. Even then, what software does software can undo, and we have the DRM arms race – more and more effort being poured into making thing harder for the customer, instead of adding value for the customer.

The costs of software aren’t in duplication, they are development. The only way to match price with cost is pay for the developers time and attention. Yet the only thing most people will buy is a proven working program, which we only know how to sell through the old physical-item model. The only reason this works at all is the legal fiction of software licenses.

So I’m sitting in the frying pan of being paid for things I wouldn’t be doing left to my own devices, staring uncertainly out at the fire of scraping by through intentionally crippled software.

I had a thought experiment, which I’m not bold enough to put practice. For a period, such a year, neither give anything for free, or take anything without paying for it.

People are Impure

Which is a very bad title. This is something of an essay about viewing people through the lenses of programming langauge concepts; I make no comment on any other interpretation ;^)

There is a programming langauge paradigm called ‘functional’. Some functional langauges include ML, Haskell, and sometimes Lisp/Scheme. Functional languages often define themselves in terms of the lambda calculus, which is a mathematical system based around The Allmighty Lambada; the abstraction of the process of punching a hole in an expression so you can plug different values in (i.e. apply or call the function)

One thing you can do with functional programs is talk about whether they are ‘pure’, which is to say, stateless. ‘State’, if it isn’t clear, is principlly evident in variable assignments; the closest pure functional programs come to assgnment is matching function parameters with actual arguments. Most programs/langauges are not pure; writing recursive fibinocci functions is cute and all, but most real world programs find it very difficutly to get by without state.

Not that people don’t try – academics will talk your ear off about all the nasty problems of state. Not that they are wrong, just that there aren’t a lot of terribly attractive alternatives most of the time. The poster child for pure functional languages is Haskell; I’ll have to write about the hoops they jump through to do things like I/O and call it pure, but I’m on enough of a tangent just now. Haskell is also ‘lazy’ (technically, ‘normal order’), meaning that a value is only computed if it is actually needed, which like everything else can be either really good (you may never need to calculate it) or really bad (un-evaluated computations fill up your memory) depending on the program and data structure.

Anyway, pure functions can in principal be memoized (I know I’m spelling that wrong), better known as cached. If f(5) = 27, f(5) always equals 27, and you don’t need to do the computation again. Yes, this is much the same thing as GET under REST. But if you can’t guarantee that ‘f’ is a pure function, successive calls might return 28, 0, NaN, or ‘frog’ (if your language isn’t statically typed)

And people, you see, are most definately not pure. Having once asked a question or otherwise ascertained some other property, there is no guarantee that any later test will return the same value. Human interactions are, propertly speaking, completely uncacheable, and yet our entire society is built around the expection that certain values (big ones being marriage, employement, friendship, not shooting me in the head, etc.) will at least remain stable for sufficiently long periods of time for the larger structures to persevere.

Not only are people statefull, but human systems have a hard 100% uptime requirement for the life of the system – whereas one can often run a program repeatedly to try and isolate faults, there is no rewinding a person or even a conversation to try and figure out where it went wrong and make it right. Sure, most people are tolerant of interactive debugging and overwritting erroneous state, but there is a complete log – I think the greater risk involved has something to do with my reluctance to speak.

I talked some of this over with schwartzboy, who offered this anecdote:

stupid logging. Just for the record in case you ever need to know this? Wedding rings come with embedded SpouseLogger 7.5 and a microscopic RAID setup that has terabytes of free space.

Love the One You’re With

No, not quite the usual context. Perhaps ‘Love the place you’re at’ would be more appropriate.

There is certainly no denying that I am something of a homebody. After college I pretty much put down roots and stuck where I landed. And of course there are those small dissatisfactions with any situation. A fact, which would not, of course, change had I gone someplace else.

Still, when gazing at the greener grass, there a few basic options: move on, stay put and muddle along, or try to make the place the you are at more like the place you want to be. The first option always felt like abandoning the place to it’s doom, so I’ve usually muddled along while thinking I should be improving things.

One of the prices of working at a small company is that I don’t really have a mentor; the other people I work with are either younger and not single-class programmers, or have experience that lies less in the theoretical direction I tend to take. For the most part, we just muddle along doing only what needs to be done.

So, I’m attempting to make it better. Somewhere, I’ve read tha sucessfull companies spend about 10% of something (net? gross? not sure) on R&D. Now, we have no budget, but we have our time, and can take an hour or two a week trying to learn something new.

The current project, and in no small part the inspiration, are the freely-available video lecture series for The Structure and Interpretation of Computer Programs, related to the book of the same name (also available online)

I gather that this is based on the introductory computer science course at MIT many years ago. Supposedly the course was taught at HP at point, pehaps it was there? In any case, yes, it is based on Lisp. Given Lisp almost legendary status, I don’t know if this is really bad, just not as likely to be directly usefull. At lot of the concepts are showing up in lanaguages, so a lot can actually transfer.

Anyway. The course starts from first principles, and then procedures to cover almost every major concept in computer science – iterative, recursive, functional, objects, delcarative, state, streams, compilation, and more. Eah concept is introduced from a motivating example – here is why we have this construct – it solves this problem.

Hopefully repetition will do me some good – I watched the videos, read the book, and now I’m watching them again (and taking notes) about one hour a week.

One persistant theme is ‘metalinguistic abstraction’, or embedding other languages in Lisp. Today this is popularized as DSLs or Domain Specific Languages. The repetition may have infected me, because I’ve been thinking about languages a fair bit lately. But that is a whole ‘nother post, and the is at least one more to set that up.

Work Patterns: Get the continuation

Where the continuation is the next step; find out what it is at the beginning, when hopefully you still have access to whatever is giving you a task to begin with.

The term continuation comes from programming, typically functional programming, where the continuation is a procedure to call when the current function is done. Sometimes multiple continuations are passed, where which one gets executed depends on the calculations done. The really fun ones use ‘current continuation’, which makes a closure on the current stack and local variables and then runs it multiple times.

Music as Program

Something is bugging me. Playing music isn’t always fun. So like, what gives? I’m learning a new skill. Learning can be fun, and Raph Koster practically equates the two.

I recall when I was learning to program – typing in BASIC programs (usually games) from magazine listings and then tweaking them.

I realized what the difference is. In the programs, I could make some sense of them. It wasn’t too hard to pick out a statement that read a key, and figure out that x = X + 10 moved a character to the right. I could understand the program so i could change it.

I don’t understand music. It is utterly opaque to me. Since I don’t understand it, I have nothing to direct change; I can’t play around with it. I can’t engage in the process of creation, which I’ve picked out in the past as a key factor in my general mental health. (This entry might do me some good.)

I’ve read a few things. There is tonic, dominant, leading tones, etc. But I don’t see them. I’m sure experienced musicians can see things things. But I’m not experienced. Sheet music is as enlightening to me as (get this) binary machine code.

Yep yep yep. Music is a program, and musical notation amounts to reading a program in hex bytes. All well and good for the machine executing it – which is exactly what a musician is doing with a piece of sheet music. Since sheet music is made for people trying to ‘execute’ it, this works out well enough. It’s also clear as mud. The ability of experienced musicians to see the deeper structures in sheet music equates to ability of hardcore programmers to see the structure in a binary executable. Sure, it can be done, but it doesn’t strike me as especially effective.

Now to be fair, I did set out to learn how to play music, not compose it. I was hoping to pick up some understanding along the way, but my focus thus far has been on execution not understanding. Still, wheres my ‘C’? C++? Perhaps some Lisp, haskell, or ML and nice higher order programming? Something like BASIC wouldn’t be all bad to start out with. Even Assembly would be a step up at this point. I suspect that assembly, or putting mnemonic labels on the machine instructions, equates to identifying the roles (tonic, dominant) and intervals. You have a slightly better idea what is going on, but not really why.

There are still two problems. One, this amounts to disassembly – taking the raw machine code and reversing engineering the meaning. In programming this is always a lossy process* – even just going to assembly you lose labels, symbolic constants, comments, etc. Second, where are those higher level languages? We’re still at the register-transfer level here. Has my education, focusing on playing such as it has, merely been negligent, or is there really nothing out there?

*Edit – technically, it is assembly that is lossy. Disassembly loses no more information, and often adds to it by identifying slightly larger structures.