nutritious syntactic sugar

Is syntactic sugar just tasty, or does it actually improve the language? Depends on your definition of "improve," I suppose. I just found a ruby idiom in Agile Web Development with Rails that can make a very common, wordy coding task short and clear. We often have to say "give me a thing, and if it doesn't exist yet, make one for me."
In Java:

public cart findCart() {
if (cart == null) cart = new Cart();
return cart;
In Ruby, this can be expressed as...
def find_cart 
session[:cart] ||=

The or-equals operator belongs in a dynamic language, where expressions that evaluate to booleans can also be very nice rvalues. These three lines of code show off a few things about Ruby that might be mistaken for syntactic sugar, but actually make the language better:

  • Avoid unnecessary punctuation.

  • Clean syntax for hashes make them almost as readable as member data accessors

  • Most statements are also expressions.

  • Implicit returns.

It's delicious... and nutritious!


Over-Preparedness Vindicated!

Last winter I posted the contents of my personal geek security pack: some money, some painkiller, some duct tape, a BART ticket, a snack, that sort of thing. Since then I've been carrying it around in my backpack.

In an incident involving an ice cream sandwich and an intra-pocket butter malfunction, I lost my wallet a few days ago. In Berkeley -- that's a large bay away from San Francisco. No problem! Well, okay, yeah, it was a problem, but the problem-ness was much ameliorated by having a BART ticket and twenty dollars cash in my personal geek security pack. I used the money to buy a bus ticket back to look for my wallet at the site of the ice-cream-sandwich incident, then retreated to San Francisco with the loaded BART ticket.

The wallet hasn't turned up, but I've got spare ID tucked away in a safe place (not at home!) and a bunch more cash on my refrigerator door. Over-preparedness: vindicated!

Now-- everybody go back up your data! And store the backups off-site! And put twenty bucks in a secret spot in your backpack! And for the love of Pete, don't put butter in your pockets!


Slow news is good news?

I rarely read news online. You might think that leaves me out of crucial blogosphere zeitgeist or military-industrial-political news, but nope: my co-workers filter the web for me, forwarding articles about OpenLaszlo, net neutrality, software-as-a-service, and media business models; and I read messenger-bag-loads of books and magazines. Each month, I read Harper's cover-to-cover, with a liberal (heh) dose of the Atlantic, Utne Reader, MIT Technology Review, San Francisco, and occasional forays into The Economist, and the Sunday New York Times. Then a year or two after things happen, I read non-fiction books: The Looming Tower, the Great Deluge, the Assault on Reason, the Shock Doctrine, that sort of thing.
Reasoned slow analysis with editors and proofreaders and fact-checkers, passages I can go back to years later (without the internet way-back machine), passages that authors will have to stand by for decades, footnotes -- yeah, I'll pay for that. What would the invasion of Iraq look like two years later? A fiasco. What about the Thanskgiving 2007 travel breakdown? Check back in two years and I'll have read some reasoned analysis, complete with footnotes.


TurboTax Wins Me Over

After I posted a complaint yesterday, TurboTax responded to me with superstar customer service. Bob Meighan, the VP of TurboTax, posted a response to my blog entry, and Becca from customer support wrote me a long detailed response, in which she offered to refund my fee for the online service. She explained that with a situation like that, real-time tech support would probably have been able to help me, and pointed out that perhaps my anti-virus software was the culprit. On my PC, I run an out-of-date version of Symantec Anti-Everything, which I haven't tweaked at all (assuming that I'm just hosed no matter what) so Becca might well be right about my anti-virus software interfering.

So, I'm getting my $109 back, and next year I'll use TurboTax Online again.

My original point, with all of this, was that sometimes RIA's can be better than desktop applications, even for single-user applications where security matters. By sending all the information over the relatively straightforward, universal https protocol, application developers can shield users from network vicissitudes, while still providing as much security as direct connections from desktop to server.

Granted, in an RIA model for TurboTax, I'm sending my financial information to Intuit, who then has the chance to do Evil Things with it -- but really, when I hit send on TurboTax Desktop, I have no more reason to believe that Intuit isn't caching and analyzing my data than I do with TurboTax Online. Once my financial information leaves my LAN, it's basically "out there," and I have no illusions about "privacy."


TurboTax Web vs TurboTax Desktop

I just finished filing my 2006 taxes, an activity made significantly more difficult by TurboTax. The desktop edition of TurboTax was unable to update itself, on my PC running Windows XP, despite hours and hours of trying. The one-click update didn't work; it didn't give me any feedback at all about whether it succeeded. The manual update looked like it worked, but the application kept telling me that I needed to get updated forms, which were not yet available from TurboTax. In September of 2007, the software promised that the forms would be ready by January 12, 2007. Er, what? In October of 2007, I got email from TurboTax saying that those forms were now ready -- bizarre since everyone else needed these forms in April 2007. (I'm not talking about obscure forms here; just Schedule C.) So I try again to update my desktop TurboTax, and once again it fails. I go through some insane machinations from the support site ("open the command prompt and run this command: ping -mysterious -incantation) to discover that my fragment size was insufficent. More TurboTax forums, and I learn that I have to set the MTU size on my router. Joy, joy -- my cable gateway (blazingly fast, blazingly expensive) doesn't allow the user to set the MTU. I don't blame Cisco, here -- I blame TurboTax, for not being able to cope with a net connection that handles everything else I throw at it. BitTorrent? Fine! Downloading 50mb installers? Fine! Sustained ssh connections for days? Fine! Downloading tax forms: nope. Ridiculous.
At this point I mailed Intuit for support. They got back to me a few days later, and told me to do the things I had already done, which I had explained in my support request that I'd already done them. They told me to call them for support during business hours. I have a job, people. TurboTax was supposed to be convenient and there was supposed to be readily available technical support.
But I needed to get my taxes done, and I could see that getting on the phone with them wasn't going to be helpful. I realized that I could avoid this subtle network incompatibility if I used the web-based TurboTax. Alas, web-based TurboTax can't import an incomplete return from desktop TurboTax, so I had to re-enter all my information. The tab key didn't work as nicely to move between fields as it did on the desktop application, but it was usable. After spending an hour or two filling out forms, my taxes were submitted and accepted.
The lesson for TurboTax is... if connecting with your big fragment sizes fails with a desktop application, try making the connection over http or https. Yes, even desktop applications can connect over http.
And: Intuit, make live tech support available by phone 24/7 before October 15, not just before April 15.

Page 1 ... 5 6 7 8 9 ... 51 Next 5 Entries »