Yes, I am obsessing but not about what you think
Posted by aogWednesday, 19 November 2008 at 21:21 TrackBack Ping URL

I have been quite caught up in learning some new code slinging technologies these last few weeks. I am in the midst of upgrading my Movable Type plugins to version 4.2 because we’re using that in another project and I figured it was about time to look at upgrading (I’m still running 3.3X here). There was also this one plugin that had been creaking along in a barely usable state since 2.64 that I thought would be a perfect vehicle for also learning Javascript and doing cool Web 2.0 stuff. Ah, what a time sink that simple upgrade turned out to be!

For the geeks out there, I eventually settled on jQuery as my base Javascript library. I actually liked MooTools better in terms of programming but all of the projects I forsee for my Javascript mad skillz involve running in already Javascripty environments and MooTools doesn’t play well with others1. jQuery, on the other hand, does. It’s still a reasonably good library although I spent this evening fighting with a bug that I consider a design flaw in the library but I am feeling much better now (I was almost driven to uttering profanities).

But here’s my favorite thing about Javascript that I have learned this week:

This is valid Javascript —

 return { opacity: 0.5
        , helper: 'clone'
        , distance: 4
        };

This is not —

 return
    { opacity: 0.5
    , helper: 'clone'
    , distance: 4
    };

Why, since white space is supposed to be just white space? I have no idea. What’s even funnier is that this code is valid —

 var zreturn =
        { opacity: 0.5
        , helper: 'clone'
        , distance: 4
        };
 return zreturn;

When you figure that out, let me know.

As part of my attempt to hand with the cool Web 2.0 crowd, I have been working with JSON as a remote procedure call serialization. I have liked it for a while because it is extremely similar to my own design for an internal project at my former employer, but was rejected because another team couldn’t see the utility of it. Well, how the worm turns some times…2

I have also been struggling with a lot of computer hardware problems, which I am not yet at the end of. After fighting with 2 other boxes to get them working, I finally ordered a new chassis and CPU for a third failing box. I tried putting it together tonight and naturally the memory in the old box doesn’t fit in the new box. Sigh. At least memory is cheap these days. And graphics cards — the new chassis had on board better graphics hardware than the hot (when I ordered it) graphics card in the old box. That card will end up going to yet another box I am upgrading so the kids can game on it (Girl Three’s computer is literally older than she is and why should a four year old suffer from inferior computational hardware?3).


1 Many of the nice things about MooTools stem from this design decision, so it’s not a matter of finding some other library with what I like that does play well with others.

2 I learned a lot about type systems in those days and eventually decided that such things have a “deadly middle ground”. Any type system should either be very simple (like Perl, Javascript, or JSON) or very general and powerful (like C++ or CLOS). Inward from those extremes you end up paying for the complexity but not getting the key benefits. It’s like an inverse Laffer curve.

3 As I was typing that, she was running up from the basement calling out for help to get her computer fired up so she could play her Barbi / Horse / Princess game.

Comments — Formatting by Textile
pj Thursday, 20 November 2008 at 12:34

Isn’t it easier to upgrade to WordPress than MT4?

Annoying Old Guy Thursday, 20 November 2008 at 12:58

No. I have looked at WordPress and I just don’t like it.

  • It’s live data, not static, so if your database goes down (or for some reason connections stop being accepted) your website is dead. I could delete my database entirely and the only effect would be no more comments.
  • MT has its architectural issues, but WordPress is a serious mess, with direct SQL logic embedded in the presentation layer. Ugh! The MT 4.2 object persistence model is actually quite nice. Creating DB tables is simple, requires no SQL, and sets you up for automatic upgrades when you change your table layout.
  • I have far more experience with Perl than PHP.
  • Learning Javascript would take the same effort either way.
  • I would have to rewrite my plugins for WordPress, if that’s even possible, rather than just upgrading them. The amount of effort directly related to MT is small, most of it is in learning other non-MT technologies (like Javascript and Web 2.0).

If you’re just a content provider, then I can see the attraction of WordPress. But if you’re a hobbiest as well, Movable Type seems a far better choice to me.

cjm Friday, 21 November 2008 at 09:32

given how ugly the syntax is for sh programming, that little javascript “feature” is not so bad. who comes up with these crappy languages anyway.

in general i don’t care for scripted languages.

Annoying Old Guy Friday, 21 November 2008 at 09:50

But how did they get the parser (at least two different ones) to do that? I would think the lexer would render them identical by the time the semantic parser gets the tokens.

Why don’t you like scripted languages? I don’t find them all that different from compiled ones in terms of coding in them (although perhaps my CLOS experience colors my view there).

cjm Friday, 21 November 2008 at 11:47

clearly they are not treating line breaks as white space as your example demonstrates — a weird anachronistic “feature” for a “modern” language.

the two main reasons i don’t like scripted languages are:

1. generally they lack decent debugging facilities 2. they tend to do a lot of stuff “automagically”; like how Perl will create a variable for you if you reference it somewhere (it doesn’t require the variable to be formally declared)

most languages are pretty samey in terms of what they directly offer, so for me it comes down to what kind of libraries are readily available, the tools to work with, things like that. from that perspective, Java and Eclipse are my favorite language+tool environment ever. The msft dev tools are ok, for the small amount of C++ coding I do, but they are not nearly so powerful or complete as Eclipse.

Annoying Old Guy Friday, 21 November 2008 at 16:20

Debugging for some of the languages has come a long way. Komodo has a very nice debugger for Perl, which even lets you debug live scripts on a remote web server.

There are some debuggers for Javascript (MS Visual Studio, for one, and Komodo as well) but those are more difficult to set up then debugging via logging.

I don’t know about Eclipse for C++. SWIPIAW tried using Eclipse to do C++ development and every time I had to help her it was like regressing to graduate school — the debugging didn’t seem any better than what I had then. Visual Studio, on the other hand, has the best C++ debugger I have ever used for any language.

Post a comment