Links

pmuellr is Patrick Mueller

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

Saturday, October 21, 2006

Stuff for trips

I don't travel much, anymore, so I've gotten out of practice. Here are some things to remember to bring and/or buy.

  • ethernet cables

    I so rarely use the wired intarweb anymore that I don't even carry a cable in my backpack. That's dumb. Some places still only have the wired intarweb.

  • airport express

    Turns a wired connection into a wireless one. Useful even for just a hotel room so I don't have to work at that thing they call a desk. Also, I have the previous version of this device, which I use to stream Radio Paradise into my stereo system at home, so this would be an upgrade of that device. That device is also sometimes referred to as a G3 iBook. My family would be happy to not have to unplug the stereo out every time they want to use the "family room" laptop. And, the stereo jack on the iBook is cracking anyway and probably doesn't have too much longer to live.

  • note taking gear

    I always have note taking gear with me. A Fisher Bullet Pen and a tiny IBM Think notepad in my pocket. But this isn't quite enough to take notes at a conference, like the one I just attended. For the family trip to Italy this summer, I got Moleskine Cahier Notebooks to keep a journal, and these worked great. I filled one up, and the boys did some scribbling as well. Sandy had a different journal thing she got from a friend. I tried using one at the conference, and it worked pretty well, except I was doing a fair amount of non-linear writing. That's where it gets tricky. A daily log is simple; page after page after page. I had daily schedules, expense, notes on presentations, questions to ask people, etc. It just barely worked.

    I think the next thing to try is index cards. And pre-print with relevant templates from the absolutely gorgeous D*I*Y Planner Hipster PDA collection from Douglas Johnston.

    I hate the thought of carrying these around in my pocket, which I'm sure I'll want to do at some point. I wonder if anyone makes 3"x5" index cards with rounded corners?

Podcasts

I spent the bulk of my time in the car, on the way to DC (5 hours), listening to podcasts. I sort of stopped listening to podcasts over a year ago (they got boring), but I decided to start looking around there again. Here's what I listened to on the trip:

php|architect's Pro::PHP Podcast. It's 1/2 interviews and half news. Good stuff, if you're trying to track what's going on in the PHP world. Think I'm all caught up at this point.

RedMonk Radio from the boys at RedMonk. No, I don't know why they have an eyeless, souless, creepily smiling zombie on their home page. What is it with England and zombies? Shaun of the Dead? 28 days later? Disclaimer: IBM is a Redmonk client. :-) Anyway, always a good listen. Think I'm all caught up at this point.

developerWorks podcasts. Grabbed these at the last minute before I left on my trip. I downloaded interviews with folks I've worked / chatted with over the years, including John Kellerman (previous boss, fellow BoilerMaker - go Boilers!), Carol Jones, Rod Smith, Bobby Woolf. Note these are Old Dudes (and Dudettes) Who Know Smalltalk (I think Carol and Rod at least dabbled in ST anyway). It was fun to listen to old friends, but I didn't really learn anything from it; I hear it at work all the time anyway. I suspect it will be good for non-IBMers to listen to.

I will probably also need a new iPod soon; my old 3G 15G is really getting old and crusty.

What my son wasted his time with today

http://www.lineflyer.com/

And who can blame him, it's a blast! Maybe it's the simplicity of it. I'll rationalize that he'll empirically learn some physics ...

2006 DC PHP Conference

IMG_2344 by joelogon

Just got back from the City of Ginormous Escalators, aka Washington, DC. I was there for The 2006 DC PHP Conference. To the right is picture of a typical escalator to the Metro subway system.

The conference was pretty small; about 80 people; in two small-ish conference rooms in the hotel. But everyone was great. Conferences are all about the people anyway. With the small crowd, it meant being able to spend time with a significant percentage of the people there. It was a mix of PHP thought leaders, everyday PHP programmers, and, since it was based in DC, a lot of folks focused on the unique industry that is DC - government.

Here's some notes ...

Presentations

Writing Maintainable Code with PHP by Laura Thomson of OmniTI. Pretty much standard fare for an old programmer like me, but good info for new folk. And it never hurts to hear this stuff again. Recommended the PEAR coding standards; arghhh ... spaces instead of tabs ...

