The Cage is nothing more than a square of asphalt beside the West Fourth Street subway stop, but it is a place of worship and coolness and budding dreams.

On a Friday in June, the excitement of Kenny Graham’s summer league is in full swing. Passersby cling to the chain-link fence. One man is camped out on the sidewalk with a beach chair. Abe Weinstein (“no relation to Harvey”) sits in his usual seat, front row center, sucking a pink lollipop and wearing the T-shirt from his 40th wedding anniversary. The announcer, who goes by Worthy, commentates each play into a megaphone: “Here’s the next NBA player versus the young one!” Adrenaline is running high because it’s an unwritten rule you have to be good to play on this court. Really good. Otherwise, you’ll embarrass yourself. Smush Parker, a former NBA player, cut his teeth here. Gregg Popovich, the coach of the San Antonio Spurs, has swung by at least twice. “You can’t step on that court if you’re an Average Joe,” says Connor Stovall, 25, who doesn’t think he’s qualified to play here yet, but hopes to be one day.

By the third period, the score is 57-91 and the team in the bubblegum jerseys is struggling. “Game’s over!” heckles Keith Haywood, who is seated on a folding chair in back, eating a box of chicken wings from 7-Eleven. “You see a lot of the same people,” he says about the Cage, except lately he hasn’t seen Moses, a man with a turban and a white beard who could “play his behind off.”

After the game, Kareem Welch hangs around as people slap his back in congratulations. He’s 17 and had a good day: 46 points and 18 rebounds. One day, he hopes to play for the Knicks, even though they’re not so great. “If I didn’t have basketball, I don’t know what I’d be doing,” he says. In his neighborhood, he’s seen people go to jail and do drugs. He looks up at the trees before he speaks. “I choose to do better,” he says.

Basketball players in New York will tell you the Cage is where the party’s at, and on a temperate summer evening, no doubt they’re right. But there are over 500 outdoor courts in the five boroughs—two Wall Street Journal reporters visited and ranked each one in Manhattan five years ago—and the city is considered a mecca of street basketball. The courts—maintained by the New York City Department of Parks and Recreation— are a fabric of the landscape here, as familiar as yellow cabs and corner bodegas. They’re the subject of documentaries and odes in local papers. Some, like Rucker Park in Harlem, breed and attract celebrity players and tourists. Others live in the shadows of brick buildings, overgrown with weeds or missing nets. But what does it matter to be the “best” or the “worst”? The Cage is built on a slope and has notoriously small dimensions. In an essay for the New Yorker, Thomas Beller wrote, “Location is important with basketball, and yet it’s not—you can play anywhere, and in the act of playing you forget where you are.” My dad and I used to shoot rolled-up socks into the wastebasket in my parents’ bedroom and call it basketball.

And on blacktops across the boroughs, young men and women are not so much playing ball as they are learning to grow up. “A lot of times where I’m from, a lot of people don’t make it out of here,” says Trevor Stanley, a professional player from Harlem, as he watches streetball at Rucker Park. “So, if you aren’t responsible, everything can be taken away in the blink of an eye. It makes you mature faster than you want to.”

Jaylen McCoy, a 15-year-old who lives in the Polo Grounds Towers across the street, sits next to Stanley on the sidelines, taking a break from his pickup game. He is shy, but shares his desire to succeed. Basketball is “influencing me to do more,” he says.

Down at the Seward Park courts, which reopened last September after a two-year delay to resurface the pavement, a feverish game of pickup between strangers is underway. Howard, who won’t give his last name because a news crew once saw him on the court and wanted to feature him in a segment called “50 Is the New 30,” couldn’t resist joining as he walked by. Justin Tan also joined. So did Victor Montes, his son Damien, and their in-law Will Bray. After the game, the crew breaks up to head home. “I didn’t know what it was like to be a real man until I stepped on the court,” says Bray, a man with a sleeve of tattoos dripping beads of sweat. “You learn to contain your emotions when they run too high.”

Some blocks up on Houston Street, a young man coaches a woman by the light of the street lamps. She’s the first woman I’ve seen on the courts, though Nancy Lieberman, a trailblazing former professional player, famously got her start playing pickup in the city with the boys. The woman on Houston Street makes her way around the key. One shot misses. “A little bit higher,” the man says. She sinks the second. ‘There you go.” A large guy with a ponytail approaches them. He bends down to touch the court, kisses his fingers and gives the sign of the cross. He asks the couple for the ball, murmuring that he hasn’t played in six years. He makes a reverse layup, and then politely leaves, thanking them. The couple continue to play for at least an hour—oblivious to someone being arrested across the street for slapping four women—and they look so focused that I can’t bring myself to interrupt.

In January, I heard Obama give a talk at Temple Emanu-El on the Upper East Side. He spoke about the deterioration of community life in America. We now live in a society where people chat online but do not attend church groups or neighborhood board meetings, he said. He spoke about the dangers of such connected isolation. I was reminded of his speech as I hung around the courts and spoke with the players. There are varying opinions about whether streetball here is the same as it was, say, in the ’90s. “I think basketball in New York City has gone soft,” said Bray, explaining how the younger generation is more influenced now by video games and social media. “A lot of young kids look at pop culture and the cool things to do—‘Let’s go smoke some weed and drink sizzurp.’” But for many, the courts offer a last vestige of IRL connection, and an opportunity to eschew a life of digital loneliness.

Molique Lawson Jr. and Ryan Garcia, who are both from Harlem, met on the courts. They talk over each other and drink each other’s Gatorade with the sort of intimacy that only comes from deep friendship. The boys have just finished a competitive game of pickup where Lawson Jr. intercepted a pass and stole a layup to cheers of “Go, go, go, go!”

During a break, I ask him why he plays. “I’m trying to make sure I do good,” he says.

Do good in what?

“Do good in life,” he says after a pause, like I’ve asked both a puzzling and an obvious question. Then he turns to Garcia. “Check out what I brought,” he says, and whips out his Nintendo.

Britta Lokting is a journalist based in New York. Her work has appeared in the New York Times, New York Magazine, the Baffler, and elsewhere.

Andre D. Wagner is a photographer based in Brooklyn. His monograph Here for the Ride was published in 2017.

Editor: Sara Polsky