Depends on a lot of factors.
Size and layout of the lot.
Number of family members.
Number of cars.
Hobbies that would require shop space.
Budget
Size of house.
Given an ideal layout for me, first I would look at the existing conditions.
Me and my wife.
2 vans, one full sized sedan, numerous trailers, 2 motorcycles, bicycles, kayaks, boats campers, airplanes etc.
Hobbies: Woodworking, metalworking, painting, music, jewelry, sewing.
Since the other existing conditions would not allow all this to be accommodated, lets make them a flight of fancy and assume adequate budget for anything I want.
Since the existing house and lot also aren't adequate, lets assume the budget allows any piece of land I desire.
Note, that for the small house on a small city lot that IS my reality, an attached garage is the most reasonable solution. An attached garage allows use of an adjacent powder room for washing up, an existing living room for entertainment, and existing kitchen for snacks and an existing bedroom for naps. It is still a good idea to separate functions, if you can.
Let's go back to the imaginary house, lot and budget.
For this, I would definitely want detached. If you can afford a big lot, why not. You can afford then to double up functions by adding a bathroom, sitting and entertainment area and kitchenette. I would definitely separate functions and even build separate structures for different things, like storage of vehicles, trailers, jet skis, snowmobiles etc.
One thing I definitely would do, is to make workshops that were exceedingly beautiful places to work. They would have great views and be sited to take advantage of unusual terrain. When I'm at my workbench, I want to be able to look out the window at a rushing stream and a forest.
Bill