I've posted an 'article' comparing / constrasting the two, at my wiki, here: Amazon S3 vs RESTful Collections.[Read More]
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.
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".[Read More]
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.[Read More]
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.
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.
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.
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?
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).
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.
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.
pmuellr 10000085BJ 1,064 Views
Who are you?
Patrick Mueller, check out my brief bio at my wiki @ developerWorks.
What are you doing here?
Well, I just took a new position in IBM that involves 'community' (as in programming communities) and so I thought I should set a good example of how to do that by creating a blog here.
In addition to doing something regarding 'community', my new assignment also involves PHP. While I won't quite claim to be a PHP n00b, I'm pretty green. I thought I could let you learn along with me, and hopefully some more knowledgeable folks will happen upon the blog and correct me as appropriate.
I've been blogging for a while; my old blog is here. Before blogging, newsgroups; before newsgroups, VM/CMS FORUMs. Whoops, just dated myself!
Anyway, besides the usual stuff I blog about (maybe I'll drop the movie reviews), expect to see PHP stuff.
By taking this assignment, I left another very cool one: Jazz. My hall-mate Bill Higgins talks about Jazz quite a bit, so go there to learn more. I'll probably do some blabbing about it myself, eventually.[Read More]