Did you catch the latest smart move by “Modern Family”? This week, I found myself applauding the episode “iSpy,” in which the writers figured out what to do with Haley Dunphy, the ditzy daughter played by Sarah Hyland.

Haley has been doggedly underachieving, the slacker sister to Alex (Ariel Winter) the bookworm. She has been more interested in clothes than school, a proudly superficial girl whose life philosophy is “whatever.” She’s no genius.

But the genius of “Modern Family” is that, in the midst of depicting funny instances of gossip, jokes about age, family neurosis, gay stereotypes and the perils of parenting, the writers sneak in moments of wisdom. Or heartbreak. And, as the kids grow, they’re expanding their universes to keep up.

Haley will never be a genius, but it was revealed in a clever way that she is a gifted photographer. She didn’t tell anyone, but she was chosen to be featured in an art show. (The artful black-and-white shots were of the family, who surprised her by attending. Anyone who knows the characters could see the revealing traits captured in her shots, more of which ran as a kicker at the end.) The choice seems just right: this character is not verbal, not intellectual, but it makes sense that she has a good eye. And suddenly the character gains depth and new vistas open.

Joanne Ostrow has been watching TV since before "reality" required quotation marks. "Hill Street Blues" was life-changing. If Dickens, Twain or Agatha Christie were alive today, they'd be writing for television. And proud of it.