The Hate U Give is a didactic issues novel for teenagers. It is also a good book. Those two categories intersect only rarely, but The Hate U Give — a debut novel by Angie Thomas — manages the balancing act with aplomb.

Rating: 4 out of 5 vox-mark vox-mark vox-mark vox-mark vox-mark

Sixteen-year-old Starr grew up in a poor black neighborhood, but after she saw her best friend gunned down in a drive-by gang shooting when she was 10, her parents sent her off to a wealthy white private school.

Starr rapidly becomes an expert in code switching, saying “ew” at school and “ill” at home; dancing at school, where she knows everyone will assume she’s cool because she’s black, and observing at home, where she would have to work harder to earn her coolness. At school, she hangs out in a white girls’ clique and laughs about her middle school obsession with the Jonas Brothers. At home, she hangs out at her father’s grocery store and talks about how Drake is her future husband.

But all of Starr’s careful work to keep her two worlds separate falls apart when a police officer shoots her childhood friend, Khalil, in front of her. It’s the latest police shooting of an unarmed black man, and the case becomes a national scandal. Starr is the only witness.

At school, her friends talk about how Khalil was a drug dealer who probably deserved it. At home, gangs use Khalil’s death as an excuse to expand their turf wars. Whenever Starr talks to the police, she has to remember that one of them shot her friend and then held her at gunpoint. It’s a vivid, intimate portrait of how systemic racism works to forbid Starr any truly safe space of her own — and of how she builds one anyway, with the help of her deeply supportive family.

It was probably inevitable that someone would write a YA novel about police shootings, but it was not inevitable that it would be a good book. Whenever a societal problem becomes a national obsession, some adult will write a book about it for teenagers; usually the result is a Go Ask Alice–style stew of fearmongering and breathless sensationalism.

But The Hate U Give is charming and funny and carefully crafted, and Starr’s witty, observant, pop culture–inflected voice is a delight. There’s a scene early on where she’s trying to decide how to play things with her boyfriend after a minor transgression on his part: Does she want to go full-on ’90s R&B breakup song, or should she be gentler, like a Taylor Swift song? (“No shade,” she adds, “I fucks with Tay-Tay, but she doesn’t serve like nineties R&B on the angry-girlfriend scale.”) Then it comes to her, the perfect solution: She’ll Beyoncé him.

The specificity and whimsy of ideas like the anger scale of breakup songs is what keeps The Hate U Give moving so deftly through its heavy subject matter; it stays warm and focused and grounded in character even when it’s dealing with big, amorphous ideas like systemic racism. The result is a book so thoughtful and so fun to read that you’ll want to Bruno Mars it.