PHP Security Testing by Chris Shiflett of OmniTI. This was good; I don't think I've ever really thought about using a test framework specifically for security testing, but it obviously makes a lot of sense. I mean, we always test for cases we know will fail, or are likely to cause problems, as well as for cases we know will succeed. But I've never specifically thought about testing for security. Mentioned Selenium, which I've heard of but know nothing about. Note to self, check it out. Chris also gave a talk on general security vulnerabilities and attacks against them, which I couldn't attend.

ext/soap with eBay Web Services by Adam Trachtenberg of eBay. Fascinating. Numbers: 59% of eBay listings are created from their WS APIs rather than through the web ui. One million WS requests a day. 100K sellers using 3rd party tools that use the WS. eBay wsdl file is 3Mb (the huge wsdl contains human-consumable documentation on the APIs (like JavaDoc)). New version of the APIs roll out every week, and each lasts a year or so, and there are separate APIs for different parts of the world; meaning hundreds of versions of the API are available simultaneously (but they don't change all that much). Showed how to build https://www.dudewheresmyusedcar.com/. This was the first positive thing I've heard w/r/t WS-* in a long time. That's great. It's good to see people using this stuff in practical ways. I'm still not convinced it's the best answer though. Side note: Adam asked early on how many people have sold stuff on eBay, and I was embarassed to not be able to raise my hand. So I found something to sell: A pre-owned Metro FareCard.

High Volume PHP & MySQL Scaling Techniques by Eli White of digg. Went over typical clustering techniques, most of which I'm basically familiar with, although memcached, I'm not. Talked about database shards, a term I've not heard of before, but the concept I'm very familiar with. None the less, I can't help associating the term "shard" with a scene with Philip Seymour Hoffman from Along Came Polly; discretion prevents me from explaining more. Eli also presented Top PHP Feautures You Didn't Know Existed, but I was sitting in the virtual parking lot that is I-95 South in Northern Virginia on a Friday afternoon instead of attending. Like my eBay n00by-ness, I don't read digg much, so I just added it to my blogroll. Gotta keep up with the kewl kids!

Rasmus Lerdorf did two presentations in one; one was "Yes, PHP is ugly, get over it. Go solve some problems." The other was the Getting Rich with PHP 5. The first was definitely a pep-rally speech, but you know, I need one of those every now and again with PHP. The second one talked about valgrind/callgrind. Need to look into these.

Enabling Digital Identity by David Recordon of Versign. This was great; I knew almost nothing about OpenID before, and now I know ... something. Anything to get the nastiness of maintaining an authentication system yourself is a big win, as far as I'm concerned. Went ahead and created an account at https://pip.verisignlabs.com/, now I just need to figure out what to do with it. Also need to look further into Yahoo's Browser-Based Authentication thing.

Hacked badge from 2006 DC PHP Conference by pmuellr

General Chatter

  • General non-interest in frameworks
    • Too much PHP, not enough C code (performance issues)
    • Complicated
    • Overkill

    I was in total commiserate mode on this. Good frameworks are great, but they take a while to become good. Before that, they're not so good. Do stuff you don't want. Hard to debug. etc, etc. Maybe I'm just frameworked-out at the moment. There's also some confusion in the air; people call Zend Framework a framework, but it's really just a bag of useful classes and functions. CakePHP and symfony and RoR are frameworks.

  • Hard to hire good PHP programmers

    I think this is true in general, it's hard to hire good programmers; but PHP has a special problem in that the language is so approachable that lots of people can 'learn' it, or enough of it to be dangerous, and not really be ... programmers.

Scary Chatter

  • REST payloads are XML.

    I saw this in multiple presentations; REST and XML in close proximity to each other. That's too bad, since adding XML to the REST story just unneccessarily complicates things. JSON == good.

  • Web services are only for server-to-server communication.

    Not sure what web browser-to-server communication is, if it's not web services, but there you have it. I was really dumb-founded by this. What is XmlHttpRequest if not a web service? It's time for some serious head-shaping, if people think they can't reuse what they're using between clients and servers, for what they're using between servers and servers.


Photo "IMG_2344", with a nice CC license, by joelogon. Found using the Create Commons Search Site.

Wednesday, October 11, 2006

Amazon S3 vs RESTful Collections

Two things I've been reading / thinking about have collided in my mind: RESTful Collections, and the Amazon S3 service.

I've posted an 'article' comparing / constrasting the two, at my wiki, here: Amazon S3 vs RESTful Collections.

Friday, October 06, 2006

Apex Chemical Fire

We don't normally watch the 11:00 news at night; there's usually not much news. But last night, for some reason, we did. For about three hours.

We're 3 miles southwest of the fire site; the winds worked in our favor last night and this morning; we did not have to evacuate. We did pack though, in case we were going to be ordered to, or just decided to, evacuate. Our big problem is our multitude of pets, or else we might well have just headed out to a hotel in north east Raleigh last night.

Mark Pilgrim is live blogging on this. And Joe Gregorio also posted something to his blog.

Monday, September 25, 2006

my evil twin rick

I just happened upon the blog of my old colleague and friend Rick DeNatale. I was quite fortunate in the early nineties to have Rick in my department when I was really learning Smalltalk. He's a great teacher. And he has a lot of funny stories from the old days. Ask him about rainbow colored punch card decks, or changing the value of 2 in fortran some day.

He's now off playing with Ruby, and I plan on soaking up everything he says about it ... especially since I come to it, like him, with a Smalltalk background.

BTW, I refer to him as my evil twin since we are physically similar in appearance; many people used to confuse us back in the day, and I still run into people at IBM who refer to me as "Rick".

creative commons fears

Like Mark Pilgrim and Tim Bray, I've had my share of qualms regarding Creative Commons licensing. Alex Bosworth posted on this a while back also.

Yeah, I wouldn't be happy if someone used some of my CC-licensed 'art' (quoted, due to the dubious-ness of calling what I do 'art') in a way I wasn't happy about. But I could deal with it. My biggest issue is if someone used some art which identified me, or even worse, other folks, in a way I, or the person identified, wasn't happy about. For me, that means photos.

For a while I dealt with this by only making photos that didn't include people 'public' on my flickr site. Photos with people were marked 'friends' and 'family', meaning only people I identified as friends and family could look at. Which, for those folks, means, getting a flickr id. That's not a huge hurdle for the folks likely to be reading this blog entry. It is a hurdle for a large percentage of my friends and family. After dealing with the 3rd or 4th person that couldn't see the pictures because they: 1) couldn't figure out how to create an id (even if I invited them), 2) didn't want another id to manage (who can blame them), or 3) couldn't remember their id they previously created, and wanted me to help them get it back; I finally said "screw it", and started making some of those photos public also.

