jQuery – the good, the bad and the unknown

jquery code
A portion of some test jQuery code I dug up for this entry.

I was messing around with jQuery this weekend – we are interested in jQuery at work, but don’t currently support it.

I’ve been working – just on and off – with jQuery for a couple of years, and I have some strong opinions about the – what should we call it? – the JavaScript framework.

The first, and most important, is that I think it is going to be the defacto JS framework (if not already), which is one of the reasons I decided to dive into it. Powerful, and a lot of future potential.

That said, here are – to me – the current strengths and weaknesses of the framework:

The Good

  • It makes some complex JS tasks pretty simple. For example, the hide/show of a DIV is a basic JS device. Pretty easy in JS, but with jQuery, one can do the same but with animations (face, slide up/down). Sexy and simple.
  • For the most part, the promise of jQuery has been like the (sorta false) promise of the compiled language Java: Write once, run anywhere. For the most part, jQuery code behaves the same on virtually all platforms/browsers. Sure, there are bugs, but as anyone who has had to run JS (or HTML) against a wide variety of devices, all I can say is jQuery is a time-saver. You still (should always) test, but fewer cross-platform/browser issues pop up. This is, of course, a veddy good thing.

The Bad

  • jQuery is a wrapper around JS, and the wrapper makes for ugly code, hard to follow. Mix jQuery with regular JS, and it’s just a mess in many cases.
  • Debugging jQuery is tough: Even if the full (max vs. min) version of jQuery is installed, debugging is very difficult due to the wrapper notion of jQuery. This’ll improve in the future, but right now, no tools really work as well on jQeury as they do on non-wrappered JS.
  • Like many plug-in environments, jQuery makes the hard simple. Which is awesome. Until someone requests the slightest change. Then, the non-JS developer will be lost.
  • In many languages, the dollar sign ($) marks a variable – i.e $firstname=”John” In JS, there are no dollar-sign variables – var firstname=”John”. OK, not a biggie, but — jQuery introduces the dollar sign as an object variable marker. Confusing. Let’s say there’s a DIV with an ID of “fadeMe” and we want to hide it as an onClick event:

    $(“#fadeMe”).click(function() {
       $(“#fadeMe”).slideUp(4000);
    }) // end fadeMe click event

    This’ll hide the fadeMe DIV (fade away) after four seconds, but a weird soup mix of $(# and so on. And get a parens or bracket or sqiggly bracket (braces) wrong: well, it all bombs. Make Perl punctuation soup look sane. (NOTE: But still powerful – will animate (slide up) this DIV over the course of X seconds with minimal code.)

The Unknown

  • The JS wrapper is rapidly changing, which is good – it’s addressing shortcomings and adding functionality – but it’s also problematic for legacy code. Function x() needs to be changed to xy() or won’t return expected result and so on. This is true of all languages/frameworks, but jQuery is moving at an exceptional clip.
  • JS has been around for almost 20 years (launched as LiveScript), but it’s only caught on in the last 10 years (DHTML) and really gotten hot in the last five or so years (AJAX!). jQuery has, as of late, helped fuel this acceleration. What’s next?
  • Mobile is all the rage these days, and I’d be stunned if there isn’t some sorta jQuery mobile movement out there. I’m not a mobile developer, but I’ve heard/read nothing about same – but I’m sure something’s there.

House of Cards

ON THE TUBE:
House of Cards
Starring: Kevin Spacey, Robin Wright, Kate Mora

This Netflick-only political potboiler (now on DVD) is The West Wing written by Darth Vader.

Spacey is the centerpiece of this series, who – along with the help of his very politically savvy wife (Wright) – tries to consolidate power and use that not for his constituents or the good of the country, but to advance his own agenda, which is the career of his character. (If it helps others in the meanwhile, well, that’s gravy and makes for a good soundbite with which to raise money.)

The whole series (which has been renewed) is a cliche of sorts: The show examines power vs. money, good vs. evil, does the ends justify the means, why we make the choices we do and so on. Sounds like a yawner.

It isn’t. Surrounded by a stellar supporting cast, Spacey still stands out as the most interesting character. (To be fair, his pronounced South Carolina drawl fades as the series go on….). And there are multiple plot threads going on at once, some that intersect, others that may, but have yet to, converge. Season Two will be interesting.

I’ve catagorized this as TV, as it is episodic, but is it TV? Not a movie, as it was never on the big screen. But had I watched it streaming to my computer/mobile device, would it still be TV? Interesting gray area.

All reviews

New review added.

Read all reviews.

I Have a Dream…



It’s been 50 years to the day that the 1963 March on Washington culminated with Rev. Martin Luther King’s “I Have a Dream” speech on the steps of the Lincoln Memorial, facing the crowd that had gathered east of the memorial on the Washington Mall.

I was only four years old at the time, and while I do remember JFK’s funeral procession on TV that November, I don’t remember seeing this event unfolding. (Hey, my Twitter account wasn’t yet active…)

Dr. King said, in part:

I say to you today, my friends, though, even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream. I have a dream the one day this nation will rise up, live out the true meaning of its creed: “We hold these truths to be self-evident, that all men are created equal.”

I have a dream that my four little children will one day live in a nation they will not be judged by the color of their skin, but by the content of their character.

Fifty years on, has this dream been realized? Or is it a dream deferred?

This is not a judgment; it’s an open question. While there have been huge strides in civil rights since the 1963 march, have we – as a nation/world – evolved? How about for other minorities, such as LGBT individuals or women.

Or Muslims in the US.

Or the issues over illegal immigrants that has (thankfully) bubbled to the surface over the last year or so.

And so on.

What happens to a dream deferred?
Does it dry up
like a raisin in the sun?
Or fester like a sore —
and then run?
Does it stink like rotten meat?
Or crust and sugar over —
like a syrupy sweet?

Maybe it just sags
like a heavy load.

Or does it explode?

Langston Hughes, Harlem

Journalism today

ON THE TUBE:
Veep Season One
Starring: Anna Chlumsky, Julia Louis-Dreyfus, Matt Walsh, Reid Scott, Tony Hale

This HBO political comedy has more in common with “The Mary Tyler Moore Show” than “The West Wing,” but it has a wicked edge and promise for future seasons.

The show circles around Dreyfus’ character, a rising senator whose presidential run crashes and burns, and she is forced to accept the Veep slot (and wins).

She finds that, as VP, she is in an unusual limbo where she is one accident/breath away from the most powerful position in the world – but, as Veep, has far less power than she had as a senator.

And – of course – hilarity ensues.

The writing is a little rough in this first season (here’s hoping for season two…), but the cast is top notch, with running jokes that aren’t dwelled upon, and dialog that I’d be surprised is all scripted. Improvisation seem to really help carry the show.

Great show? No. But it’s in the vein of “30 Rock” – funny, topical and just enough out of the mainstream to have extra cachet. And since it’s an HBO show, plenty of f-bombs. You have been warned.

All reviews

Well, there have been about 100 million stories about the upheaval in journalism over the last [pick your time period], but the last few weeks of journalism upheavals have been more interesting than most. Mainly because the events that have transpired recently are not part of the “slow decay of traditional journalism/print” story arc, but really are milestone events.

Consider the following:

  • Newsweek announces sale; print publication to cease (8/3/2013): While not a surprise to anyone with any inkling of the current state of weeklies, the sale was noteworthy for two reasons: 1) It leaves only one news print weekly standing (Time), and 2) It sold to IBT Media. Who are they?? – That was my reaction, as well as many of those who wrote articles about the sale.
  • Boston Globe sold (8/3/2013): Purchased by The New York Times about 20 years ago for $1.1 billion, the paper is sold to the Boston Red Socks’ principal owner John Henry for $70 million. That’s an enormous drop, and a blow to one of the nation’s most respected publications.
  • Jeff Bezos – not Amazon – purchases the Washington Post’s print and digital products (8/5/2013): An online visionary buys a print publication? I dunno – I think this is a good move for the Post. Print is struggling, and if anyone can make a go of it in some shape or form, it is someone like Bezos, who takes a long-tail view of business. (See Farhad Manjoo’s excellent article on same.)
  • Patch.com announces cuts (8/16/2013): AOL’s ambitious content farm/hyper-local sites experiment announces significant cuts – roughly 50% of staff and about 60% of its sites. Not exactly good news for this so-called “new” form of digital journalism, especially by a giant like AOL (yes, it’s past its glory days, but AOL is still huge, especially in content – it’s the parent of huffingtonpost.com and techcrunch.com, for example).
  • Interesting note about Patch layoffs (8/17/2013): As noted by allthingsd.com’s Peter Kafka, online layoffs are cheaper than dead-trees layoffs. New Media Pink Slips Cost Less Than Old Media Pink Slips

