Thorns, spines and prickles are not often considered to be assets. The weirdly stout prickles on the distended trunks of floss silk tree are more of an oddity than an ornamental attribute. The striking spinose foliage of agaves and yuccas can be more trouble than it is worth. After all, thorns, spines and prickles are intended to repel grazing animals.
They all work the same way, but are physiologically quite different. Thorns are modified stems, like those of bougainvillea. Spines are modified leaves, like those of cacti. Prickles are modified epidermis, like those of roses. Then there are all sorts of plants with spinose leaf margins, like English holly. Such defenses can be a nuisance to those of us who must work with them.
However, they can be useful deterrents. Natal plum that seem to be so innocent can be grown as low hedges that no one would go through more than once. Firethorn (Pyracantha) makes a larger and comparably impenetrable hedge. Their potentially dangerous thorns are almost always adequately effective with their first few pokes, before they cause too much injury.
Some plants are so dangerously thorny that they should be kept at a safe distance. Cacti, agaves and some yuccas can be strategically placed near the perimeters of large landscapes to deter trespassers. They are scary enough to be visually deterrent remotely. Mediterranean fan palm looks friendlier, but is just as mean up close.
Japanese barberry, roses and the spinose foliage of English holly are relatively safe deterrents to inhibit traffic in smaller spaces. They will keep people away from windows without necessarily blocking either access for washing the windows, or views from within. In case of fire, they are not too dangerous to escape through; although roses should not be allowed to get overgrown.
Because thorns, spines, prickles and spinose foliage are unpleasant to handle, the plants outfitted with them often get less maintenance than then should. When they get overgrown from a lack of pruning, they are even more difficult to handle. It is probably better to put nasty debris into greenwaste instead of compost. Thorns and spines are hard, so linger as foliage decays.