That was a line for me to cross.

And then I got a note the other day, from a commercial outfit, wanting to use a picture of mine from flickr in some kind of product they were producing. A chill went up my spine. Ut oh, which picture might that be? On the other hand, I immediately thought "hey, that was nice that they bothered to ask." (Note they are supposed to, since the photo is licensed as by-nc-sa.)

Here's the picture they want to use:

I had to laugh. My wife told me to keep the day job.

In the end, at least for me, I think the CC fears are largely exaggerated. It's highly unlikely many people will want to re-use my art. And those that do will probably do the right thing.

To that end, I've also been trying to be a good citizen. I enjoy including art work in my blog posts to make it slightly more entertaining. You can see from some of my previous posts that I've included CC-licensed photos; I've used photos that aren't licensed as "non-commercial" (is my blog commercial? it's primary home is at an ibm.com site, so I'll say "yes" to that); and I've linked to the original photo site. If someone asks me to remove a picture, I surely will, despite the fact that given the license, I think it's fair for me to use it. And it's fun to just push the envelope on the issue in general anyway.

Sunday, September 24, 2006

Just Say No to XML - more often

In Just Say No to XML, Allen Holub writes "XML is perhaps the worst programming language ever conceived." What's he's talking about here are all the tools which use XML as a programming language. My only direct experience with this is with Ant. Within Eclipse. Because it's the easiest easy way to do 'scripting' with Eclipse. You know it's there, it's shipped with the base Eclipse. And I'll just say that, in general, I'm in agreement with Allen; I've written a shed-load of Ant scripts over the years, and I'd rather not have to be dealing with XML here.

