Which type of ports do you find more useful in Settlers of Catan, General 3-to-1 ports or 2-to-1 ports for a specific resource?
Unfortunately, it depends.
After the initial layout you want to try to identify which resources will be scarce and dominate them. At the same time you want to try to identify which resources will be plentiful and dominate them and position yourself for the related 2-1 port.
It's unusual that you will be able to accomplish all of that :)
Once the layout is down, and folks have placed their initial cities you can then work to determine if you will have significant extra of a commodity. If so, see if you can angle towards the 2-1 port. If not, the 3-1 can work out just fine.
It depends on your personal situation in the game. In some situations, both have no value at all.
With my usual tactics, 3:1 ports are much more useful. 2:1 ports are better only when they are of a specific resource that I have too much of in a given game, which generally happens when I have several settlements on several hex of that resource with values between 5 and 9. The 2:1 port of the resources you lack is useless. Since the resources you get changes during later stages of the game, the 3:1 has the advantage of staying useful during all the game.
Ideally, it's always better to not need a port. If you use your resources to build without exchanging, or exchanging with other player at 1:1, or getting 2 (or more) for 1. You don't need a port.
You should also compare the opportunity to build of a port compared to the other building opportunities. When a good spot that gives three resources is available, your port will be a more valuable investment only if you desperately need to trade. When those places are gone and the only 3 resources spot are the ones with a 2 or 12, 2 resources and a port become one of the best places you can still build.
The situation also changes when you build new settlements or cities. At some point in the game, you might need to trade a lot to establish a settlement providing the missing resource, and after building it, you don't need to trade anymore. If you lack wood or brick, a port is useful when your strategy is focused on new settlements, but it becomes useless when the good spots are all taken and you change your focus to cities and development cards.
If you know that you will run out of available settlement spots (when there are still several turns to play), you should should consider a wood or brick port, since you will have to exchange those resources after you run out of settlement spots. (You can still compete for the longest road, but if you have it, you can't get anymore points by building more roads).
Usually, I find that 2-to-1 ports are more valuable. They produce resources of your choice at half again the rate as 3-to-1, and you will usually have a resource that you will have a surplus of and can shoot for the 2-to-1 in that resource.
Of course, it does depend on the circumstances; sometimes, you just can't reach the appropriate 2-to-1 or really have an even balance of resources, and it's better to shoot for a 3-to-1 instead. But I'd say that all else being equal, a 2-to-1 that you have a good chance of a surplus in is preferable to 3-to-1.
When placing your 1st settlment, you don't usually consider a port when choosing a location. There are just too many unknowns. When placing your 2nd settlement, you can build on a 2:1 port or consider building towards it. You would do this if there was an excess of one resource, and you expect to have good access to that resource.
To implement this strategy, you must look ahead and see where your opponents will place their second settlements. Try to determine which strategy your opponents are using based on their first settlement, and figure out what the logical second location is. If you don't build on the 2:1 port, and instead try to build towards it, you must consider that an opponent will get there first.
There are 3 problems with trying to use a 2:1 port as part of an overall strategy. First, you many not be able to predict where you opponents will place their 2nd/3rd settlements. Second, if you have 2 settlements on a 5-6 or 8-9 hex of that resource, your oppenents will target this hex when they roll a 7. Third, you will start getting resources in chunks later in the game after you have upgraded to a city/settlement on a hex. Getting your resources in chunks increases the risk of loosing resources to the robber.
If you are placing 3rd-4th, you will often only have 1 viable location to get access to brick or ore (since there are only 3 hexes of each). If the hex is a lower probability (3-4, 10-11), you can build 2 settlements on it without drawing your oppenents attention. If one of those happens to be on a 3:1 port, it enhances the value of the settlement. Since it won't get rolled a lot, you won't have excess of this resource type, but you may have an excess of something else.
Use 2-1 ports if at all possible, provided of course that you will be getting the resource in abundance, and can do so without sacrificing the necessary probability and variety of resources. Placing on an abundance of wheat or brick, especially in Cities and Knights (C&K), and then placing on the special harbor allows you to make up for a deficit in any resource or commodity. This is especially useful if you are "last", and you get to place your city and settlement at the same time.
BEWARE: if you don't have a reasonable variety of resources with a reasonable probability, no amount of 2-1 can make up for all the 1-1 that other players get, when they are well placed to get a good mix of resources (and commodities in C&K).
A 3-for-1 port is more generically useful, since you can trade down any excess cards.
A 2-for-1 is situational. If you can focus your production on that resource AND get to the port, you can gain a lot of advantage.
To answer the question, I'd put it this way: If you're heavy in a specific resource, and can get to the 2-for-1 without too much trouble, go for it. Otherwise, save the roads and take the 3-for-1.