I have the 17-40 for a number of years and supplemented it with the 24 IS lens. There are times I prefer a more compact lens and prefer this to use with neutral density filters for water falls and the 2.8 is a bit better and sharper for night photography. Overall I think the 17-40 is a decent lens, could be better in the corners for landscape work.
That said, buying now, I would definitely get the 16-35 IS lens over the 17-40. The IS is useful to me, regardless of what others say about not needed on a wide angle. Overall the 16-35 is a vast improvement (from what I read) over the 17-40. Upgrading from the 17-40 is second on my photo equipment updating. Adding a 14mm is priority, but also unaffordable at the moment.