Sometimes an unexceptional building project is thrust into the limelight for reasons that have nothing to do with the usual architecture or planning concerns. Such was the case last week with two proposed developments at opposite ends of Philadelphia that I have now come to think of as the poop building and the Scrooge building.

Ever since a resident in the Squirrel Hill section of West Philadelphia began requesting fecal samples from his neighbors, hoping to demonstrate a correlation between a proposed development at 48th and Chester and colorectal cancer, it’s been hard not to associate the modest apartment project with bodily waste. The other building, a graceless, fast-casual box at Huntingdon and Cedar in Olde Richmond, became conflated in my mind with that hard-hearted Dickens character after its developer, Gagandeep Lakhmna, locked out a group of tenants from one of his other properties, forcing them to scramble for housing in the midst of the pandemic. He even flouted a judge’s order to let people return.

The dueling controversies prompted me to take a closer look at the two proposed designs. Once I did, I realized they were interesting for reasons that had nothing to do with their notoriety. Both are midrise apartment buildings that are being inserted into mature, residential neighborhoods where owner-occupied homes are seen as the norm. They promise to add the kind of housing diversity that every American city needs. Yet one is going about creating density the right way, and the other is doing it all wrong.

Not so long ago, density was promoted as a way to enliven underpopulated cities, particularly their downtowns. Then it became a tool for fighting climate change. Now, density is increasingly seen as an equity issue.

Because of a growing shortage of affordably priced homes and rentals in the United States, housing advocates believe we need to get rid of zoning restrictions that limit new construction. Those advocates, who call themselves YIMBYs (Yes, in my backyard), got a boost last week when President Joe Biden called on Congress to eliminate exclusionary zoning laws that limit the nation’s housing supply. Although it’s not clear how much say Congress really has in the matter, because zoning is a municipal decision, his remarks pushed the issue to the forefront of public debate.

As the president surely knows, plenty of neighborhoods of single-family homes recoil at the thought of allowing any type of housing (or people) that doesn’t look like what is already there. Their residents are derided as NIMBYs (Not in my backyard) because of their unwillingness to countenance the slightest change. NIMBYs are a big reason so many suburbs remain out of reach for low-income workers and people of color, and why the cost of a house in San Francisco now averages more than $1 million.

Yet, in many ways, YIMBYs and NIMBYs are mirror images, absolutists who see the world in stark black and white. It’s not unusual to hear YIMBYs declare that neighborhood character is irrelevant. They insist that any new apartment building is a blow for justice, no matter how grotesque its design. They seem incapable of understanding that it’s deeply human to care about what our surroundings look like. Context and details matter, and that’s why it’s worth examining these two midrise projects if we hope to win the hearts and minds of density skeptics.

The reaction of the West Philly United Neighbors to the poop building at 48th and Chester represents NIMBYism in its most extreme form. The group’s president, Ang Sun, who claimed to be conducting a study on the links between gentrification and cancer, suggested in his letter seeking fecal samples that the 76-unit apartment house was grossly out of sync with the neighborhood. But you only need to take a walk along Chester Avenue to see that the little apartment house is actually a model of sensitive, contextual design.

One of the wonderful and distinctive features of West Philadelphia is its mix of single-family homes, twins, rowhouses, and small apartment buildings, all jumbled together in a landscape of tall trees and lush gardens. There are easily six similar-size apartment houses within two blocks of the proposed midrise, which is being built by Meir Gelley, a local nursing home operator. Among them is an early 20th-century apartment house across the street from his project.

In fact, Gelley’s site was once occupied by apartments. Built in 1928, the five-story, brick-and-stone, Classical Revival building was demolished after a devastating fire in the late 1990s, a time when the Spruce Hill neighborhood was falling into decline. There was so little demand for housing that local residents used it as a private dog park, paying $50 a year to let their dogs poop there. (The site, it seems, has a long history of association with fecal matter.)

The new apartment house, designed by Jerry Roller of JKRP Architects, seeks to capture some of the essence of its predecessor. Roller wisely dressed his modern design in traditional materials, brick and limestone-hued cast stone, to help it blend into its surroundings. The parking is hidden behind the building, maintaining the gracious feel of the streetscape. Gelley had originally envisioned a four-story building, but agreed to lop off most of the top floor after discussions with the immediate neighbors. Ironically, the reduction in height makes the building less contextual because it’s stubbier than other nearby apartment houses.

There’s no doubt that Gelley has been so accommodating because he will be seeking a variance from the zoning board on Wednesday. But he still deserves applause for working collaboratively with the neighborhood. On top of everything else, Gelley has agreed to set aside 15 units at subsidized rents for low-wage workers. This is the kind of density that enhances a neighborhood and makes it a better place to live.

The Scrooge building at 2400 Huntingdon is the polar opposite. At seven stories, the bulky apartment house by KCA Design Associates would loom over the tiny working-class rowhouses that define Olde Richmond. Traditionally, the residential blocks in the city’s once-industrial Delaware River neighborhoods have orbited around big redbrick factories, which once provided residents with their livelihoods.

After Lakhmna acquired the former dye works on Huntingdon Street, many Olde Richmond residents hoped he would convert the 19th-century structure into apartments. City planners had zoned the site to encourage just such a result, giving it the omnibus IRMX designation. There were numerous possibilities for adapting the mill: Lakhmna could have retained the four-story portion on the corner and replaced a lower section with townhouses or apartments. He could have topped the one-story portion with a gossamer glass overbuild.

Instead, he decided to tear it all down and build a generic box that looks as if it were parachuted in. Because Lakhmna didn’t need a variance, he had no incentive to negotiate with the neighbors. In fact, he was able to obtain several zoning bonuses that have inflated the size of the building even further. After the city’s Design Review Board issued a nonbinding ruling declaring the design “disgusting, ridiculous and a travesty,” Lakhmna made a single concession: He swapped out the metal cladding for brick.

Otherwise, he has plunged ahead, oblivious to neighborhood concerns — until he was stopped last week by building code officials, who had discovered his demolition contractor was working without a proper license.

It’s not so much that this 150-unit building is too dense for the site; it’s that the density is badly arranged. Instead of plopping a boxy mass onto the site, Lakhmna could have done what Roller did in West Philadelphia and shaped the building to acknowledge its surroundings. Imagine a tall, slim tower at the corner of Huntingdon and Cedar that scaled down to meet its two-story neighbors.

Since we’re talking about good density and bad density, it’s worth mentioning that there are increasing numbers of projects in Philadelphia that are not dense enough. South Broad Street, which should be Philadelphia’s grand boulevard, is seeing its potential downsized and diminished with $2 million townhouses, even though its zoning allows bigger structures. If we don’t build density on our wide streets — where it belongs — developers will try to shoehorn it into fine-grained neighborhoods.

Sometimes when YIMBYs talk about density, you might get the impression that Philadelphia’s zoning is just as restrictive as the suburbs’. We’re fortunate to have a wide array of housing types here. We also have plenty of low-priced housing compared with such cities as San Francisco and Boston.

Our challenge is to accommodate new housing while still maintaining our quirky, beloved, lived-in neighborhoods. That’s why we need the right density in the right place.