Pigs are more confined to their pens than cows are, especially in the farrowing pens. Pens are lower to the ground because pigs are lower to the ground and do not really jump over them. Most stalls for pigs have gates in the back so that the pigs don't back out and "accidently" start a fight with other pigs. There are pens, however, where young pigs (guilts and barrows) are held where they can socialize and are free to move around. The barns themselves are more temperature-controlled than dairy barns because temperatures often affect performance of the pigs' gains, and care for piglets that are just born. It is important that the farrowing room or barn is a good temperature because the piglets are not born with hair like calves are and are more sensitive to the cold.
Dairy cattle are often tethered via halter or collar to their stalls and the stalls have enough room for the people who milk them to move between the cows and the stall bars or walls. Some barns have the cows tethered where they are for most of the day and only let them stretch their legs once every so often. Other barns have parlours where the cows come in by themselves and find their milking stall so they can be milked. Still other barns have cows where they line up behind one another and a half a dozen are milked at a time. Once finished, the cows move back to their corrals to rest and/or eat. Dairy cattle do not need to be separated into individual stalls or pens like pigs because they tend to fight a lot less than pigs do. Nor do cows tend to chew on each other's tails or ears like pigs do if their bored. There are actually more ways to set up a dairy parlour than there is setting up facilties in a pig barn.