Any of the above events, taken alone, would be newsworthy. All of these together, in such a short interval, give one pause.

I don’t think journalism is going away – I think it’ll, to some degree, change. And right now, we’re in the middle of the big shake out: Experiments will launch and succeed/fail, we’ll move away from the old before slowly gravitating (to a degree) back to the same.

One thing people keep forgetting is that print media is not dead – it’s actually thriving.

But now much of it is digital print: blogs, tweets, online niche sites and so on.

People I know are reading more fiction/non-fiction thanks to eReaders (of whatever flavor); tablets and smartphones have a lot of those who never got newsprint on their fingers to read the NYT or Chicago Tribune on their devices.

Journalism – and print/digital publication in general – is in chaos right now, no question.

But it’s not dead or dying.

Just rearranging itself. (See the Patch – a new media company – site and its issues.)

Radio was supposed to kill print. It didn’t.

TV was supposed to kill print. It didn’t.

The internet is supposed to kill print. So far, not so much.

One final caveat: The internet/devices may well kill physical print, but they won’t obliterate the need for good, concise, accurate journalism. Or entertaining fiction/non-fiction. That’s the big take-away here.

TV today

ON THE TUBE:
Damages – Season 5
Starring: Glenn Close, Rose Byrne

The final season of Damages did not disappoint – Patty (Glenn Close) was just as evil as ever, and the first couple of episodes gave away so much that one wondered how they could keep up the suspense.

