Time to Hello World and Time to Productivity

Mar
22
2007

The only things that can cause a bigger arguments among computer geeks than which programming language is "better" are religion, politics, their operating system and their choice in text editor.

Everyone's got their favorites and a litany of reasons why it's the best. Most of those lists are perfectly legitimate. There all kinds of reasons why programmers are drawn to or repulsed by different languages.

And, they often seem completely baffled by the uptake of "inferior" languages like PHP. Disciples from the churches of Scheme, Smalltalk and Lisp seem most prone to this particular cognitive dissonance. After all, there are all kinds of reasons that these more popular languages are just that: more popular.

One of the reasons that often gets overlooked is a metric I like to call "Time to Hello World". It's the amount of time it takes to get all of the tools set up, the "Hello, World." program written, compiled (whatever that means for the language) and executed.

This number is entirely overhead. And, the lower that number is, the more friendly the language is to newbies and the more likely it is to gain widespread adoption.

Of course, corporate pushing can scale the adoption beyond what it would be otherwise. For instance, both Java and C# can actually have a fairly high TTHW. The number of people I've talked to who spend *days* fighting Java classpaths, etc. is staggering. But, Sun and Microsoft manage to push people over that hump.

However, for purely open source stuff, compare the number of people who pick up Javascript (with next to zero TTHW) or PHP (pretty low TTHW) vs Java. Sure, Java is popular, but it's only used by people who consider themselves "programmers". Javascript and PHP are being picked up by a much more casual crowd.

There's also a second metric that's related and determines how long someone will stick with the programming language. That's the Time to Productivity. It's the interval from "Hello, World." until an actual personal problem can be solved with the language.

Even if you have a low TTHW, if the TTP is too high, the early rush of the quick, early success dissipates if you can't actually *do* anything with it.

The thing is, that if you look at those languages that seem to succeed in spite of their shortcomings, you'll probably find low numbers in both of these factors.

IBM Model M-style Keyboard Arrives: Tactile Feedback Returns

Mar
21
2007

One of the things that *does* have me smiling today is that my "new" old keyboard arrived yesterday. It's a Dell keyboard from 1998-1999 that, while it has a different mechanism, emulates the feel of the classic IBM Model M keyboard. That keyboard is pretty highly prized for its tactile feedback (definitive "click" on each keypress) and for its nigh invulnerability. I had one for a long time that disappeared somewhere along the way and I miss it more than one should miss a peripheral.

The originals were made of steel and heavy duty plastic. They were actually sturdy enough that they could have been used as a weapon should an unsuspecting geek need to defend themselves.

The site I ordered from specializes in these keyboards. Most of the *actual* Model M keyboards they have in stock are pretty spendy ($75-100). But, when I saw the Dell for $29 and the description mentioned the same feel in the keyboard, I took it as a sign and bought one.

I'm now clicking away loudly on this amazing keyboard. It's too bad that shipping weight took over as the primary design consideration on keyboards instead of the actual feel.

Of course, this thing is loud. So, yes, Ron, I'll be leaving this thing at home instead of bringing it in to bug you all day.

Hmm. If these had remained standard keyboards thoughout the 90's and into today, would we all have offices instead of cubicles to cut down on the clicking noise?

Having an "Off" Month, But Looking Up

Mar
21
2007

Lots of people talk about having an "off" day, where things just don't seem to be lining up. I'm just as prone to having them as anyone (as they're statistical coincidences), but I seem to have managed to get the cosmic slot machine to come up all lemons for the last several weeks.

In nearly every aspect of life, anomalies have piled up on this recent period. The surgery was an obvious one, but it's been followed up by things like the wrong insurance card being used at both the clinic and the hospital, causing a long stream of phone calls to get it straightened out. Then there's the letter from the IRS, with a less than polite request for $1200 to be sent in by April 11 for something from 2005. One of my incisions doesn't seem to want to heal. And we can't forget my fileserver going down in a blaze of glory.

When I was much younger, I used to ascribe these stretches to superstitious sources, and try to straighten things out, not by actually addressing the issues themselves, but other actions: reducing the "bad" things I thought I might have done to bring disaster on myself, etc. However, as I got oler, I realized that these kinds of stretches just come every so often, no matter what you do. You can't change that. You can only tough it out and work to remove the obstacles.

And, things like making sure you're getting the right amount of sleep (for me that actually means getting less than I "feel" like getting when I'm depressed), eating right, keeping your emotional balance in check, etc. do definitely help in dealing with stressful periods.

Fortunately, that looks like it might finally be getting me somewhere on most of the crap going on right now. I cleared out several of the problems yesterday and hope to get through a couple more today. I did a stint of meditation this morning that is leaving me refreshed and looking forward to the day. I started doing my own blend of meditation, which is half hypnosis.

I've always had difficulty with falling asleep while meditating if I close my eyes and distraction (of the conscious thought kind) with my eyes open. The last few times, I've been staring at the electric sheep screensaver on the big TV, which is abstract enough and interesting enough to get lost in, without actually having conscious thoughts. When I combine that with listening to a program of binaural beats generated by Gnaural, I'm able to relax, refresh and clear the cobwebs out pretty well.

I like this approach to meditation as it's less touchy-feely and still gets the brain in the state you're after for the benefits of meditation.