Titanic cake

But I'd like to go even further! Allen follows up his 'worst' sentence (quoted above), with this: "I'm not talking about XML as a data-description language, which was its original design." If we're going to start thinking about not using XML for programming languages, let's also consider not using it for data-description as well. Why? Because XML isn't designed for data. XML is designed for documents.

And there's the problem. Documents. Programmers know how to design data. They don't know how to design documents. I think this is probably one of the biggest problems with the ws-* flavored web services; you need to design documents. To design an XML document, you need to know XML Schema. I know exactly one human who claims to be able to write XML schema off the top of their head, with no multi-hundred page reference document open. That's not good.

Sure, there are ways around having to learn schema, kind of. There's RELAX NG. But it's not widely supported in a least the places I program, and look at that last updated date on the page I just linked to. Kinda scary.

There's design tools, like UML-based stuff, but that adds layers of cake; now I have additional tooling I have to learn, there's code-gen in play so I have to watch for getting things synchronized, etc.

But let's pretend for a minute like there was an easy and standard way to design documents, and that programmers actually knew how to design documents.

Now you got the problem that there isn't really a simple way to go from documents to data. You might want to design your documents to be 'easy to parse' (eg self-descriptive), but that's likely going to violate some of the things you want in your document design, like readability. You'll probably end up using some coolio XML-to-data framework in your own code. However, some folks aren't going to have access to whatever coolio document-parsing-to-data system you're using, since most of these frameworks are single language stories, and your XML may be read by nearly any programming language known to man. In the end, some folks are going to have to use a DOM-based parser, or *gulp* SAX-based parser, to read your data. And that's simply no fun.

What's the alternative? Whatever is appropriate.

Java .properties files / windows .ini files are a really simple format for storing really simple data; too simple in most cases, but not all. Use these wherever you can get away with them.

YAML is kinda like .properties files on steroids.

JSON is the latest contender here, and is an appropriate format to use if you're expecting some JavaScript code to be handling your data, since you can use eval() to deserialize a JSON string into objects. IFF you can trust the source that gave you the JSON, anyway (that's a pretty big If, BTW; there are JSON parsers in JavaScript you can use if you can't trust your source).

Upon first really looking into JSON, I was struck by the similiarity in function that SDO provides. SDO provides a lot more than what what JSON provides, but at it's core, there's some definite similiarities. That seems good.

The point is, XML is unavoidable to programmers these days. It's everywhere. Just don't assume it's the best answer to your problem, just because everyone else is using it. There might be a better answer.


Photo "Titanic cake", with a nice CC license, by psb_minimal. Found using the Create Commons Search Site.

Wednesday, September 20, 2006

Tuesday, September 19, 2006

PHP is Doomed: a rebuttal

Imagine my horror, to take a new job in IBM doing some PHP stuff two weeks ago, only to find out last week that PHP is Doomed. Man, what crappy timing on my part, eh?

Impending Doom

I'm kidding of course; I don't think PHP is doomed. But the author of the article, Justin James, doesn't appear to be kidding to me; he seems quite earnest in his beliefs. So I figure I'd offer a rebuttal to some of his points.

PHP does not allow the programmer to multithread their application.

This point is brought up multiple times in the article. And of course, Justin is right. PHP doesn't support threads as a programming library capability like Java and other languages do. The reason Justin thinks this is the primary reason for PHP's demise is that you need multi-threading capability in servers; web servers now, when serving up pages, are going to be getting data from a variety of sources, and the only way to scale is to allow these separate pieces of data that make up a single page be retrieved simultaneously with multiple threads.

Justin uses Java as an example of a language that can do this multi-threaded processing on the server. Except, as it turns out, in Java Servlets, you are advised to not spawn your own threads. I won't go into the reasons, but found a message board entry here @ dWorks that provides the usual warnings: Re: Spawning Threads In Servlet. So, the fact is, you really shouldn't be spawning your own threads in a server.

