100x100 Challenge

Posted by Jonathan Altman Wed, 28 Jan 2009 23:41:00 GMT

So I am going to set myself out a hopefully fun little challenge: 100 lines of code in 100 coding days. It’s my challenge (and if this catches on, my meme ;-)), so I get to define my groundrules. Of course, someone else who wants to quibble with these is free to come up with their own groundrules for their own challenge, publish them, and see how they do on their own ground rules. Point of this, however, isn’t to have a flame war on the ground rules. It’s to write code, have fun, and see where doing something this regimented leads.

Ground Rules

  • There will be 100 coding days. I am going to exclude certain days from the 100 day count like:
    • Any day I’m away skiing
    • Vacation by default, although if I feel like coding on a vacation day I reserve the right to make it a coding day
    • Operational crises at work, although hopefully those are going to be at a comparative minimum these days
    • Sick days, with the same caveat as vacation days
    • One weekend day a week, choice of which one each week
  • For each of the 100 coding days, either:
    • Write 100 lines of code
    • Remove 100 lines of code by refactoring
  • Lines of code are counted as any non-comment, non-blank code that has any alphanumeric symbol, constant, value, etc. Here are some things I will or wll not count as a line of code:
    • Do not count: comments
    • Do not count: blank lines (zero or more whitespace characters)
    • Do not count: closing lexical scope symbols like } in C/C++/Ruby etc
    • Count: closing HTML/XML tags. They have identifiers on them, so I’m counting them. And remember, these are my rules
  • Blog about each day’s experience: how many lines, what was accomplished, what issues were resolved or came up; any other thoughts about the day’s effort
  • Publish the code: put the code out there for people to see at some point when it gets done. I will probably use my github account

Why I Am Doing It

I have a whole pile of interesting hobby projects that have been sitting around, not getting very far. There is some tangential work application to some of them, but some of them are just brain stretchers: play with something new, learn it, figure out some paradigms and programming models.

I am tired of not forcing myself past roadblocks in these hobby projects and letting them just languish. So this is a way to force myself to work on finishing at least one of them up. It is also an experiment in writing things that are just good enough. By pushing to finish them, I am hoping I won’t get into bouts of perfectionism of making sure every single artifact in my code utilizes the cleanest, most elegant paradigm in the toolkit I’m working on, since a major part of the goal of this is intellectual mastery of the subject matter. Going back to refactor, I may clean things up and make them more elegant. But this may force me to get things done instead of polish them to perfection. If I want to clean something up, I’ll go back and do it after I’m done with a first cut.

What Am I Coding?

I have been playing with a Google App Engine application since right after their initial limited beta got expanded the first time and I got my invite. The app has been sitting stuck on a particular error for over 6 months now. So I am going to finish the application.

One goal with the app, besides learning Google App Engine, is to build myself a modern, ajax-y web application using new shiny toolkits on the server and browser. As of right now I am using Google App Engine on the back end, and YUI for the DHTML/Ajax stuff.

I may post more about the actual experiences with the toolkits as additional posts when there is a longer topic. DHTML toolkits is a very possible start. YUI is definitely an “accomodation” choice: there are reasons I’m using it here that are very specific to this project’s situation that I’d like to explore.

After Google App Engine?

Another goal is to play with “cloud”-type apps. That was the interest in Google App Engine when it came out. Given that, if I actually finish the Google App Engine app, some other things I’d like to attack would be to see what challenges I face trying to port the app to different platforms, for example:

  • Heroku, where I also have a beta account languishing
  • A different python framework like TurboGears2 or Django, running on my Joyent Accelerator and maybe even Amazon EC2
  • The Nitrogen Erlang framework, again hosted on my Joyent Accelerator or Amazon EC2 (or both!)

There has been lots of discussion about portability, vendor lock-in, OSGi stack-level mismatches between various cloud offerings. By taking a sample app that is small enough to be written reasonably easily, but has enough breadth of functionality to tickle enough parts of a modern AJAX web app, maybe I’ll provide some interesting data points about writing for the cloud.

Posted in ,  | Tags , ,  | 1 comment

Bruce Schneier on intelligent terrorism security

Posted by Jonathan Altman Thu, 04 Sep 2008 18:23:00 GMT

He’s said it before in many different ways, but I finally found a bunch of statements in a single posting of his that summarizes his what I think is very correct thinking about terrorism prevention:

The problem with building security around specific targets and tactics is that its only effective if we happen to guess the plot correctly. If we spend billions defending [target type A] and terrorists bomb [target type B] instead, we’ve wasted our money. If we focus on [event type X] and terrorists attack [event type Y], we’ve wasted our money.

