Yes, this is a real and widespread urban design strategy. It falls under the term "hostile architecture" or "defensive design." The primary purpose of benches with armrests, segmented seats, slanted surfaces, or unusual materials is indeed to prevent people—particularly those experiencing homelessness—from lying down and sleeping on them.
Cities and property managers often install these benches to maintain "order" in public spaces, aiming to discourage loitering and encourage a quick turnover of users. Proponents argue it reduces perceived crime and keeps areas accessible for all. Common designs include benches with individual metal armrests that break up the sleeping surface, curved or slanted seats that make lying down impossible, and even benches with strategic bumps or dividers.
However, this practice is highly controversial. Critics condemn it as inhumane, arguing it criminalizes poverty and homelessness instead of addressing root causes like housing shortages. It makes public spaces less comfortable for everyone, including the elderly, pregnant individuals, or anyone needing a longer rest. Ultimately, these uncomfortable benches represent a deeper societal debate: should public furniture prioritize comfort and inclusivity, or be a tool for behavior control? The answer shapes the very nature of our shared urban environment.