Now, for the Java programmer, there's probably a way around this; your web container may provide extensions to allow you to spawn threads. For WebSphere, for example, you can use Async Beans. Or your container may support the WorkManager API. Or you may get some level of async processing through your middleware, such as asynchronously invoked web services. These bring additional complication, and in cases of container-provided extensions, may prevent you from writing completely portable code (portable across different web containers).

But there's still a problem. And it has to do with this thought (from the article).

If you are a Web developer, would you prefer your application to continue to process its work (for example, retrieving data from the local database, dynamically creating images, etc.) while waiting on the third party chunk of code (such as a Web service), and only have part of the page show a "Sorry!" message? Or do you think it is better for the entire page to take forever if the third party data source has a problem?

Threading is not simple. For example, how long are you willing to wait for that chunk to timeout, before using "Sorry!" as the content instead of what's supposed to be there? You're going to have to have a timeout. This implies that you actually need to synchronize on all the threads getting the individual chunks. Do you have a way to cancel a task that's taking too long? This is complicated stuff.

The obvious way around this, from my view, is to use AJAX to actually handle the parallel calls on the client. You've moved the problem from the server to the client, but it's safer to have it on the client anyway. And a user could, in theory, individually cancel pending requests, based on their ability to wait for them, instead of relying on presumably static timeout values in the server. But Justin doesn't appear to like the way of AJAX at all, which rules that option out for him. (Aside: he doesn't really explain why he doesn't like AJAX; I'd like to hear that argument).

Now, just thinking about moving your async tasks to the client brings up another point. JavaScript doesn't support threads when running in the browser; so how do they handle making HTTP requests in parallel? The model provided to the programmer is that of asynchronous programming with callbacks. When I make a call that would otherwise block, you pass in a function that the underlying code will call back on when the call succeeds or fails.

This style of programming is also available in the Twisted framework for Python (which I've never had a chance to use, personally; looks like fun though!). You can typically simulate threaded programming with asynchronous, event driven programming. With no threads. So, there's an answer for PHP straight off: they actually don't need threads, they need a port of Twisted. You of course need to have basic asynchronous i/o capabilities to build something like this, and it appears to me PHP already supports this for socket i/o.

Ruby is another language that Justin points out has thread support, but, in fact, it's probably not quite what he's thinking about. See Threads and Process from the online Programming Ruby book. Ruby's thread story is the same as VisualAge Smalltalk's: what we call "Green Threads"; they aren't operating system threads, but a threading system built into the virtual machine. As such, they will have limited capability to take advantage of multi-core machines, which is counter to part of Justin's argument that threaded applications can take direct advantage of multi-core machines.

There are things you could find to do with all those cores though; say ... virtualization.

Moving on ...

Its documentation is not very good, and frequently the comment threads provide the information that the documentation should have included but did not.

I would agree that the doc could use some work; I think a reorganized view of the existing doc might be enough to keep me basically happy; but doc quality is a constant issue (even with Java and Ruby). I actually like the end-user comment threads; someone tried this with Java a while back (@ JavaLobby?); wonder what happened to it? The one thing that I've not seen anyone compare with is the number of translations available for the base php docs: English, Brazilian Portuguese, Chinese (Simplified), Chinese (Hong Kong Cantonese), Chinese (Traditional), Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hungarian, Italian, Japanese, Korean, Polish, Romanian, Russian, Slovak, Spanish, Swedish. Wow!

It lacks high quality tools such as IDEs and debuggers in a "ready-to-use" state.

Besides the well-regarded Zend Studio, if you enjoy the Eclipse lifestyle there are two PHP IDEs under development: PHP IDE Project and PHPeclipse.

I will give PHP this: it is easier to install on top of Apache or IIS than any J2EE server that I have encountered.

You sold me!


Update: fixed a broken link to the Creative Commons search page, linked to at the bottom.


Photo "Impending Doom", with a nice CC license, by Dr. Stephen Dann. Found using the Create Commons Search Site.