Neither.
It's "Start simple and improve while you move along".
Quick and dirty is brittle, but fast (if the project is sufficiently small and short lived).
Plan first is rigid, but stable (if the project completes before it runs into financial or temporal constraints).
Agile is an alternative to the 2 above. It relies on an iterative approach where features are completed one at a time, feature by feature, and the knowledge gained while completing these fully functional pieces of the program is used to flesh out and adjust the plan as development progresses. To do so requires some planning up front - you need at least enough planning to be able to estimate how much work the individual features require - but because agile expects change, excessive planning leads to waste.