Well, all things being equal imop it is better to attack. However, if the other person gets there first then prophalaxis(prevention of opponents ideas) is necessary.
Keep in mind when we say attack we obviously don't mean haphazard attack but setting about difficult problems for the opponent to solve.
At this point in my chess understanding, I'm starting to understand position, and placing the best piece on it's best square every move. The question I sometimes find myself asking though, is what is better, working to create/attack a weakness of my opponents, or working to keep my oppenent from attacking a weakness of mine. Obviously the Ideal solution is to do both simultaneously. Really, I'd just like to get some better players insight on approaching this question is all. Thanks.