It might work even better if you've seen Buster Keaton's Sherlock Jr.
. Allen's film is a long, unapologetic homage to that movie in many ways.
The ending is easily the best thing about the movie, though. The first time I saw the film, it caught me completely off guard (I admit, like the Mia Farrow character, I had totally been suckered into the idea of a happy ending), but it's really the only logical conclusion in retrospect.