pmuellr is Patrick Mueller

other pmuellr thangs: home page, twitter, flickr, github

Friday, November 14, 2008

javascript service frameworks

In my "brainwashed" post, I managed to get a diss in for Yahoo!'s BrowserPlus™, calling it a band-aid. However, I carefully, pro-actively covered my arse with an earlier Twitter message "Y! BrowserPlus™ looks interesting; maybe the service framework moreso than the function provided".

The existing services provided by BrowserPlus™ seem like eye-candy. Not sure I really need an IRC client in my web apps, nor text to speech. And I'm worried about the kill switch. Mainly because the implication is that I'm somehow always tethered in an uncacheable way to Yahoo!. shiver

But I do like the service framework stuff. At this point, don't really care how useful it is, glad to see people playing in the space. Why?

The level of functionality we have today, provided by the browsers, for components/modularity of javascript code is <script src="">. Basically, all the power, flexibility, and functionality of the C preprocessor's #include statement (good and bad). But I'm looking at my calendar to see what year this is again. Doh!

The big JavaScript frameworks build their component stories on top of this, and the whole thing just gives me the willies looking at it. While I often wonder if JavaScript actually needs real structuring capabilities in the language, like a class statement, et al., I'm happy to try living without it, and try playing with some other mechanisms.

Java likewise has a crap component/modularity capabilities out of the box. Jar files and class loaders. OSGi plugs that hole. JavaScript likewise needs it's hole filled (that link is sfw, I swear).

So let's start experimenting! Go, go Yahoo! BrowserPlus™!

Could we do this with Google Gears WorkerPools?

In my "fun with WorkerPools" blog post from a while back, I wondered about building a service framework on top of the WorkerPool bits from Google Gears. Seems like building something similar to what BrowserPlus™ provides is pretty do-able.

The great thing about the WorkerPool stuff is that it brings another dimension to the JavaScript story - separate environments / contexts / spaces. The ability to have a bunch of code running, separated into protected object spaces, with very explicit communication channels open between these spaces. The best you can do with <script src=""> is namespacing via fixed name objects. Ugly and unsafe. I assume BrowserPlus™ is doing the multi-context thing as well, but I haven't looked close enough.

The other neat thing about Google Gears is that something like it has leaked into the WHATWG work, via a draft recommendation called Web Workers. Meaning we may be able to do this in a browser-independent way sometime around 2022. Or, our Chrome Overlords will render it moot, since Chrome already ships Google Gears. Or all the browsers will start shipping Gears. Whatever. Workers FTW!

So let's start experimenting! Go, go Google Gears WorkerPool-based service frameworks!

Thursday, November 13, 2008

hiking in the triangle

I've been doing a fair amount of hiking around the area lately, for some reason. Since it seems like there are a lot of folk unfamiliar with the fantastic parks available in the triangle area, and North Carolina in general, thought I'd dump some information here.

Local Hikes