It did.

After a disappointing – to me – Season 4, Season 5 was almost as good as Season 1. Close and Byrne are both brilliant, and the writing carries this franchise.

Unresolved issues? Sure – but that is (sometimes) – the fun. You try to fill in your own blanks.

Could this series have ever happened on network TV. Probably not. (The Good Wife is close, but not as bitter.)

Good TV

All reviews

Watched the last season of “Damages” this weekend (only 10 episodes), but – I’m sorry – any single episode of this show is better than most network shows (of similar caliber Update: By caliber, I mean a serious show that tries to be intelligent and entertaining; not so easy to pull off).

“Damages” is a bit of a soap opera, but done, so so well.

Watch.

WeinerGate – Part Deux

I don’t have anything to add to the latest Weiner relevations (that he continued to be an internet horn dog even after he was very publicly busted for same), but I think the online treatment of this event is … interesting. Especially the pictures.

Small sample:

Draw your own conclusions (all screenshots ~ 9pm CDT 7/23/2013)

I dunno. Do we have the beginnings of the next “The Good Wife”?

A Death in the Family

And by “the family,” I mean the computer tech community.

And by “a death,” I mean a loss of sorts.

We’ve had a few recently.

  • Douglas Engelbart pases away: On July 3, 2013, Douglas Engelbart died at 88. Known for his famous, waaay ahead of the (tech) curve “The Mother of All Demos,” Engelbart helped change the way we thought/think about/interacted with computers and, well – frankly – information.
  • AltaVista goes offline: On July 8, 3013, AltaVista – once the go-to site for search – was no more. Bought (apparently) by Yahoo!, it became one of the casualties of Yahoo’s continued effort to make itself viable. I don’t blame the company, but it’s still sad: Before Google, there was AltaVista – really, the first search engine that was powerful. (Inktomi – which powered HotBot – was cool for a year or two).
  • WebTV death sentence announced: In early July, Microsoft announced that its WebTV property (now called MSN TV) would be shuttered Sept. 30, 2013. I was never a fan of WebTV, but I had to deal with WebTV customers for the web property I was working for in the very late 1990s, and boy, did the folks who had WebTV love it. Mainly (from my conversations), male retirees, but they had no use for a computer, and if other sites worked on their WebTV, then dammit!, so should our site (they had a point…). Yet WebTV never really caught on – at the time I was dealing with the WebTV customers, our site was getting more traffic from Lynx – a text-based browser (mainly *nix) – than WebTV. Whatever. In a short while, it’ll join Netscape, Mosaic and other broswers in software heaven. But honestly – if you heard this announcement, wasn’t your first thought, “Wait – WebTV’s still around??”
  • PCWorld magazine exits prints: In another one of those “it’s still around?” moments, PCWorld magazine has announced that the August 2013 issue will be its last print edition, as it focuses on its website and digital edition. No surprise, but just the end of an era. PCW was the biggest of the computer magazines, and lasted way longer than most could have expected. Does anyone under 45 or so even recognize IDG or Ziff-Davis as magazine publishers?*

The computer world is relatively young. Whether you mark its beginning in the 1940s with ENIAC and Bletchly Park – WWII efforts, or the advent of Unix/C in the early 1970s (and resulting mainframes/heavy iron), or even the advent of the personal computer/internet in 1980s & 1990s – the computer industry is young.

