July 2011

You are currently browsing the monthly archive for July 2011.

I don’t think I’ve documented my Mac apostasy by this point. I feel like I should, but maybe another time? The point is that for everything but video games, I prefer MacOS, which recently saw an upgrade, 10.7 aka Lion.

autocorrect

I didn’t realize this was going to be as big a deal to me as I thought. Actually, I’d forgotten about it entirely until I started writing a couple of blog posts. Thus I was pleasantly surprised when I realized the built-in autocorrect is actually pretty handy. The vast majority of the time it does the right thing! Were I using Vim to do most of my writing, it might not matter so much; Vim has so many handy motions that it’s easy to jump between words, sentences, and lines in order to fix mistakes quickly. For a standard (read: less arcane) input method like this one, though, I’ve only got the standard ctrl-a, ctrl-e, alt-left, alt-right, and so on. Having the OS correct the litany of stupid typos I make regularly helps.

I had sort of wondered why this wasn’t an OS feature in the first place. Input fields are common as mud and autocorrect has been a feature in word processors for a long, long time. So why isn’t it in the OS? Who knows? It is now.

Irrationally, I worry that a feature like this will erode my typing accuracy.

fullscreen apps

To some extent, I’m being conspicuous when I use them. There’s no real reason that I need to use Safari fullscreen while blogging. After all, Chrome is my main browser. But it does have a nice way of focusing my attention. I’m also trying out Apple Mail, and segregating it to its own space means I’m less likely to fidget with checking it.

mission control

I was a litte worried about Mission Control doing away with Snow Leopard’s way of laying out windows via Exposé. Leopard laid out windows sort of haphazardly and without obvious consistency. Snow Leopard made it into a grid layout, which made it a little harder to figure out which window was which but looked a lot neater and cleaner overall. Mission Control looks to restore it back to a semi-haphazard layout, grouped by application, which seemed like a loss of functionality.

What rescues it is the presence of a gesture for application-level Exposé. With that, I don’t have to Cmd-` my way through two or more Chrome windows. I’m not sure how useful Mission Control’s facility for selecting one or more of an app’s windows is, though.

launchpad

It’s pretty! I’ll give it that. But I am not sure how useful it is.

It looks like it finds all of your apps, which is a good thing overall. It’d be dumb if it didn’t.

However, putting them into iOS-style folders and whatnot is odd. For example, I’ve got a bunch of git clients (Tower, GitY, GitX, GitHub) sitting in my Applications folder. There’s also a Development folder in Launchpad. Except it actually corresponds to /Developer. When I moved my various Git.* apps around in Launchpad, it created /Applications/Developer which had only the Git.* apps in it.

Call it a leaky abstraction, I guess. Or a corner case, given that the majority of apps go under /Applications in any case.

scrolling, gestures

I’m fine with the new scrolling. I guess I’ve lived with it for a week, like I said I would, and I don’t feel like turning it off.

The gestures are kind of messed up out of the box, though. Two finger swipe for fwd/back is fine in theory but it doesn’t work at all in Chrome (expected; I presume they’d have to make a code change) or even System Preferences (!). It’s easy to switch it back to three finger swipe, and I did that.

I like the new scrollbars, although once again they’re hideous in Chrome. Chrome still has the old scrollbar gutter, and the gray scrollbar is always present. The Chrome team is working on it, or so I hear.

TTFN

That’s all I’ve got for now.

I sort of want to write something about Resume and whatnot, but I’m out of steam at the moment. Perhaps another time. John Siracusa’s excellent review of Lion covers this in more detail, and he probably says it better than I would anyway.

Tags: ,

Java & Me

I’ve been coding lately, and fortunately or unfortunately, it’s Java. I hadn’t done much Java before I started working on this current project; my experience before this was with C++ in college, a bunch of Python, a splash of Ruby, a bunch of JavaScript, and a very small pinch of Objective-C/CocoaTouch.

It’s JavaScript and Ruby that’ve influenced me most lately. Functional patterns in particular have attracted my attention. I really dig stuff like this in Ruby:

open('somefile').readlines.each do |x|
  print x
end

And then I spent a whole boatload of time in JavaScript, where you get to do stuff like this:

var someArray = [1, 4, 2, 3, 5];
goog.array.forEach(arr, function (e, i, a) {
  console.log("Here's a number: " + e);
});

What I really dig about this pattern is passing in a function where I can do whatever I like. The factory pattern becomes much simpler. We can pass this around to whoever:

var url = "/foo";
var reqFactory = function() {
  var req = new Request();
  req.setUrl(url);
  req.addHeader("baz", "quux");
  return req;
};

The current conundrum involves implementing some kind of retry logic. In one case, I need to build a new request each time the request fails. In another case, I just want to retry for a certain subset of exceptions. In yet another case, if I make the request and it doesn’t have what I want, I want to re-issue it.

In Java, it’s— it’s messy. I don’t know what the Java-esque way of doing it is, quite frankly. I find myself wanting to create a Retrier interface which defines an onSuccess, onFailure, and a doRetry method.

I’m not sure what each method should return; what if I want to be able to return whatever it is that we got from the request? Do I create a wrapper class w/generics? I think this is how it works in the Kingdom of Nouns. The nouns just keep proliferating.

The one thing I think Java has going for it is anonymous inner classes. I feel like the way files and classes proliferate in Java is nuts, and being able to keep the implementation of such as a Retrier close to where it’s used seems like a win. It’s a one-off, right? A whole class & implementation & file devoted to it feels like it’s belaboring the point.

I’m sure at some point I’ll figure it out and/or get used to it. In the meantime, every time I want to add a layer of abstraction, it feels like massive overkill. I almost wrote up code samples for the above but it turned out to be too much effort. I can’t be as glib with it, at least not yet. Oh well.

Tags: , , ,