On the Soapbox

Great Tom Toles Cartoon

Tuesday, January 31, 2006
Keywords: Politics, Humor

...I especially love that punchline at the bottom. :)

Google and the Great Firewall of China

Friday, January 27, 2006
Keywords: Technology, Politics, China

I have to admit that I was pretty surprised at how very negatively and intensely most of the tech community is reacting to Google's censorship in China. So anyway, here's my take on this whole thing as a Chinese-American...

Background: .com vs. .cn

Google's actions simply involve the establishment of a new google.cn domain. Searches on this new .cn domain are censored. They are not on the .com domain. So anyone who wants to get the uncensored results can just use the .com domain. There is a Chinese language interface for google.com (there's even a Klingon language interface), and that was where I was taken when I tried to use Google search from China last summer: the uncensored google.com domain served from a server in the States using a Chinese language interface (because it detected that I was visiting from a Chinese IP address). Even gmail.com (a service that Google does not intend to officially introduce in China for some time) worked. None of these .com services are affected, as they represent servers not located in China. The downside was that these services were often slow and were sometimes completely inaccessible (considering that I could get fairly decent speeds when I SSH'ed into a private server in the US, I suspect some sort of government foul play). Not that these uncensored results did me much good, since I couldn't access a number of sites (without setting up a SSH tunnel :p), and believe me, there are a LOT of sites (even cnn.com!) that are affected by the vaunted "Great Firewall of China," which certainly lives up to its name.

In the end, nothing has changed. Google has simply added some servers in China and are being forced to comply with the standard set of government restrictions for those .cn servers only (i.e., if google.com is still accessible, then people can still get uncensored results). And before people bash Google too much, let's not forget about all the other companies doing business in China who are being forced to obey these local laws, and unlike the other search providers in China, Google openly discloses the censorship when displaying results.

But it's the principle of the matter!

Many claim that Google does have an option, and that's to not do anything. Not entering the Chinese market will certainly hurt Google's bottom line, but Google's mantra of "do no evil" seems to suggest that doing the right thing should trump the pursuit of treasure. Despite being a free-market economist, I do admire and strongly believe in this "do no evil" mantra, but there is one very important point that I think people are missing: what is the evil that is being done? What would things be like if Google does absolutely nothing? Does it make the Chinese more free? No. Would Google refusal to officially enter the Chinese market inspire the Chinese? Considering that Google's presence in China is so small (gee, I wonder why?) that most Chinese are not aware of it, no. Does Google's entrance into the Chinese market help the Chinese government in any way? Considering that the Chinese government could probably care less if there's one more search provider in China, no. Does this action by Google hurt the Chinese in any way? No (remember, there's always google.com, which is unaffected!). Does this action by Google affect users outside of China in any way, shape, or form? No. Does this action by Google serve as an endorsement and statement of support for the ways of the Chinese government? Only if you want to read it that way; remember, censorship in china is mandatory, not voluntary, and Google's official statement contains no statements that can be construed as support for the policies of the Chinese government. Of course, just because a law exists doesn't mean that it should be honored; it is the duty of people to resist unjust laws. But what can Google do? Google is in no position to offer any sort of challenge to Chinese laws; only the Chinese people are in such a position. So, um, where's the "evil"? Ruining the environment is an evil that is not easily justified by profit. Installing spyware is an evil that is not easily justified by profit. But, I ask again, where is the evil in setting up restricted servers in China? There was a photo on a news website showing supporters of the Free Tibet movement holding signs and protesting Google's move. Despite being sympathetic to Tibetans, I have to wonder if these people ever considered for just one second exactly what kind of harm Google has done to their movement. Anyway, to sum it up, if there is no true "evil" involved, then why shouldn't Google try to firm up its bottom line?

General Thoughts: China

China is slowly becoming more and more democratic. I was struck by how willing people were when it came to criticizing the government. Hop into any random taxi cab, strike up a conversation about government, and out comes a string of harsh words directed at the government. I find it odd that foreign news services doesn't seem to be able to pick up on this. In any case, the liberalization of China is a gradual process fueled by growing affluence and growing influence from the outside world (I'd imagine that the Internet helps). A bold (and foolish) gesture of defiance from Google is not going to do nearly as much good for democracy as the gradual improvement of China's information networks. Every Chinese knows about censorship, and they even joke about what can or can't be said. Censorship isn't working, and it's only a matter of time before the dam breaks. By offering services in China, Google is contributing to the water behind that dam. In the end, censorship in China is not Google's problem and there's nothing that any foreign entity could do anything about; it's ultimately a problem with the Chinese government that only the people of China can do anything about.

General Thoughts: Google

I have always been impressed with Google track record. Resisting the DOJ's ridiculous crusade against pornography (before someone compares this to the China scenario, remember that challenging the Chinese government and challenging the US government are two very different ballgames), being forward and upfront about controversial points that less honorable companies would've tried to hide, supporting open source, setting up strict guidelines for its software installers, supporting open chat standards, supporting open source, etc. are all examples of Google's "do no evil" policy, and my faith in them have yet to be shaken. Besides, I would much rather have the Chinese be introduced to the wonders of the Internet by way of Google instead of by way of Microsoft. ;)

This entry was edited on 2006/02/10 at 01:36:05 GMT -0500.

Potpourri (Random Stuff)

Wednesday, January 25, 2006
Keywords: Economics, Politics, Technology, Potpourri

"Dark Matter" in Economics

As mentioned in the latest issue of The Economist, there is a recently-published economic theory about something called economic "dark matter", which tries to explain why, despite having a huge negative account balance (i.e., our debt to the rest of the world), the US has a net positive flow of capital returns, which suggests a positive account balance. The idea here is that we are underestimating our true foreign account balance, much like how "dark matter" in physics serves as a fudge to account for what appears to be an underestimation of the amount of matter in the universe.

In depth: http://www.rgemonitor.com/blog/setser/113810

Ignoring the Facts

There's an interesting article about how people, once they have made up their minds on an issue, will tune out things that contradict that view, hampering rational judgment and discourse. This comes as no surprise. For example, I've noticed this in the debate about abortion, and even in personal interactions (i.e., how one's perceptions of others' actions are very strongly colored by how one already views other people). It's just interesting to see a scientific confirmation of this.

On that note, I wonder if this is how religions work: there are some who tend to attribute positive things that happen to them to God while glossing over the many neutral or negative events. And to be fair, I've also spent quite a bit of time wondering how much of this "filtering" colors the views of atheists.

Google Reader

There's a shocking lack of good RSS readers for Windows. Sage is nice, except that the interface is a bit awkward (probably because it's a Firefox extension). Thunderbird displays the whole page instead of just the content from the feed (plus, I don't use Thunderbird anyway). Opera's reader was okay, except that I don't use Opera. And all the other readers are either bloated, slow, .NET-based (eewww), and/or clumsy in implementation. I was so tempted to just write my own. But I thought that it might be worthwhile to try some web-based readers, so I first tried Bloglines, but the interface was clumsy at best. And then, I discovered Google Reader, and I'm impressed. A well-written software reader would still be better, but this comes close enough.

Google Sitemaps

Although the Google Sitemaps tool has been around for some months now, I didn't know that it existed until today. I'm going to try it out tonight; it looks like it could be pretty useful.

This entry was edited on 2006/01/25 at 17:36:13 GMT -0500.

Democracy vs. "Electocracy"

Tuesday, January 24, 2006
Keywords: Politics

From the 21 Jan 2006 issue of The Economist...

... even free elections, on their own, do not constitute a democratic system. "As a rule, 'electocracy' should not be confused with democracy," rightly avers Richard Haass, head of policy planning in the State Department in 2001-03 ...

I wonder to what extent Iraq's new system of government is a democracy. How truly democratic is a government built along old sectarian power blocs and loyalties?

On that note, I wonder how much our own government here in the United States is an "electocracy"; even though the article is about the "other" countries in the world, this nevertheless made me wonder about ourselves. We have free elections, but what good are free elections if there is a lack of bona fide debate on key issues, either through chronic apathy or a poorly directed sense of patriotism? To clarify, I think we're still mostly a healthy democracy and we're still a shiny beacon given how bad most of the rest of the world's governments are, but I sometimes get the feeling that this is all slowly eroding away.

This entry was edited on 2006/01/25 at 13:36:10 GMT -0500.

Trying Out Internet Explorer 7 Beta 2

Monday, January 23, 2006
Keywords: Technology

I'm typing this entry using IE7b2 (the 5299 build that was leaked a couple of days ago)...

  • It seems like that the CSS issues that I would've like to see fixed (support for the opacity syntax, :before, and PRE blocks inappropriately stretching the width of parent blocks) are still not fixed since IE7b1. Grrr.
  • It seems like certain other CSS issues were fixed since IE7b1, like the parent>child syntax, which breaks many CSS filters, including the one that I use to work around IE's other bugs. Damnit!
  • Microsoft turned on ClearType in IE7b2... even though I have ClearType turned off for Windows... and there's no option in IE7b2 to turn ClearType off in IE. ClearType doesn't look very good on flat-screen CRTs; what happened to letting the user control stuff like this?!
  • There's no menu bar. There's a kind of iconic drop-down toolbar that replaces it. It's an interesting concept worthy of merit, but for someone who isn't used to it, it's pretty distracting and inconvenient. I'm just trying to picture the Average Joe who is used to working with a menu bar suddenly having this foreign interface thrust in front of him. Oh, and you need to dig in the menus to find the options to change this; no more easy access via a right-click.
  • IE7b1 included Google Search in its quick-search box in the upper-right corner. IE7b2 does not include it (only MSN Search), and there doesn't seem to be an easy way (at the moment) to add it.
  • The new icons are very attractive, though.
  • The RSS reader looks nice (something that's missing in Firefox), but this was already there in Beta 1.
  • Microsoft sent me a CD of Beta 1, but it wouldn't install because the Genuine verifier was somehow fubared even though my OS is genuine (I ended up having to download a crack for Beta 1). Looks like this problem is fixed with Beta 2, as it installs just fine without a crack. I think that this (along with the icons) are the only things I like about Beta 2 over Beta 1. How pathetic is that?

Verdict? I think I liked Beta 1 more than Beta 2 (I still like Firefox more, though). And I'm not looking forward to finding new ways to work around IE's buggy CSS.

This entry was edited on 2006/01/23 at 16:15:33 GMT -0500.

Wireless Everywhere

Monday, January 23, 2006
Keywords: Technology

A little chat I had tonight...

vivienm: *hugs wireless internet in class*
Kai: wireless is everywhere these days
Kai: every single *budget* motel that we stayed at during our trip to Florida had free wireless
Kai: I run network stumbler, and I can pick up over a dozen different signals
Kai: it's ridiculous
Kai: the weekly brick&mortar ads now dedicate a page or two each week to wifi crap
Kai: it's mainstream
Kai: *sigh* remember back in the day, like 5 years ago, when this stuff was cool and exclusive?
vivienm: my laptop picks up... 5 wireless networks here
vivienm: including mine
vivienm: *shrug* I remember when the equipment was horribly pricy
vivienm: and when it wasn't built into laptops :P
Kai: yah
Kai: $120/card when I got mine, and that was on sale
Kai: now cards are dirt cheap and $120 gets you a premium high-end base station
vivienm: I got my current 802.11g router (which isn't used for routing) for like $10 after MIR
Kai: $10 CDN?!

Wow, 5 years! Seemed just like yesterday for me. And the number of networks that I could pick up at this particular location went from zero to over twelve in less than four years.

This entry was edited on 2006/01/23 at 03:54:21 GMT -0500.

Time/Date Format

Monday, January 23, 2006
Keywords: kBlog, Technology

I'm genuinely curious about this: what the heck were they thinking in RFCs 822 and 2822 when they set the format for date-time? Why does the format look like "Sun, 20 Oct 2002 23:47:15 GMT" instead of "2002/10/20 23:47:15 GMT"? Okay, the day-of-week is optional, thank goodness, but was it really necessary to force the use of named months instead of a numerical month? Why expend that extra effort (albeit not that much, but I guess it could add up if you're working with a lot of data and this was 1982) converting from a numerical value to text and back again? Not to mention, the burden added to the programmer. Imagine doing that with C. Not that it's difficult or time-consuming, but just one more annoying thing to have to take care of.

I just added support for "conditional GETs" to kBlog after noticing that Apache was logging script errors for the 304 response code, which meant that kBlog had to parse the If-Modified-Since line in the request header. Great. So it's either load an extra module (Date::Parse) or manually parse the string and feed it to POSIX::mktime. Neither of which is difficult thanks to power of Perl (this blog entry probably took just as long to do), but it's the principle of the matter: what good comes out of this inefficiency in the specification?

This entry was edited on 2006/01/23 at 02:10:29 GMT -0500.

The real issue with Roe vs. Wade

Thursday, January 19, 2006
Keywords: Politics

I remember an incident a few years ago when I was dining with some friends. I announced at the table that I felt that Roe vs. Wade should be overturned. One of my friends had a look of dismay about her (especially since I was a card-carrying member of the ACLU) and immediately started to attack that assertion. The incident was a bit amusing, but it also illustrates a certain lack of understanding about the issue. Unfortunately, I never got a chance to fully defend and explain my position, as we were close to finishing dinner and leaving, and the bustle of the college dining hall did not provide an ideal environment for such a discussion, so I let it slide.

The Alito hearings last week has prompted me to revisit this issue, and I think that I should lay out in detail what I meant when I said that Roe vs. Wade should be overturned and also elaborate on why I feel that overturning Roe vs. Wade would be good for the country and for abortion itself.

A little background

Years ago, when I was still in high school, I was an unquestioning supporter of abortion. I believed very firmly that it is not the government's place to regulate what people do medically. Today, I still hold the view that government should not meddle with medical affairs, and I applaud the recent Supreme Court decision in favor of assisted suicide. So why would I advocate an overturn of Roe vs. Wade? As an unwavering supporter of abortion in high school, I tuned out most of what the pro-life people threw at me. It was easy to dismiss them as irrational and being on the fringe, but that did not quite fit, as there were pro-lifers who were rational people and who I respected. This intrigued me, so I tuned in a little and it quickly became clear why the entire abortion debate is so intractable...

The trump card

For the sake of argument, let us say that an embryo/fetus is alive and is a legal person in the eyes of the law. If so, then, like everyone else living under our system of law, this entity is entitled to the protection of law. The problem with the abortion debate is that, for the most part, the pro-choice side does not seem to grasp what exactly this assertion means. I was discussing the Alito hearings with Carl last week, and he said that people who do not believe in abortion should just avoid having one and let everyone else decide for themselves. This is a perfect illustration of what I mean by the failure of most abortion supporters to grasp the full implications of the assertion made at the start of this paragraph. If abortion is labeled as murder, then it does not make much sense to tell people to decide for themselves if they should have one or not. A serial killer cannot claim that people who believe in killing people should have the right to go about doing so. I have heard many abortion supporters say that pro-lifers should just go about minding their own business, but if a serial killer hits a town, do the people of that town instruct the police to ignore it and to mind their own business? The pro-choice claim that a woman holds the rights to her own body is somewhat more convincing, but it, too, runs into problems. For example, parents hold the rights to their own property and resources. Yet, if they withhold those resources by choice from their child such that it results in the child dying, they would be charged with criminal negligence. In this particular example, you have the conflict of two rights: the right to control your own property and resources and the right of a person to not be deprived of life, and most people would agree that the latter trumps the former. Likewise, I think that many pro-choice advocates would agree that the right to bodily sovereignty trumps is trumped by the right to the life of a born child (assuming there are no health risks at play that could potentially jeopardize life, in which case it becomes an issue of right to life vs. right to life).

Peeling back the onion: the real issue at stake

In reality, while a large number of people are comfortable with saying "mind your own business" when it comes to the issue of abortion, there are very few who would say that if it was a serial killer, even though both are classified as "murder". The discrepancy is that while virtually everyone would agree that a grown person killing another grown person without provocation (i.e., not in self-defense) is murder, many people do not believe that killing an embryo is murder (hence my emphasis on "born child" in my final example), bringing us to the first sentence of my previous paragraph, "For the sake of argument..." The whole discourse about murder is hinged on the assertion that an embryo should be granted legal status as a person. Ultimately, this is a question of when life begins. Nothing else matters. Arguments about privacy, about minding one's own business, about bodily sovereignty, etc. are all irrelevant and empty if it is held that the thing in question is a life and thus a legal person and not just a cluster of cells.

Thus, the real issue that needs to be argued is not whether people should have rights to their own bodies (I believe that they should) or whether people should have a right to privacy (I believe that they should) or whether people should mind their own business and leave others alone (I believe that they should), but instead, the real issue is where do we draw the line between life and non-life, because all other issues are secondary if murder is involved.

Take a look at pro-choice bumper stickers and the signs held at pro-choice rallies. What do they say? For the most part, these signs say things along the lines of "uphold Roe vs. Wade", "hands off my body", "keep abortion legal", etc. Very few actually address the real issue that is at hand. Perhaps it is because pro-choice advocates believe that the issue of when life starts is a personal one and thus they will leave the pro-lifers to believe what they want as long as the pro-lifers leave them alone. But this is not possible because whoever believes that an embryo is a legal person simply cannot leave the issue alone. This also has an effect of creating problems of understanding and dialogue between the two sides. Pro-choice advocates are frustrated with the stubborn inability of the other side to leave the issue alone, and pro-life advocates are frustrated with the other side's inability to grasp the heart of the issue (and the subsequent inability to appreciate the pro-life perspective).

It is thus my belief that the first step to resolving the abortion controversy is for the pro-choice movement to open its eyes, see what this issue is really about, and to engage the debate over this very narrow issue of where the line should be drawn between life and non-life--or to put it another way, how we should define "life" in our society.

Roe vs. Wade and the judicial entanglement

The issue of how we should define "life" in our society is a political and social issue. It is not a judicial one. How is the legal definition of "life" a constitutional issue? When the Supreme Court makes rulings that clarify legal definitions, they do so in accordance to the spirit and intent (or their interpretation thereof) of the law. But on what basis should the Court make such a ruling about what a life is?

If Roe vs. Wade is overturned, then it will free the issue of abortion from the judiciary and send it back into the political realm so that the people can decide on it; the Court is not the ideal place for political battles. Furthermore, it would be the first step in undoing the damage that Roe vs. Wade has done to the judiciary.

Damage to the judiciary? Abortion has become such a hot-button issue that when the Supreme Court is mentioned, many people will think about abortion. Just look at the Alito hearings. Despite the many issues that come up before the Court, from issues of federalism to issues of legislative and executive power, the single issue that received more time and attention at the hearings than any other was abortion. I would imagine that there are many Americans who have made up their minds about Alito based primarily on abortion. The extraordinary amount of time devoted to pressing the abortion issue during the Alito confirmation hearings was frightening. To be sure, other important issues such as executive power were aired as well, but for one single issue (and one that probably will not directly affect the country as a whole in the long run--abortion simply does not carry the same kind of substantive weight like the colorful spectrum of various federalism issues) to receive what seemed to be at least a quarter of the time is remarkable.

The political cost of entanglement

While I do not think that abortion is substantial enough to change the country directly, it has become capable of affecting the country very substantially indirectly through its debate. There are Supreme Court nominees who are put onto the Court partly because of what they feel about abortion (if abortion was not an issue, do you think that Miers would have been nominated?). We now have confirmation hearings that sacrifice time that could have been used for substantial issues for a grilling about abortions (do you think that Alito would have the kind of support that he has if abortion was not such a major issue?). We now have people who would otherwise be Democrats voting Republican simply because of abortion (and thus voting for other policies that they otherwise would not have supported). There are people who support Bush primarily because of abortion (would he have been elected if abortion was never an issue?). The research that I did for my IB essay about the religious right as a political bloc in the United States reveals that galvanizing people around a few emotional issues such as abortion is one of their major sources of power and appeal.

I feel that the entanglement of abortion in our political system has been extremely harmful. It has diverted our attention from important issues and it has also served as a vehicle upon which other unrelated issues may ride (e.g., if someone who opposes war but who feels strongly about abortion voted for Bush). In the judiciary, it has eroded the precious political insulation that protects the judicial branch. There was a time when justices were selected for their qualifications and not for how they would vote one or two issues, and while there are many Supreme Court decisions have contributed to this erosion, abortion has certainly contributed more than its fair share in recent years.

The ideal solution

Overturning Roe vs. Wade would be a step in the right direction. By repudiating that decision and throwing the issue back into the political arena, it will free the Court from the issue (as long as it does not issue a judgment that affirms the exact opposite of Roe vs. Wade).

It is also important to divorce the issue from the standard political process. Ideally, the issue of how "life" should be defined should be presented as some sort of referendum to the population at large, which would free politicians and lawmakers from being associated with the issue. I believe that such decisions made directly by the people would also be more acceptable, as they can no longer blame biased courts or irresponsible lawmakers. This kind of clarity in definition would also settle other issues such as stem cell research.

Finally, I believe that a decision such as this should be made at the State level. There is no reason for the federal government to be involved, and because how people view the definition of life is largely cultural, it is a perfect example of something that should be left to the States.

Personal thoughts

It is my personal belief that life begins when the mind is capable of self-awareness, which would probably put it some time before birth, but past the earlier stages. It is my hope that if (and that is a big if) this debate finally settles down and zeros in on this key issue, that people would draw the line at somewhere around that point. The pro-choice movement has been complacent and relatively dormant for the past few decades thanks to Roe vs. Wade (studies suggest that pro-choice people outnumber pro-life people, so I imagine that their lower profile is due to silence), and an overturn would probably restart the debate in earnest, which is something that I think would be healthy for the country and which I would look forward to. In the end, if a decision is made by the people and not be the Court or by politicians, I would be happy to live with that decision, regardless of what it may be.

PS...

Does anyone else find it ironic that liberals who clamour for animal rights and who push for certain legal rights to be extended to them are also the ones who oppose the extension of legal rights to embryos? I always found that to be a bit funny. ;)

This entry was edited on 2006/01/19 at 21:54:23 GMT -0500.

kBlog, 0.1.0-Beta

Thursday, January 19, 2006
Keywords: kBlog

kBlog 0.1.0-Beta has been released today, 19 Jan 2006. I'll post the source code when I get around to it.

It's mostly feature-complete, but not quite. The backend needs to be re-written to use something other than XML, but it's not as bad as it sounds. The current backend was written in just two days, as the backend's behavior is very well-defined and it operates in a sort of controlled environment. The interface is the is complicated part, needing to take into account user interaction, bad input, security, etc. while trying to provide a way for the user (meaning both visitors as well as the blog owner) to do things in an easy and intuitive fashion. And debugging. The code also needs to be audited to make sure that it's kosher to run it with mod_perl (in the event that I need to get a performance boost). There may be a few interface-related things that get changed, depending on what I happen to dream up of in the interim. When all this is done, I'll call it 1.0 and get rid of the beta label, but since 0.1.0-Beta is fully functional, 1.0 is a low-priority task for me, meaning that it'll be done whenever I feel like it. :p

This entry was edited on 2006/02/12 at 17:06:34 GMT -0500.

Using XML for kBlog

Thursday, January 19, 2006
Keywords: kBlog, Technology

I remember a buzz a year or so ago about the use of XML as a data storage format, and how XML files would be ideal to take the place of a database in certain situations. And so, I decided to explore that possibility with the kBlog beta.

Since my needs were pretty simple, I didn't use a full-blown XML parser. The XML::Simple module sufficed. XML works, but it's not very efficient. There's the character escaping, there's the problem that in order to parse XML, you need to look for matching start and end tags, etc. I guess the XML::Simple module may not have been the best choice either, but in the end, it didn't seem to be that suitable. There are many other encodings that are more efficient to parse, and I think I'll switch to an encoding of my own for data storage when I do version 1.0, mostly so that kBlog would then depend only on the fairly common POSIX module (but a minor performance enhancement wouldn't hurt, either) (the XML RSS is simple enough that it is already being generated without XML::Simple; generally speaking, XML is easy to create, but annoying to parse without a parser).

I guess the big upside to XML is human readability. It's easy to read and to edit (well, except for all the character escaping that needs to go on; that cancels out a lot of the benefit, actually), but aside from that, XML parsing isn't as efficient. The other upshot is that XML is codified and is a standard. I just wish someone would codify a data transport/storage standard that's geared towards machine readability and parsing efficiency instead of human readability.

Personally, I think XML is a bit overhyped. It's just a transport/storage format, and there are people who talk it up as if it's somehow The Next Big Thing™.

Fun with CSS (or not)

Thursday, January 19, 2006
Keywords: kBlog, Technology

One of the things that I was looking forward to trying out was the use of CSS for layout. Prior to this, I've used CSS for formatting and tables for layout. It seemed to be the hip new thing to do, and that everyone was doing it, so this should be fun, right?

The Good

The upside to doing this is the divorce of layout from the actual HTML. It was really refreshing to see how clean the HTML code looks compared to the code that I had for my previous website. What I used to do with lots of nested tables I can do now with a few DIVs. It's easier to tweak and adjust my layouts, too. The nicest thing is that for a script-generated site like this, having lighter HTML also means that the script that is generating the page is also much cleaner and easier to look at. And as a bonus, the site is also somewhat usable when CSS is disabled (in Firefox, go to View > Page Style to see what it looks like with all the CSS off), so when I'm browsing using text browser like Lynx (which I sometimes do, actually), things work.

The Bad

And then there's Microsoft. Years ago, when the browser wars were raging between Netscape 4 and Internet Explorer, I was rooting for IE. This was before Gecko, of course. It was such a relief to have a browser that would render what you tell it to render instead of seemingly randomly deciding to made something either 10 pixels wider or narrower (which was what Netscape 4 was doing). I hated the web design process back then because I spent significantly more time tweaking the code to work around the various bugs in Netscape 4 than I spent working on the design itself, so I was not sorry to see Microsoft win the browser wars. But the times have changed, and ever since mid-2003, I've been using Firefox (or Firebird as it was called back then) as my default browser. So come time to do the layout, it was only natural for me to do all the preliminary work on my default browser, following the W3C specifications. That was a dumb thing to do, because as soon as I started to test the layout in IE, things got nasty, either because of spotty CSS implementation or because of the countless bugs in IE. I eventually ended up spending more time banging my head against the wall, cursing Microsoft, and working around the IE-related problems than I spent on the actual layout itself. Déjà vu with an ironic role reversal.

The Ugly

Whoever at the W3C who decided that it would be good a good idea to officially deprecate the use of tables in favor of CSS for layout should be shot. There are certainly many delightful benefits (as mentioned above), but there are severe shortcomings of using CSS for layout. The whole notion of floating the CSS boxes to do columns is really a hack. Just as tables were meant for tabular data and not for layout skeleton, CSS boxes were meant to format parts of a page and not to serve as a layout skeleton, and the liberal use of float to try to shoehorn it into the role of serving as a layout skeleton is just as unwieldy as the use of tables. It also doesn't help that IE is a bit bugged in respect to all this. The lack of stretchable dimensions (or at least the ability to define it with mathematical expressions without resorting to JavaScript) is annoying as well (no, the percentages don't count because you run into rounding problems with them and it doesn't help when sibling elements are fixed in size). Positioning is also a royal pain in the ass. You can either go with the flow, float the position, or take an absolute position in respect to the canvas. There's no way to take an absolute position in respect to something that is relatively positioned (like a parent element). This makes absolute positioning pretty much worthless unless you use it for the entire page (which is not only tedious and difficult to maintain in the long run, but also misses the point). In the end, I found that tables are MUCH easier to work with for layout. They may be ugly and bulky, but at least they are suitable. I do love the benefits of CSS layouts and would love to see the day when CSS layouts completely displace table layouts, but that will require enhancements to CSS to allow them to perform that role. It seems ridiculous that they would deprecate something without first ensuring that the replacement is suitable.

Oh, and another rant against the CSS box model: there are benefits to setting the width and height to the inner content width height. This is especially true if the size of child elements are known and thus it's easy to set the parent's width and height. But in layouts, dimensions are often constrained not by child elements, but by sibling and parent elements, which is why Microsoft's way of doing dimensions in IE5.5 and earlier made a lot of sense: the dimensions of an object representing the content dimensions plus the padding and border. For example, if you have a parent div that is 400 pixels wide, and you want to fit two boxes with a margin space of 20 pixels in between, setting the width was easy: (400-20)/2. But with the official CSS box model, you have to toss the border and padding into that equation, making it slightly inconvenient (especially if you are tweaking the border and padding to see what looks best). This is especially troublesome when working with percentages. A child that has any sort of border or padding can never use a dimension of 100% (making it impossible to get a child with a border and/or padding to match the size of the parent if the parent's size is unfixed). A sensible solution would be to introduce an alternate measure of dimension like outer-width and outer-height, which can be set in lieu of width and height. Another solution would be to accept mathematical expressions in CSS, such as width: 100% - 8px.

Welcome to kBlog!

Thursday, January 19, 2006
Keywords: kBlog

As you've probably already figured out by the name, kBlog is a blogging system that I wrote. And if you're familiar with blogging, then you probably know that there are already a lot of blogging systems out there, from services like Blogger and LiveJournal to pre-packaged install-on-your-own-server systems like WordPress and many others. So, given that, why the heck did I bother to create kBlog? Because I can (i.e., for fun) and because it suits my needs. :)