Not Just GET and POST. HTTP PUT and DELETE with Javascript

Mar
18
2007

I've been following quite a bit of discussion about RESTful development lately. My rising frustration with Wordpress and growing interest in publishing that's based on the Atom Publishing Protocol, have led me to watch quite a few different sources of activity on these platforms.

In several of those conversations over the last couple of weeks, I've heard someone complain about REST and using the complete HTTP verb command set. If you haven't read much on REST, you may not be that familiar with the HTTP verbs PUT and DELETE. They sit along the more familiar GET and POST as methods for working with the web.

Those 4 give you all of the elements of the normal "CRUD" operations of many apps: create, read, update and delete. The criticism I'm referring to is that most browsers and HTML don't exactly have complete setups for PUT and DELETE. On a basic level, that's true. You can't make your normal form "method" attribute just point to a DELETE or PUT and have it work out of the box.

However, that is NOT to say that the browsers don't support it at all. If you throw Javascript into the mix (and increasingly, people are willing to have Javascript support as a requirement of using their applications), you absolutely have the ability to use the rest (ha, ha) of the HTTP verbs.

Here's a minimal bit of code to demonstrate for Firefox. It works best if you install Firebug installed and watch what goes on in the Console. Just click the little green checkbox in he lower right after installing it.

Set this Javascript code in a static HTML document in a script tag in the head of the file:

var xmlhttp;

function test(){
execute('GET', 'http://uphp/testServer.php);
execute('POST', 'http://uphp/testServer.php');
execute('PUT', 'http://uphp/testServer.php');
execute('DELETE', 'http://uphp/testServer.php');
}

function execute($method,$url){
xmlhttp=new XMLHttpRequest();
xmlhttp.open($method,$url,true)
xmlhttp.send(null);

}

Adjust the URL's in the test() function to where you are going to put the testServer.php file (details in a bit).

Then put a quick button or link like this in the body of the HTML file:

<button onclick="test();">Test</button>

The test server is equally simple in PHP:

$method = $_SERVER['REQUEST_METHOD'];
switch($method) {
case "PUT":
print($method);
break;
case "GET":
print($method);
break;
case "DELETE":
print($method);
break;
case "POST":
print($method);
break;
}

Now, if you run the HTML file and hit your "test" button, you'll see all 4 types of HTTP requests go past in the console. If you expand each, you'll see that the server properly figured out which method was which.

In short, it's definitely possible to do a completely RESTful client in HTML/Javascript with about as much extra work as any other AJAX addition. There may be other reasons not to implement REST, but this particular crutch shouldn't be leaned on unless you want it knocked out from under you.

New Firewall Up and Running with Smoothwall

Mar
15
2007

My Linksys wireless router has gradually been causing more and more problems with my internet connection. Nearly every day it just craps out and won't make outbound connections. If I just power cycle it, it comes right back.

Because the Linksys isn't the only wireless router laying around and I've got 2 static IP addresses from Speakeasy, I've had a Netgear router on the other IP address. It provides a fallback for internet access. However, the printers, file servers, etc. aren't on that network, so it's always been just a temporary patch.

Rather that buy yet another wireless router, I decided to dig in the parts pile for an old machine and put together a more robust Linux firewall and use one of the existing routers as a wireless access point.

I'll admit there were other reasons motivating this as well. With our move toward hosting a foreign exchange students (and hopes to continue in future years), the ability to have a transparent logging proxy (even if it's off by default) is a useful tool. Also, while I use SSH forwarding heavily, I like the idea of having a real VPN setup as well.

Regardless, I had a 700Mhz Celeron with 128MB of RAM and a 20GB drive, which seemed a pretty good candidate. So, I picked up a new network card to add to the one that was already in it and burned a copy of the Smoothwall 2.0. I hooked the machine up to my KVM switch and ran through the install.

The first glitch (no such thing as a 100% smooth install of anything open source or commercial) came when the new network card wasn't recognized.

I spent about an hour looking for the best way to get it automatically recognized (somehow the machine wouldn't read the CD that came with the card, containing a Linux driver). After that, I just decided to give the Smoothwall 3.0 Alpha a shot to see if the driver was included there.

What do you know, it picked it up just fine. The rest of the install was quick. From there, I hooked the Netgear wireless up to the GREEN side of the Smoothwall box (the LAN side), shut the DHCP off, changed the IP address to 192.168.0.99 and rebooted everything involved. So far, everything works like a charm. The documentation covered all of the questions I had.

Now, I've just got to set up the port forwarding rules and static routing to match a decent structure. The DHCP is set for the 100+ portion of the IP range and I'm thinking I'd like to segment it so all of the real machines run from 2-25 (plan for a ridiculous number to be safe), with 26-98 for virtual machines. Most of this has been pretty much done flying by the seat of my pants so far, so this is a good chance to set it up right this time.

Overall, I'm really pleased with this project. It only took a couple of hours (and I was juggling other stuff at the same time), only cost me $6 for the network card and has WAY more functionality. Definitely give Smoothwall a look if you've been considering something similar.

« Older Entries   Newer Entries »

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Latest Microposts

Follow Microposts on Twitter | Subscribe to Microposts

My Attendance At the Gym

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.