Friday, October 31, 2008

Et Tu, O'Reilly?

I've spent the past two days agonizing over Chapter 2 of "Learning Javascript." I read the chapter twice, took extensive notes . . . and just failed the mini-quiz at the end of the chapter.

It's this sort of thing that makes me want to burn computer books. Seriously.

First of all, the answers in the Appendix (p. 317) seem to have two typographical errors in them. Then, on top of that, the last question turns out to have been a "trick question." Um, yeah-- because throwing a trick question at someone on the first quiz/test, while they are trying to get the initial material under their belt and figuring out if they can trust you as a useful source of information is so productive.

I will admit-- there were some questions I legitimately missed (the single quote mark in question 3 prematurely ending the string and the asterisk in one of the variable names in question 1 being a Javascript operator for multiplication). However, I picked a different verb in my function name (returnTheMonth vs. getTheMonth) than the author did in her appendix, even though I used the same verb from her own chapter. Who writes a question based on the arbitrary selection of a verb?

Personally, I'm feeling de-motivated to re-learn Javascript right now. :(

Sunday, October 26, 2008

Javascript-- Is the third time the charm?

I don't even know where to begin with this post.

Part of the problem is, I tend to think in metaphors and observe similarities and interconnections that other people don't seem to be able to perceive. When I try to demonstrate these connections to other people, they just find it confusing. You'd think I'd learn it's a bad strategy, and yet this is how my mind operates when trying to comprehend something.

Imagine there's this doctor, and he's been practicing medicine for three decades. He's reasonably competent, works hard, but for some reason never kept up with the latest trends and changes in his field. The days roll by, and one day he's suddenly operating in a paradigm that's completely obsolete. And the scary part is, he is so out of touch, he doesn't even realize how out of touch he's become!

With me so far?

Now, imagine the same scenario, but with a web developer-- and let's be honest, a web developer most likely isn't operating with life and death stakes, so he has even less true motivation to keep up with the latest trends and changes in the field. And we all know how quickly things in web development can move and change, right?

Then, on top of all that, what if the web developer works for an organization that is large, where change is glacially slow at best? Where the majority of IT folks are clinging to best practices that have been rendered obsolete years ago-- or even outright ignored because someone decided they just aren't going to do things that way as a matter of personal preference.

I did an inventory of my situation the other day. Basically, because of politics at my workplace, I'm a ColdFusion developer who doesn't really have access to a ColdFusion server. This is sort of like being a magician without a rabbit. Sure, I can get by with static HTML, CSS, a bit of Javascript here and there-- but to really harness the power of dynamic web pages, the best I can do is a Filemaker Pro server on our Intranet.

It got me to thinking-- what's the point of learning Python or Ruby or PHP, when I'm never going to have access to a server that supports these languages? (Yes, I know, I can install Python on my local computer and leverage it without having a server-- but you know what I mean.) I need to flesh out and expand the depth of knowledge I have about tools I can realistically expect to have access to first, before I start spending time and energy learning "the fun stuff" I will never get to see.