[...]

The following three things are true about terrorism. One, the number of potential terrorist targets is infinite. Two, the odds of the terrorists going after any one target is zero. And three, the cost to the terrorist of switching targets is zero.

We need to defend against the broad threat of terrorism, not against specific movie plots. Security is most effective when it doesn’t require us to guess. We need to focus resources on intelligence and investigation: identifying terrorists, cutting off their funding and stopping them regardless of what their plans are. We need to focus resources on emergency response: lessening the impact of a terrorist attack, regardless of what it is. And we need to face the geopolitical consequences of our foreign policy.

In 2006, UK police arrested the liquid bombers not through diligent airport security, but through intelligence and investigation. It didn’t matter what the bombers’ target was. It didn’t matter what their tactic was. They would have been arrested regardless. That’s smart security. Now we confiscate liquids at airports, just in case another group happens to attack the exact same target in exactly the same way. That’s just illogical.

The problem is it’s much harder to make it look like you’re doing something so when the next attack comes you can say how much work you were doing protecting target type A and event type X, and the only way you could have prevented the attacks on target type B and event type Y would be more resources.

Posted in  | Tags , ,  | no comments

Switch (back)

Posted by Jonathan Altman Sun, 25 Nov 2007 19:20:00 GMT

Well, after 12 years I have switched (back) to Macs.

Switch (back)

My first computer was an original 128k Mac, one of the very first ones. My mouse actually had a 5-digit serial number, IIRC. I gave up in 1995 swearing I would never buy another Mac:

  • I bought a Powerbook Duo 210-possibly the worst Mac ever engineered- right when it came out, shortly before Steve Jobs cut the price in half, and then shortly after that discontinued it. And no, he didn’t give me any funny money to go spend in his stores after he did it
  • The various unixes, which is how I made my living at the time, all had reasonable PC-based implementations that were free and open source. Linux was viable, and FreeBSD 2.2 was a really nice, stable OS
  • The Mac just did not have interesting software that I wanted to play with, and I could run systems I could get paid to play with on x86 pc hardware
  • Oh yeah, did I mention the turd of a computer that the Powerbook Duo 210 was?

The Good

So why the switch back? It comes down to things Just Working. I’ve been using various Linux distros, most recently Ubuntu, at home for a while. I will continue to run Ubuntu on my home laptop. But for a computer for the rest of the family to use, and for certain things for me, the Mac is just easier:

  • It is just about as easy to manage software on the Mac as on Ubuntu. I am convinced that the debian apt system (or possibly similar like yum or rpms) are the way to go for maintaining systems. But Apple’s installation system has so far been very easy to work with to get things on here.
  • Most importantly, once software and drivers are installed, the hardware and software Just Works

As a quick example, I installed the iSync plugin for my Nokia N95. I then used the iMac’s bluetooth wizard to connect to the phone, it found it and paired properly (no extra credit, most things do these days), but then iSync popped up and within 10 minutes of starting I had downloaded the plugin, installed it, connected my phone, and synced my phone into iCal and the address book

*Unix-y goodness. I like being able to pop into a shell and do things, and having rsync and friends around is nice

The Bad

So everybody touts the awesome OSX GUI. But here’s the deal, much of it is still the best that 1983 has to offer.

  • The single menu bar at the top of the screen that switches as you change apps has got to go. I have had the computer running less than a day and I’ve already thought I’ve closed an app about 20 times only to remember that closing the last window…closes the last window. It is too hard to get into and out of apps
  • I’m not thrilled about the dock showing both open and available apps. I would prefer one list of open apps and another of apps I frequently use to click on. I know there is a visual indicator of what’s open or not, but my dock is cluttered because I am used to using a strip of icons for apps I start frequently

Overall

Overall, I am happy with the switch back, but I think I’m jaded enough not to become too much of an Apple fan boy. There are too many usability nits left in the OS from 20 years ago.

I’m using firefox and thunderbird for mail because at the base of it I want an OS to run my apps on top off, and I like that I have the same apps on Windows, linux, and OSX.

Finally, I am sure I have said something in here to anger Mac, Windows, and Linux/Debian/Ubuntu fans everywhere. Remember, this is my choice. I use all 3 OSes now every day (Windows at work, Ubuntu on my personal machine, and OSX on the family computer). I use what works for me out of each of them, and none of them does exactly what I want for every single thing. Linux->Debian->Ubuntu and OSX each have their strong points, and I like each for what they can do. But each has downsides too. Remember, this is all IMHO, with the emphasis on my and opinion. You are free to have yours, and have them not be the same as mine.

Posted in ,  | Tags , , , ,  | no comments