Anuragh KP0x55aa
Back to Blog
personaljavascriptbasic

I learned to program on a keypad phone

|
8 min read

My first programming language was BASIC, out of the Kerala IT textbook for classes 8 to 10.

Nobody taught it to me. We had an IT period on the timetable, and we had a computer lab with real computers in it. But the class happened maybe once or twice a month, and when it did happen, we learned GIMP and the other IT@School Ubuntu software. The programming chapters were skipped. In 8th standard there was no computer exam, so I suppose there was no reason to cover them. Maybe the teachers didn't know the material. Maybe they didn't think 8th standard students needed it. I never found out.

The book was still in my bag either way.

The first computer I ever saw

We did not have a computer at home. Not a slow one, not an old one — none. And it wasn't only us: nobody around us had one either. So there was no machine to practise on after school, and the textbook in my bag stayed theory.

I saw a computer for the first time in 5th standard.

My mother's cousin worked in Dubai, and his son was preparing for a networking certification — some Cisco course, I don't remember which one. They bought a PC for the house. A CRT monitor, a UPS, and a cabinet with both a floppy drive and a CD drive.

We were not allowed to touch it. The whole desk stayed covered when it wasn't in use. It had cost a lot of money and everyone treated it that way. I looked at it once and that was the visit.

By 6th standard someone had installed Road Rash on it. That changed the terms completely — suddenly there was a reason to let children near the machine. I started asking to visit during holidays, and I was not asking because of the family. Later they installed GTA Vice City.

I want to be accurate about this, because the honest version is more useful than the tidy one: I did not fall in love with computers because I wanted to build things. I fell in love with computers because of a game.

The wanting-to-build part came after, and it came sideways.

A lab, and nobody in it

My own school got interesting in 6th standard, when I learned what the parts were called. CPU, central processing unit. UPS, uninterruptible power supply. Nothing deep — just the names, the way you learn the names of tools before you learn what they do. That teacher let us use MS Paint. And Road Rash.

Then I changed schools in 8th standard, and the new one had a proper lab. Many computers, all working. I thought this was it.

It was one or two periods a month, and it was GIMP.

But the IT practical gave me something better than a class. Three students to one computer. And my two teammates had no interest in computers at all — they came to the lab to talk and to play games on paper. So for that period, the machine was mine.

That is where I started working through the textbook myself. Everything I had read, I typed in. It was the only computer time I had.

Then I reached the programming chapters and stopped. I had the syntax in front of me and no idea what to do with it. I didn't know how to run a program. I didn't really know what running a program meant.

The Nokia 2626

Around then my mother's cousin gave my father a Nokia 2626.

Keypad phone. No camera. No memory card. 2MB of storage. But it had a browser, and it supported J2ME, and I did not understand yet how much that second thing mattered.

I started with folders. Then I tried to get the internet working, and nobody could tell me how. My father's connection was BSNL, and BSNL's own customer care did not know the settings for that model. I called them several times. Each call gave me one more piece, and eventually I understood the shape of what I was configuring well enough to finish it myself.

I paid for the data out of the top-up balance, because I had no other money. I burned through all of it in a day.

My father beat me for that. Fair enough — it was his balance. I was still happy, because by then I had seen a Google search page, and that was the first time I understood what the thing in my hand actually was.

Learning what a .jar is, the slow way

My first instinct was to download the software I already knew about. I tried to download GIMP onto the phone.

It failed on size, obviously, and it would have failed on everything else too. But I had no model yet of what kind of thing could run where. Software was software.

Working out why it failed taught me more than the download would have. I learned that the phone needed J2ME applications — .jar files — and that a program built for a PC was simply not the same category of object. That distinction seems trivial now. It was not trivial then, and I got to it by being wrong first.

After that I installed Opera, which gave me a better browser than the built-in one, and google.com became usable.

I also downloaded a Malayalam song. With 2MB total I couldn't fit a full track, so I found a cut version and set it as the ringtone.

This turned out to be the most socially significant thing I did that year. Everyone around me believed a phone needed a camera and a memory card to have a song as its ringtone. Mine had neither. After that, every phone problem in the area came to me first — which meant I got my hands on most of the phones in the area, which was the actual prize.

No BASIC compiler

Eventually I went looking for a way to run the BASIC from the textbook, and I could not find a compiler I could use. Not for the PC I barely had access to, and certainly not for the phone.

What I found instead was that BASIC was not the only language. There were many. That was genuinely new information to me.

So the question changed from how do I run this to what can I actually run on the machine I have. And the machine I had was a keypad phone.

The answer was HTML and JavaScript.

I installed a J2ME text editor and wrote an HTML file. The phone's browser opened it, and the JavaScript did nothing at all. I had no idea why.

The school library had a JavaScript book, which is where I learned there were two scripting languages used in browsers: VBScript, which only worked in Internet Explorer and therefore did not exist for me, and JavaScript, which did.

So JavaScript it was — chosen entirely by elimination.

I got a button to respond to a click and show an alert. On a keypad phone, typing angle brackets with a numeric keypad, on a screen a few centimetres across.

I have shipped things since that mattered more. I don't think anything has felt better.

Two languages, one idea

The part I'm still glad about is what happened next.

I had BASIC in the textbook and JavaScript on the phone, and I started matching them up. A variable in BASIC was a variable in JavaScript. An IF was an if. GOTO was the one that didn't carry over cleanly, which is its own kind of lesson, though I couldn't have said why at the time.

I read the concepts on the phone in the evening. When I got lab access, I tested the BASIC against what I thought I had understood.

I didn't plan that as a study method. It was just the only arrangement available. But learning the same idea twice, in two syntaxes, on two machines, with a gap in between — that is a much better way to learn what a variable is than seeing it once.

Everything I wrote was small. Change a button's colour. Change an element when something is clicked. Nothing that did anything for anyone.

Every single one felt enormous.

That feeling is still the reason I do this. It hasn't changed at all — the programs got bigger and the machines stopped being borrowed, but the specific small click of I made the thing do what I wanted is exactly the same as it was on that Nokia.

Share:LinkedInXHacker News

Related reading

Thanks for reading!

Back to all posts