So, I'm sorting through my mental inventory and the first thing that pops into my head is Javascript. All major, modern web browsers have support for Javascript, so if I put time and energy into learning that-- really learning it, mind you, not just learning enough to solve the current task I've been assigned-- then that ought to have the highest payoff in terms of being able to assist people at my work place. (Microsoft Access is second on my list, by the way, even though I'd be using it strictly on a network share, not a true web server.)

I made a trip to Borders this weekend and picked up a copy of Shelley Powers' "Learning Javascript" book. It has a copyright date of 2007, so I expect the information in it will be still fresh and current. I was even able to use a gift card I'd received at Christmas to pay for most of it.

(long pause) Um, did I happen to mention I hate Javascript?

See, I tried to learn Javascript a very long time ago (I think it was still in version 1.2, as I recall). I ran into a lot of problems with cross-browser support being . . . lame. (It's a highly technical term-- couldn't possibly explain it further.) I'd write a javascript that worked on one version of one browser, but then bombed horribly everywhere else. You'd have to write four different versions of your code, and then have some horribly kludgey way to "sniff" out which version of javascript you'd encountered and then play traffic cop to get the broswer to the specific version of code designed for it. Then a new version of one browser would come out, and things would break, and you'd need to revisit the whole damn program again.

Who can learn under those conditions? Where's the success? Where's the reward feedback loop?

A few years go by, and the ECMA ratifies a version of javascript, along with an API that should bridge most of the browser differences. I start dabbling with it again out of necessity (adding a "characters remaining" counter notice under a text box, as I recall) and still find it difficult going, although it's better than it was. Then, suddenly everyone and their brother wants their sites to have AJAX-- including the people who'd still be creating their relational databases as one gigantic flat file if it wasn't for me.

Which brings us to current day. I read Chapter 1 in Ms. Powers' book yesterday. It's well written, and it was an eye-opening experience. I found out that the things I had learned back in the day as "best practices" (e.g. using HTML comments to "cloak" your Javascript from browsers that don't support Javascript) are not only currently irrelevant, but can actually cause problems if you plan to use XHTML in your web pages!

(Damn, and to think that less than a year ago, I was taking Google to task for putting out Javascript code in their Google Analytics products that broke valid web pages-- and the solution I suggested was that Javascript cloaking trick. I'd like to thank the patient folks at Google for not sending me flaming emails, calling me a fossilized hacker wannabe.)

Today, I sat down and reread Chapter 1, while taking detailed notes in one of those black and white composition books. I'm hoping that rereading and writing down my observations will somehow ingrain the knowledge in my brain a little deeper-- maybe make it easier to break off my bad habits, as well as pick up new habits that are current best practices. It takes longer than just reading the chapter once would, of course, but if I want to be better than just an average web developer, I need to get to the point where I'm dreaming about this stuff in my sleep.

On the plus side, I'm at least savvy enough to have discovered an error in Chapter 1 on my own. (I'm sure it was a simple oversight and has already been detailed in some errata file on O'Reilly's web site somewhere.)

Man, wouldn't that be a dream job? Being one of the "technical proofreaders" who goes through the texts prior to publication, and get hands on with all the exercises and lessons-- making sure they work properly. Hmm, on second thought, you'd probably be stuck with the responsibility of fixing them somehow when they didn't work properly. Maybe not so cool after all.

I also need to figure out where the changes in trends related to Javascript would originate from (perhaps the ECMA?) and sign up for an RSS feed or email bulletin or something that will keep me from falling back out of date again if/when I do finally internalize this latest material.

Wednesday, October 22, 2008

Flagfox :: Firefox Add-ons

Flagfox :: Firefox Add-ons: "Displays a country flag depicting the location of the current website's server and provides quick access to detailed location and webserver information."

NOTE: I'd originally hoped to review "TwitterFox," but I've spent the past week trying and failing to get it to work properly. To be fair, I can't tell if the issue is with the extension, with the Twitter service, or perhaps even something in my account settings-- so rather than write a bad review, I decided to pick a different extension. If you are currently running Twitterfox, drop me a line-- I'd like to hear what your experience with it has been.

Quick Review: Thumbs up; works as advertised.

Details: It's called the WORLD wide web for a reason-- because web-serving devices can be located anywhere. At its simplest this extension, displays a county flag up in the address bar that corresponds with the geographical location of the web server. You go to a page hosted by a server in the UK, you get to see the Union Jack. You go to a page hosted by a web server in the United States, you get to see the American flag. Sometimes, you get a surprise and discover that servers you assumed would be located in one country, are actually co-located in another.

The preferences for this extension reveal more sophisticated capabilities-- by default, a left mouse button click will open a new tab with lots of interesting geographical information courtesy of geotool, while "middle clicking" will invoke a WHOIS search. You can override the middle click function with your own custom action as well, by entering in a URL that makes use of macro variables.

Tuesday, October 14, 2008

Fast Dial :: Firefox Add-ons

Fast Dial :: Firefox Add-ons: "Fast Dial replaces blank tabs with a panel of thumbnails of your favorite sites."

NOTE: Technically this isn't a *new* extension, but it was updated on September 19th. It adds a sexy feature to Firefox that we've seen regain new popularity with Google Chrome's debut (but for the record, Opera did it first).

Quick Review: Thumbs up; works as advertised.

Details: If you've tried Opera or Google Chrome, you've seen their "Speed Dial" feature. This extension, Fast Dial, adds that same capability to Firefox. Whenever you open a new/blank tab, the Fast Dial thumbnails appear for your convenience. This extension is very customizable, letting you pick the size, colors, number of sites in the grid and so on. It works as advertised, does not seem to have any conflicts with other features or extensions.

The only "bad" thing about this extension is that there's no option to "automagically" populate the "Fast Dial" grid with the web sites you most frequently visit. I'm not convinced this is a bad thing necessarily. Entering your "Fast Dial" sites is a manual process, but it's no more complicated than navigating to the site you want to add, and clicking the star icon in the address bar.

Saturday, October 11, 2008

Firefox Extension Reviews?

I have this idea for a new feature-- a weekly review of a new/random Firefox extension. It seems like an good idea, but there's a snag. Since I'm still running Mac OS X 10.3.9 (Panther), I can't upgrade to Firefox 3. Many of the recent extensions are designed for Firefox 3, so . . . well, you're smart, I think you can see the problem.

Yes, I could buy Mac OS X 10.5 (Leopard) for about $129. But I'm in the middle of a home renovation project. Also, I'm not shelling out that kind of money just to do browser extension reviews. Besides, to tap the full potential of Leopard's software features, I understand you want to run it on the Intel chips-- not the G4s.

However, there is a PPC version of Ubuntu Linux 8.04 ("Hardy Heron") that runs nicely on the G4 hardware. And Firefox 3 works just fine on it.

What I'm saying is-- I've made a change from Mac OS X Panther to Ubuntu Linux Hardy Heron as the new default boot option on my personal laptop.

I suspect this will go beyond simple reviews of Firefox extensions very soon.

Which reminds me-- when are we going to see Google Chrome for Linux?

Tuesday, October 7, 2008

textually.org: Lightbulbs Could Replace Wi-Fi Hotpsots

textually.org: Lightbulbs Could Replace Wi-Fi Hotpsots: "Boston University's College of Engineering is launching a program, under a National Science Foundation grant, to develop the next generation of wireless communications technology based on visible light instead of radio waves."

Maybe I just don't "get it", but why is this news? We'd used infra-red spectrum to exchange data for years with the old Palm Pilots, and you remember how much of a "line of sight" nightmare that was. Isn't this just the same concept, but in the visible spectrum? Maybe this implementation will be more robust with LEDs.

Just promise me, please, no more of those creepy, uncanny valley animatronic Teddy Ruxpin dolls that "interact" with your television.