Isn’t “don’t parse ls” like the third commandment of Unix?
You've never done `ls | wc -l`?
I've always assumed that ls doesn't change it's output when piped; I've always done ls -1|wc -l. I guess I can save on a few keystrokes now.