Google Chrome, A Testament to Hubris

Before I begin with my argument, let me say that I generally like Google Chrome (or more correctly, Chromium, the open-source release). It’s the only reasonably responsive open-source (not Opera) browser for tabbed-browsing freaks on Linux, the minimalist UI and “prevent amateur authors from cluttering things” extension API work very nicely to keep things clean yet functional, and I love the little touches like extending the active areas of edge widgets like scrollbars and the tab bar all the way to the edge of the screen in maximized windows.

I also agree that, to make progress, you have to experiment. However, when the Chrome devs start making not-so-smart changes, ignoring mass-complaint by the users of their “Dev Channel” releases, not even compromising with a simple checkbox, and marking well-starred issues as WontFix, they start to approach the level of arrogance and hubris I once thought reserved for the developers of The GIMP. (They’re not quite there since, in my experience, GIMP developers will also insult you or dismiss valid complaints as rude before setting RESO INVALID or RESO WONTFIX)

Here are a few of the more controversial changes, to put it politely, which they have forced on Chrome users in the last few months:

…and that doesn’t even cover the many issues that should be trivial fixes but have languished for months or even years… presumably while the UI change reviews required by Google are continually de-prioritized in favor of whatever it is that the devs actually care about. (eg. native RSS support, reliable middle-click, debugged pop-up blocker, file associations, working blur()/focus(), download completion protection, a comfortable download shelf [1] [2] [3], and various others.

I’m not saying they should do things my way, but I find it, at the very least, insulting to be forced to do things their way without so much as an about:config or hard-to-find checkbox.

To be perfectly honest, for all its flaws, if Firefox 4.x can provide compact toolbars and a properly responsive GUI on Linux, I’ll switch back in a heartbeat. It may be a messy free-for-all with an extension system based on fragile monkey-patching and a rendering engine that’s more sumo wrestler than rocket, but at least it doesn’t presume to tell me how to use my own browser.

Update: As I mentioned in one of the following comments, another reason this really gets to me is the condescension, arrogance, and hypocrisy of claiming to make these changes “for the user” and then implicitly qualifying it with “We know what you want better than you do”. There’s a reason I don’t like Apple, there’s a reason I don’t like Microsoft, there’s a reason I don’t like the Apple fanboys in charge of GNOME and Ubuntu UI design, and now it looks like I also have a reason to not like Google… especially given the good arguments for reverting and the convoluted excuses against reverting that I’m seeing on the issue tracker entry for the removal of http:// from the omnibar.

Update 2: And, in what seems like an admission of defeat to me, the Google Chrome devs have now marked the issue entry for the removal of http:// read-only. In my experience, that’s the corporate equivalent of  “Ohh, nothing’s going my way. Mom!”

Update 3: While Google still seems to be convinced that their “we know you better than you do” approach to UI design is correct, they are not completely immune to reason. According to the Chrome 5.0.375.17 ChangeLog, they’ve temporarily reverted “http:// truncation, star icon, etc…”. Their official stance is “We are currently examining ways to address the usability issues that were raised and plan to reintroduce in a future release” though, so I doubt they’ll be willing to admit that stripping http:// on a non-cellphone browser is inherently a dumb idea.

Posted in Geek Stuff | 3 Comments

Der Untergang, Bizarro-style

You may be familiar with the “Hitler rants” meme which produced such parodies as “Hitler gets banned from Xbox Live“.  However, what you probably haven’t noticed is that, thanks to a user named hitlerrantsparodies, a continuity has started to coalesce in which Hitler’s greatest enemy is apparently not the Allies, but his prankster brother-in-law Fegelein who continually talks Günsche into informing Hitler of stupid, pointless things until finally Fegelein steals Hitler’s pizza takeout and the others decide to make Fegelein leader.

Here’s my interpretation of said Bizarro world’s timeline:

  1. Hitler is asked “Why so serious?” (where we see that Fegelein hasn’t yet distracted Hitler to the point where he essentially forgets about the Allies)
  2. Hitler is informed he is Fegelein (which apparently takes place before Hitler catches on to the source of Günsche’s stupid reports)
  3. Hitler is informed Fegelein has locked him into his room (where Hitler starts to realize that Fegelein is the source of all his problems)
  4. Hitler is informed he is Hitler (…but he still hasn’t realized that Günsche is in on it)
  5. Hitler is informed he is sitting down (…and now he has)
  6. Hitler’s glued to his chair (Fegelein’s twisted sense of humor responds to the previous incident,  we see how typical this kind of thing is, and Hitler’s patience wears thin)
  7. — Fegelein leaks the parodies which arrived on the web first —
  8. Hitler is informed Fegelein is missing (when Günsche tells Hitler that Fegelein’s ass-kicking for leaking the early parodies will have to wait)
  9. Various Pranks: Helium, Fegelein’s Death, Mass Cloning, etc.
  10. Hitler is losing his voice (from ranting about Fegelein’s antics all the time)
  11. Hitler is informed his pizza will arrive late
  12. Hitler Phones Fegelein
  13. Hitler is informed Fegelein is now the leader

All I can say is that it made my day evening.

Posted in General, Web Wandering & Opinion | Leave a comment

Scribblenauts and /b/-tards

Well, I was wandering around YouTube (no clue why) when I found evidence that the Scribblenauts developers may be /b/-tards. At the very least, they’re pretty good at catching all the noteworthy memes.

Here are just some of the noteworthy objects I’d never thought to try:

I also ran across some interesting ways to combine items (some of which exploit flaws in the engine):

Commenters also recommended these terms:

  • Ninja Shark
  • Chinese Dragon (Unlike European dragons, these guys are friendly)
  • Edison (A bandana-wearing T-Rex)
  • Blob
  • Chupacabra
  • Maxwell (a copy of your character) and a Black Hole
  • Urn (disturb it and you get a ghost)
  • Corpse + Chain + Car Battery (or Lightning)
  • Scribblenaut

Finally, just in case you want it, a complete list of all the terms the English version of Scribblenauts will recognize. Enjoy. 🙂

Posted in Web Wandering & Opinion | Leave a comment

Our Sick Society

A few months ago, my mother sent me an interesting TED talk about motivation. It turns out that the carrot-and/or-stick model for encouraging rewards stifles creativity. We need more businesses like Atlassian and Google which employ “intrinsic motivation” (you do the work because it’s inherently a desirable thing to do) techniques like “20% time” and research commissioned by people like the US Federal Reserve agrees. Fair enough.

More recently, I was reminded of an interesting article titled Against School by John Taylor Gatto that originally appeared in Harper’s Magazine. More controversial, but also well-referenced and my personal experience generally agrees. Force kids to be surrounded by other kids, doing boring work and you’ll get mostly emotionally-driven, easily-manipulated adults with the less controllable being outcasts.

It wasn’t until today, though, that I realized how it all tied together. I discovered a long but very interesting article named “Roadmap to a New Economics: Beyond Capitalism and Socialism” by Riane Eisler. The central point of said article being that rather than thinking of capitalism vs. socialism, we should be thinking of domination systems vs. partnership systems.

It seems fairly obvious in retrospect that the real root of all these problems is this “Dominate first, co-operate only if that fails” mentality that our chimpanzee instincts encourage and society strengthens, and as my mother puts it, “bullying is endemic in our society”, but it doesn’t have to be that way.

I’ll leave this on a related note. I don’t have a URL handy, but I remember reading an article a few months ago about how, all around the world, there’s a direct inverse correlation between the size of the gap between rich and poor in a society and the life expectancy of everyone, rich and poor alike. (In other words, for whatever reason, the more unequal your society, the more years lost off your life… no matter how rich you are. Personally, I suspect stress as the culprit.)

Update: Since writing this, I received another TED talk about the necessity and lack of true liberal arts education in modern western society and an article about how kids teach themselves to read… and how could I have forgotten Bertrand Russell’s In Praise of Idleness?

Posted in Web Wandering & Opinion | Leave a comment

SQL Pagination Without OFFSET

Just thought I’d look up how people paginate efficiently in SQLite since, apparently, OFFSET is just an alias for “discard N first results”. The recommended solution is to use a WHERE clause to mimic offset using the same column index you use for sorting… but that’s only really possible for “Next” or “More…” links.

I ended up discovering that MS SQL, Firebird, Oracle, and DB2 also lack OFFSET and the solution (MS SQL version) is to grab a list of primary keys which should be skipped using a subquery. (because retrieving just primary keys is faster than retrieving and discarding all the columns you don’t need)

To make sure I didn’t forget, I threw up an SQLite version on GitHub Gists.

-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6

SELECT foo, bar, baz, quux FROM table
 WHERE oid NOT IN ( SELECT oid FROM table
                    ORDER BY title ASC LIMIT 50 )
 ORDER BY title ASC LIMIT 10

While doing that, I also ran across jPaginate (demo), a jQuery pagination plugin that, as long as you provide a gracefully-degrading fallback, is probably my new favorite design for a page selector.

Update: This site is also useful.

Posted in Web Wandering & Opinion | Leave a comment

Functional Programming Concepts for the Lay Programmer – Part 1

Update: Part 2 is finally available.

Despite the growing interest in functional programming, most people (myself included) seem to have a lot of trouble grasping the core concepts and constructs. (Probably because the early adopters are all, to some extent, math geeks who have never needed to practice explaining things to the lay-person.) Since I finally decided to sit down and figure these things out, I thought it only fair that I share the Google results that led me to my various epiphanies.

Note: The closest I’ve come to actual functional programming languages is adopting parts of the functional style in Python. If my terminology is a little off but I got the gist of the thing, be diplomatic in your complaints. (I’ve had too much experience with math teachers who seem to think that it’s pointless to know how to use math without perfectly comprehending the relevant proofs and being able to write your own.)

The Easy Stuff

First, let’s cover a few things which are generally easy to understand… but only if you’ve heard of them:

Higher-order Function
A function which takes another function as an argument. To make this more comfortable, many languages treat functions and data equally. (In object-oriented languages, this is “everything is an object” taken to its logical conclusion). This allows for things like results = filter(arbitrary_test, input_data). This is an especially useful feature when combined with other features like closures. (explained later)
Pure Function
A function that only uses its arguments as input, doesn’t modify variables visible outside itself, and provides all of its output using the language’s “return” statement (or equivalent). In other words, a function with no hidden inputs or side-effects. Pure functions are a Good Thing™ because you know that, with a given set of arguments, they’ll always do the same thing. This helps immensely with testing and debugging. (and makes unit testing much easier and more reliable)
Tail Recursion
Getting loop-like behaviour by having functions re-call themselves as the last thing they do. People consider this a good thing because it lets you write loops in a purely functional fashion. (see previous explanation) Functional languages generally optimize this internally so you still get the speed and stack-avoidance of a loop.

List Comprehensions

Practically speaking, a list comprehension is just a shorthand for saying “Take the elements from list X that satisfy condition Y and perform operation Z on them, then return a list of the results”. The benefit of list comprehensions is that they’re a quick, easy, concise alternative to declaring an empty list and then wrapping a function in a for loop and an if statement. (Technically speaking, they let you build one list from another using set builder notation.)

For example, In Python, you could get the squares of all positive numbers in a list with new_list = [x**2 for x in old_list if x > 0]. Keep in mind, however, that list comprehensions aren’t limited to working with numbers. I often use one to quickly implement a simple, one-line input normalizer that, in plain English, would be “Take all lines which aren’t empty or beginning with # and strip leading and trailing whitespace.”

Monads

As one answer on StackOverflow put it, “Monads are simply a way [of] wrapping things and provid[ing] methods to do operations on the wrapped stuff without unwrapping it.” It’s a clear definition… but its doesn’t really give you that “Aha!” moment I was looking for. If you have any experience at all with Javascript, the explanations and examples in jQuery is a Monad should do just that. In short, Monads are useful for changing the set of verbs and how they behave.

The final realization of how useful they can be (and my first recognition of how nifty it can get when you mix functional and imperative styles in a compatible language came from another StackOverflow answer (same question) which showed how, in F#, you can use a monad to do Javascript-style asynchronous HTTP I/O without having to explicitly write callbacks.

Lazy Evaluation

When a programming language is given a statement or block of statements, there are various ways it can do things, ranging from fully strict evaluation to fully lazy evaluation. These are usually easier to explain with examples.

The most common subset of lazy evaluation is probably short-circuit evaluation. This means that, if I run something like fileContent = getFromCache(url) or getFromWeb(url) in Python and getFromCache returns something other than None, an empty string, or the like, getFromWeb will never run because “True or anything” will always be true, so why bother evaulating the second half? This can be confusing if you don’t expect it, but as my example shows, it can also be very useful.

As you probably guessed, strict evaluation operates on the premise that “they said to run it, so we run it… whether or not we’re throwing away the output”. Naturally, in every language, if/then/else constructs use lazy evaluation.

The area of lazy evaluation that is sometimes confusing is eager evaluation versus delayed evaluation. If you’re still reading this, you’re almost certainly familiar with eager evaluation. For example, if you look at a list, you might see something like [1, 2, 3, 4, 5, 6].

The gist of delayed evaluation is that, at any given time, that list could look more like [1, 2, 3, ...] with the language evaluating further into the “...” as needed. This is useful because you can do things like creating an infinite list (Wikipedia uses the Fibonacci sequence as an example) and then retrieving specific values from it.

On a more mundane note, lazy evaluation is also commonly used for improving program performance. For example, in graphical systems where drawing is done only at the last minute so that “Oops. Looks like those pixels aren’t visible to the user after all” doesn’t impair performance.

Haskell

I haven’t actually used Haskell yet, but from what I’ve seen, I think I’ll try to make time for it soon. (When I do, I’ll update this post) Here are the posts that brought me to that conclusion (In concert with what I’ve already linked, of course):

Among other things, I love the idea of a code repository where you can search for functions by specifying the inputs and return types you need.

Posted in Geek Stuff | 1 Comment

My First Impression of Google Wave

Well, I finally got an invite to Google Wave. I haven’t had much time to play around with it yet, but my first impression is that it could potentially be just the thing I need for collaborative story planning… once they add an export feature.

From most to least bothersome, here are the problems I’ve found so far which aren’t on Google’s list of known issues:

  1. Google seems to have no plans to open-source the web-based client.
  2. There is no export functionality.
  3. As with Google Docs, the design will eventually allow someone else to un-invite me from a Wave I forgot to save a local copy of.
  4. No end-to-end, public-key crypto offering.

Problems 1, 2, and 3 can probably be solved together by writing a custom, open-source client which treats the Wave server the same way git-svn treats a Subversion server. (Ideal, since I consider DVCS-like behaviour to be the ideal data replication model for most things)

Knowing Google, problem 4 will probably have to be solved using something along the lines of OffTheRecord which grafts crypto onto the existing system. The main issue I see being that it’ll be up to the endpoints to “induct” new clients into a wave by translating the existing encrypted history for the newly-added public key.

My overall opinion is that, until export functionality of some kind is available, Wave is a toy at best and, even with export functionality, it won’t replace e-mail or IM for me unless they offer end-to-end crypto. However, if a client-developer (Google or third-party) does offer some sort of export functionality, then it’ll be an ideal successor to Google Docs for me. (I use it only for collaboration since I deeply distrust cloud computing.)

Posted in Web Wandering & Opinion | Leave a comment