While the industry is growing like kudzu, it still takes some time to where it’s so old that one notices the passing of entrenched players, be they tech, software, people or protocols (remember GOPHER??). We’re getting to that critical mass, which is why the passings noted above are, well, notable.


* Cynical bonus questions: Does anyone under 45 recognize what physical magazines are/were? Do they read same as dead-tree editions?

One next step for mobile

ON THE TUBE:
Alias – Season One
Starring: Jennifer Garner (and others)

The pilot of this show – a two-hour premier – is, in many ways, the best pilot I’ve seen since The West Wing. Smart, sexy, kick-ass and so on.

I’d heard a lot about this series (debuted in 2001), but never got around to seeing same until recently.

Worth watching.

Update: Plot late s1 and s2 silly. So much so that I’m going to have to think hard and long before watching any other episodes. Sad.

All reviews

I’ve only had a smartphone (iPhone 4s) for about 18 months, but it’s definitely changed how I do a bunch of stuff on my “phone.”

I even use it – on occasion – for phone calls!

I’m not at all a mobile power user, and that’s sometimes a good thing – you see that others have created work-arounds/excuses for lack of conventional desktop activity. And power users often have all sorts of reasons as to why is or that isn’t mobile native.

Stuff that should be there (mobile) but isn’t. (To me.)

My current gripe: Search within a search

Example 1 – IMDB.com rocks; I use it all the time. I think I like the mobile app (for the most part) better than the desktop experience in many ways.

But here is how I often use IMDB: Watching some show. Who is that? Hit the TV episode/movie on IMBD (mobile or desktop), and then wait until I know that character’s name: On desktop, hit Cntr-F or whatever and get highlights on character called, for example, “Linus.” (I just saw Argo, listed 219 actors: with search, no biggie. Scroll/flick to see all of those WITHOUT highlighting/anchors/whatever…icky.)

No equivalent for mobile. Have to scroll through and find, potentially, which Linus is the actor you remember (to get filmography so you can see why you did/didn’t know this actor).

Example 2 – We recently used a smartphone voice search to find a Mexican restaurant in a certain city. Didn’t want to say name of restaurant, because will voice recognize the foreign name – and do I have the foreign name correct?? Like with IMDB, got a list (with links to call and so on…awesome), but in a browser, I’d get results and then do a secondary search of those results (’cause most search today is for the first page of results…another story).

Just a thought – and the secondary search (the Control/Apple-F or whatever) could easily be a search (voice, preferably) within the search via mobile.

But – right now – I don’t see it.

And – if it’s there and I just don’t see it – well, that’s a problem, too. And not just for me.

Why CNN is in decline…Part XXX

The actor James Gandolfini, perhaps best know as Tony Soprano on the TV series The Sopranos, died unexpectedly today at the age of 51.

Here’s how CNN.com reported same:

Here’s NbcNews.com’s take:

Which is more “journalistic’ (not to mention respectful) of the two?

Weather Alert – Nerd Style

Dark Sky

Sometime last year, I became aware of an iPhone (I’m on 4s) weather app called “Dark Sky.”

I downloaded, and was blown away. It’s not your traditional weather app (Temp/Humidity etc), but it was more of a forecast app: It would say “Light rain in 20 minutes” – and it would be correct!

A month or two later – I dunno – I ran across a mention that the Dark Sky folks had a web site for weather forecasting, Forecast.io.

It’s amazing.

Totally accurate? Nope.

Impressive in its depth? Yep.

Slick design? Yep deux.

One of the things that caught my (nerdy) eyes was that they had an API of weather data – and free for the casual user (1000 free hits per day; each 10k after that $1!).

So I signed up, and got to work integrating it into my geistlinger.com site.

Geistlinger.com weather integration
Forecast.io data on Geistlinger.com

The fun part – and the rough part – was integration entailed the following to make it “work” for me:

  • API call to forecast.io
  • JSON response
  • Use PHP json_decode () function – new to me – to parse the JSON response
  • CSS3 (rounded elements and so on)
  • HTML5 – Canvas elements (and hacking same with JS)
  • Create weather display area (PHP include)
  • Jquery to toggle between current and detail screens (still working on same; not quite the UI I want)
  • JS AJAX call to get the new data, parse the JSON, pass necessary data back to JS, and then (re-)populate the data points

For me, that’s fun. And right now it works.

Whoo-hoo.

Next: Geo-location, so I can display weather where you are, not where I am. Hmm…good thing?

I needs to do more work with APIs – I love Google Maps, Forecast.io is great. I’ve got to delve into more mashups – work, but fun (dorky) work.