For the hikes listed below, you won't need any special equipment to take a hike. Outdoors-y clothes, something you'll be comfortable walking in for a couple of miles (you're hiking!). And sweating in. Some kind of tennis shoes /sneakers. Bug spray if it's a buggy season. Sunscreen. A hat? And a bottle of water. You'll be outside, walking around for an hour or two; use your head.

  • Hemlock Bluffs Nature Preserve

    This park is maintained by the Town of Cary, and is a little bit of forest in the southern end of the city, right off of Kildaire Farm Road. Just a couple of short paths through the woods, along side Swift Creek, with some unexpected bluffs to overlook. I don't think any of the individual trails in the park are more than two miles.

    The Stevens Nature Center is co-located here which has some information on the park available in one of the buildings at the park entrance. They also hold occasional classes on various topics, through the Town of Cary.

  • Swift Creek bluffs

    A small park maintained by the Triangle Land Conservancy, off Holly Springs Road, between Cary Parkway and Penney Road. Admit it, you had no idea there was a park in that swampy-looking land, did you?

  • William B. Umstead State Park

    Oddly enough, I haven't been there in years. It's odd, because I drive by this park every day I drive to work; it's directly to the south of the airport, filling the area between I-40 on the west, and US-70 on the east. Joe Miller (see below) frequently writes about hiking, running, and biking in the park. Sounds great, and I feel like an idiot for not having visited in so long.

  • Raven Rock State Park [pix] [pix]

    This is one of the family favorites. The main attraction is Raven Rock itself, which is a rocky outcrop on the banks of the Cape Fear river. Fairly simple hike to the river, then a set of stair steps down to the river. Lots of rocks to climb on, for the kids. The Raven Rock Loop Trail is 2.6 miles.

  • Occoneechee Mountain State Natural Area [pix]

    A small park in Hillsborough, bordering the Eno River. While you can't get to the summit itself, you can walk up to the second highest point, and around an old abandoned quarry with some resultant man-made cliffs. You can both look out over the cliffs, from above, then walk down to the Eno River and get a view from below. The eastern section of the Loop Trail is about two miles.

Less Local Hikes

Listed here a couple of parks that aren't really local to the triangle, but close enough to make a day trip. I'm totally geared up when I go to one of these; boots, pack with bunch of crap in it, staff, GPS, etc. Though I've done some of the shorter hikes with the kids with just a bottle of water.

The paths marked on the trails as "strenuous" generally mean - lots of climbing - which usually also means great views. There will be lots of sweat.

Do some research before you go.

  • Hanging Rock State Park [pix] [pix]

    Hanging Rock is the main draw here, a fairly easy hike with great views and some rock scrambling when you get to the top. Lots of people.

    Moore's Wall Loop Trail takes you up a different mountain. At the top is an observation deck with fantastic views. You can do a bit of rock scrambling at the top, and some points along the ridge. Not many people.

  • Stone Mountain State Park [pix] [pix]

    A big mound of granite that's pretty breath taking. To see the view of the mountain, you'll have to venture on the trail to Hutchinson Homestead, which is a pretty easy hike. The hike up the mountain is a different story. There will be sweat. They now have steps that take you almost the entire way up the side of the mountain; not as fun as before they had the steps, but certainly a lot safer.

    When I was up there last week, I met a 70 year old couple from Charlotte who hit the mountain every year. I can only hope to be so lucky.

  • Crowders Mountain State Park [pix]

    The main draw is Crowders Mountain; lots of people. King's Pinnacle is just as nice, with much fewer people.

Web Sites

  • North Carolina State Parks by NC Division of Parks and Recreation

    This is a site maintained by the same folks who actually maintain the fantastic North Carolina state park system. Information on all the parks and natural areas (what's the difference?) is provided, including maps to the parks, maps of the facilities and trails in the parks, and other general information. The maps are quite detailed, and are PDF versions of the slightly better quality print versions of the maps available at the parks themselves. You'll want to use the maps provided at the park, while you're hiking, because they are a bit larger than the print version, printed on nice heavy paper, pre-folded, and have additional park information available on the flip side of the map. But print one of the PDF maps before you go, just in case they're out, or if you happen to go to part of a park which doesn't have a maps kiosk or park station nearby.

  • Triangle Land Conservancy

    You can read all about what the conservancy is about on their web site, but for purposes of this blog post, their web site contains links to a couple of hikable areas that they provide access to.

  • The Town Of Cary Cary Parks, Recreation & Cultural Resources Department

    Contains links to Cary's parks, trails and greenways.

  • North Carolina Parks - Google Maps by me

    This is a crude "mashup" I wrote a while back, recently refurbished to fix some broken links. It's a view of North Carolina in Google Maps, with a marker placed at all the state parks, and a few other random parks I've added. Clicking on a marker gives you a popup with a link to the park's web site, and the current weather and coupla day forecast, with links to more detailed weather information. A right click (if you're a righty) might bring up a context menu that offers to get directions to the park from somewhere else, like your house.

    You can also load the park data into Google Earth, by using the Add / Network Link menu item (on the Mac version anyway), and pasting the URL to the KML file into the Link field: Once you've added it to your My Places list, you can use the context menu on the entry for the parks to refresh the data from the KML file (basically, the weather). Of course, Google Earth can show you the weather itself. It can also show you pictures taken from within the parks, links to Wikipedia entries, and so on. Google Earth is a great way to get familiar with the layout of the hilly parks, especially if you set "Elevation Exaggeration" to the maximum value of 3.


  • Get Out! Get Fit! by Joe Miller

    Joe works for the Raleigh's News and Observer newspaper. He authors a print column "Take It Outside", which is also republished to the web. He usually references his print columns in his blog, so there's not much need to watch for the print columns. Just follow his blog instead.

    Joe covers all manner of outdoor activities, not just hiking, but he spends quite a bit of time covering hiking and biking in North Carolina. He has also written a few books, which I'll reference below.


  • 100 Classic Hikes in North Carolina by Joe Miller - $16

    This is Joe's most recent book, and covers, as it claims, 100 hikes in North Carolina - east, west, north, south and in between. He covers a lot of the state parks, so provides addition information over what's available on the state park's web site. In the Introduction, he discusses clothing and gear, though as I mention above, for short hikes, you won't need much. It's a good introduction to other gear you might want to get though.

  • Take It Outside: Hiking in the the Triangle by Joe Miller - $13

    This is Joe's earlier book, which covers hikes in the Triangle area of North Carolina. Ten years old but still relevant. Simple hikes, places you should definitely check out because they're right in your backyard, if you live here.

Wednesday, November 12, 2008


I remember reading Michael Lewis's "Liar's Poker" back in the day, and enjoying it, so it's not a big surprise that I also enjoyed reading his recent article on our financial crisis, "The End".

But my reaction to the article is a little different than Tim Bray's "Angry" blog post. Anger is an understandable reaction; we've essentially been fleeced. But when you get fleeced, you have to realize that often you walked right into the scam. One of the people to be angry at, is yourself.

How did this happen?

One word: brainwashing. We all wanted to believe there really was a lot of money to be made, that level of wealth building going on was somehow sustainable, and that we could all be a part of it.

DJIA from 1930 to today - link to live chart

But honestly, did you really believe your realtor when they told you the property prices in the neighborhood you bought into were appreciating 10% a year, with no end in sight? Does it really seem ok to spend $30,000 on an automobile? Can you really look at the historical record of the Dow Jones Industrial Average from the 1930's to today, and say: "I don't see anything abnormal".

We all wanted to believe, so ignored the signs, if we saw them at all. Were there some bad apples out there? Sure. But far more folks who weren't really bad apples, really just duped like we were. Deluded by fantasies of riches. Brainwashed.

Relating this to computer tech

I couldn't help but to extrapolate from my take on Lewis's article, to some of the goings on in the computer tech field today, because I think there's a fair amount of brainwashing going on in tech also. What do you think about the following ideas:

  • Using LaTeX files or Microsoft Word .doc files as serialization formats for structured data.

  • Using C or C++ to build your next web-based application.

To me, these sound crazy. Why would you use a word processing system as the basis for a data serialization format? Nuts, right? But we are. XML traces it's roots back to IBM's Generalized Markup Language, a text markup language not like LaTeX or nroff (good times, good times). XML is frankly not all that different from GML, I'd say easier on the eyes (brackets are easier to visually parse than colons), and more regularized syntax. But it's fundamentally a language to apply bits of text formatting to large amounts of raw text. A typical BookMaster document was mainly plain old text, with occasional tags to mark paragraph boundaries, etc.

Same sort of nutso thinking with Java. A potentially decent systems-level programming language, it could have been a successor to C and C++ had things worked out a bit differently. But as an application programming language? Sure, some people can do it. But there's a level of complexity there, over and above application programming languages we've used in the past - COBOL and BASIC, for instance - that really renders it unsuitable for a large potential segment of the programmer market.

How did these modern-day accidents occur? Hype. Being in the right place at the right time. They more or less worked for simple cases. We all wanted to believe. We brainwashed ourselves.

Luckily, evolution is taking it's toll on these two languages. XML isn't the only game in town now for structured data; JSON and YAML are often used where it makes sense; Roy Fielding notes that perhaps GIF images are an interesting way to represent sparse bit arrays (ok, that's a random mutation in evolutionary terms). We're seeing an upswing in alternative languages where Java used to be king: Ruby, Python, Groovy, etc (with many of these languages having implementations in Java - perfect!).

Reality is setting in; do what makes sense; think different; the hype curve doesn't always point to the right answer.

My new favorite example of tech brainwashing

So while I can't complain so much about XML and Java as I used to, it's kicking a dead horse at this point, I do have a new whipping boy in the tech world for where we've been brainwashed - "web applications". Those things that run in our web browser, giving us the power, beauty and flexibility of desktop apps. Web 2.0. RIAs. GMail and Google Maps.

I don't have to explain to anyone who's ever tried putting together a "Web 2.0 application" the utter pain in doing this. Ignoring server-side issues, you have to deal with three different languages: HTML, CSS, and JavaScript; typically interspersed betwixt themselves. That behave differently in the three to five popular browsers you might hope to support. And the iPhone. Server side programming throws more wrenches in the gears, as in our simpler web 1.0 world, we frequently mixed HTML, CSS, and JavaScript with whatever programming language(s) we used on the server. And we still do, at times, in this new world also, only there's lots more HTML, CSS and JavaScript, so it's even messier.

Or maybe you're using Flex or Silverlight or some other more constrained environment for your web app. But then you have different problems; your users might expect to be able to bookmark in the middle of the app - it's running on the web after all. Or cut and paste some of the content. Etc. And you're probably still deploying in a web browser anyway! There is no escape!

What really frustrates me about the situation we're in, is that we've painted ourselves into a corner. We started with a very useful, mainly read-only, networked hypertext viewer, and over the years bolted new geegaws on the sides. Blink tags. Tables. JavaScript. Frames. DHTML. File uploads. XmlHTTPRequest. SVG. HTML Canvas. (stop me, my head's about to explode!) All great stuff to add to a mainly read-only, networked hypertext viewer. Can you use it to build a word processor? Yes, you can. Well, a team of software developers at Google can. Not sure that I can.

But I used to be able to build GUI apps without a lot of difficulty. High function, richly formatting text editors even. In C, for gawd's sake, though life got a lot easier in Smalltalk.

It's time to stop thinking we can apply bandages to the status quo and make everything better. We want to believe. Just another gadget or framework is going to make everything better! We've brainwashed ourselves.

Wake up! We fundamentally have the wrong tools to do the job. We're using a spoon where we should be using a backhoe. Look down! You're using a spoon for *bleep*'s sake! Don't you realize it? Slap yourself around a little and clear the fog from your eyes. Expect better.

To be a little more concrete, I actually do think that the fundamentals of our web tech economy are sound. I'm not unhappy with HTTP, HTML, CSS, and JavaScript when viewed as separate technologies. I don't think we've fit them together in the best way, to make it easy to build applications with. And they're wrapped in a shell optimized around mainly read-only, history-enabled, page-by-page navigation, which doesn't seem like the best base on which to build an application. It's time for some new thinking here. Can we take some of the basic building blocks we already have and build a better application runtime platform than what we've got in front of us? I have to believe the answer is: Yes we can.