I was riveted to the Battlestar Galactica finale the other night. Wow what a great ending! It occurred to me that the ending was probably easy for the writers--they had it is mind all along, or at least for the last couple of years. What was probably more difficult for them was writing interesting stories over the last couple of seasons without giving too much away. In the modern post-Star Trek: TNG era, great endings have been rare for great sci-fi series. The X-Files failed miserably at this back in the 90s. They had no endgame in mind and the incoherent threads just became impossible to tie together when all was said and done. This left the audience frustrated and annoyed. Alias (From JJ Abrams) did a bit better, but the ending was so incoherent it fell a bit flat. Firefly (From Joss Whedon) didn't have enough of a life technically to be part of this comparison, but the film follow-up Serenity served as an effective series finale.
BSG did it the right way. I was on the edge of my seat the whole time, and just kept saying "wow wow wow wow" for two hours. Based on their progress, I strongly suspect that similar sci-fi long tail mystery shows like Lost (also from JJ Abrams, scheduled to end next year), Fringe (JJ Abrams), Dollhouse (Joss Whedon), and the like will do it much better, having learned from prior mistakes. As much as I will hate to see these shows go, I eagerly anticipate their finales.