For fun?

I needed something to do in my spare time. Watching movies was getting boring, so a fun personal programming project seemed like a good thing to do at the time. Although I've done a few large programming projects over the past couple of years, I haven't done a major web-based programming project since mid-2001 (I've done a few smallish web-based things, but nothing that required a major backend). That's a long time in the Internet world. So this was a chance for me to roll up my sleeves and get my hands dirty with relatively new things, like CSS for layout (not just for formatting), the idea of using a blog as the main component of a site (rather than a half-forgotten tacked-on novelty, which was what my circa-2001 blog was like), etc.

Necessity?

Getting my hopelessly-outdated behemoth of a website updated and modernized was always something that was on the back of my mind. I finally decided on just throwing the damn thing out and starting over from scratch, and using a blog as the core. Given the low volume of visitors, using a database seemed overkill. I wanted something lightweight and portable--something that I can easily throw onto just about any web server running Apache without changing much. And so I started to look at the many pre-packaged blog systems, but the few that used a non-database backend were unsuitable for me--either too ugly or didn't offer the kinds of customization and flexibility that I wanted. Ultimately, this contributed significantly to my decision to write my own blogging system.

Never say "How hard could it possibly be?"

Writing kBlog was certainly an interesting experience. I started out in late November, right before Thanksgiving. After finishing the backend and a mock-up of the layout in less than a week, I thought that this would be something that I could finish pretty quickly. Well, seeing as how it's now late January, it's not hard to see that I was a wee bit off on that estimate. Long story short, I hit a few snags, got sidetracked, and let the project collect dust on the shelf for over a month. I'll write about the development process in more depth in another post.

About kBlog

kBlog is written entirely in Perl because Perl is such a great and powerful language.* The Perl requirements are very lightweight: only the POSIX and XML::Simple modules (the latter will be removed for version 1.0) are used. Formatting is done entirely using CSS for layout (okay, that was a bitch to get right, no thanks to Microsoft). The backend data is stored in XML files, but this will change with version 1.0 (XML is used for the beta because I wanted to explore the viability of XML for storage, but it is too inefficient for my tastes). To speed things up in the unlikely event of a /.-like effect (I've actually been /.ed once, but that was also on a dedicated server and not this dinky thing sitting in my room), all served pages cached on the server side so that there is data-access and page-generation processing done only the first time a page is accessed by anyone. Whenever a change is made to the data, the cache is cleared. Since most /. effects involve only page serving and not much interaction (like comment-posting), I feel that this should be able to hold up fairly well.

* One of the things that changed since 2001 is what I call the "downfall" of Perl. It's being slowly supplanted by Python (and recently, by Ruby) as the scripting language of choice, so the reader may wonder why I stuck with a dinosaur like Perl. The first major downside to Perl is that it's difficult for people to read/parse and thus not suitable for team projects, enterprise settings, or other situations where code maintenance is important. Fortunately, I am fluent enough in Perl that I can even think in it (that's what happens when you've used a language for nearly a decade), that downside didn't affect me enough to choose another language. The other downside is that the OO component of Perl is somewhat tacked-on and a bit awkward, but there's no need for OO in a project such as this.

This entry was edited on 2006/02/16 at 02:09:31 GMT -0500.