Weeeeeellll... the answer is that even with steady winds, you can expect the direction to veer from time to time, often in a fairly regular pattern. From racing, we have the concept of lifts and headers (also known as "knocks.") Let's say the windward mark is at 0º and average wind is also from 0º, and you are riding the average wind close hauled on port tack at 45º. If the wind veers to West 10º, then you would have a "lift," sailing closer to the mark, and you could ride this at say 35º. This is good, giving you better course made good toward the mark. But if the wind veers East 10º, then you'd have to fall off to a course of 55º in order to keep the sails filled. This is a "header" or "knock." The rule in racing is to tack on the headers, in which case you'd be lifted on the opposite tack, and to ride the lifts, because you'd be pointed closer to your destination. This allows the boat to be pointed closest to the mark all the time. The trick is to A) know the average wind direction. B) know if the trend is towards puffs in a particular direction C) anticipating a header to be ready to tack.
There is also something known as a "velocity header." This is when you are sailing along and the wind lulls. Because your boat speed is faster than the wind speed during the lull, the sails luff as if you were just headed - but you were not. In this instance, its best to leave your sails trimmed, and ride the lull until the boat slows down and the sails draw, or the wind picks up again to drive the boat.
On my lake, when we get NW winds, say, when a high pressure system comes in after a storm and the air clears and cools, we also get a lot of lifting gusts. Much of this flukiness comes from hills along the North side of the lake, further complicating matters. Specifically, you can be sailing along Westward, nicely closehauled on a starboard tack, riding a WNW wind, and suddenly, the wind lifts to NNW with a strong gust. Being a dinghy sailor, I used to allow the boat to round up for these events. Then, as I became more confident of ballast in the stub keel, I'd allow the boat to heel and ride out the gust, often "washing the toe rail" in the process.
Except for that couple weekends in a row last Fall, including the day of tremendous gusts. I was out with my reef in, and jib up, sailing as described above. A gust came, and the boat heeled. The toe rail washed. Then, for a real good toe rail washing, water splashed on the top of the coaming because the lifeline stanchion base was in the water. Then I felt I was awfully high up on the windward side. THEN I noticed that water was pouring in over the leeward coaming. That's about when I decided it would be a really good idea to round up. After the boat leveled off, I decided it would be an extremely good idea not to do that again, 'cos that was a fair amount of water in the cockpit. I sailed along for a while further on that tack, rounding up for everything (even though I hate to slow down like that) just so that the seat could dry off for when I tacked around so I wouldn't get my butt wet

I tacked around then fell off for a broad reach back to the marina, figuring I'd had enough fun for the day (it wasn't that much fun with all the gusting) and that I had tempted fate well enough for the day.
If I remember correctly, that was the day before the marina limit, and I had to haul out the following day. I believe I had mocked people hauling out earlier that day, by saying "I'm goin' sailing, whooo hooo!" And fate and weather slapped me with 40 knot gusts the following day when I had to haul out. To prepare for the haul out, and to deal with that crazy wind, I stripped off all sails, running rigging, and stowed the boom in the cabin. I had nothing on deck save me and my fenders and dock lines. After I got the boat out with the help of club members. I had to use the flat-bottomed club chase boat to tow 4 other boats back to the launch ramp, including a 23 footer. (Our marina is capped at 24' length, with one 25' exception.) I'm still not sure how I got that 23 footer in to the ramp dock without blowing all the heck around!


