There are pros and cons to mixing using headphones, as there are to mixing using monitors, but the bottom line is that one is not a replacement for the other — you really need both.
If you want to have an "uncoloured" room sound you need acoustic treatment, to erase the problem of room reflections. But if you want an uncoloured sound and if you have poor acoustics, better to mix using headphones, which will have no issues with room acoustics at all. Even the best nearfield monitor is still affected by room acoustics.
When using headphones, the way our ears receive sound, and hence the way our brains analyse and process it, is radically different to the way things work when we use loudspeaker monitors. Clearly, when wearing headphones, each ear will only hear the audio carried on the relevant channel, but when listening to a pair of speakers in a room both ears will hear the signals produced by both the left and right loudspeakers. The timing differences associated with this acoustic "crosstalk" between the two channels and each ear lie at the core of the "stereo illusion". This is what allows us to perceive phantom images between the speakers, and coincident-mic and stereo-panning techniques (which employ only level differences between the two channels to convey the spatial information) rely entirely on this acoustic crosstalk to work properly.
Unlike headphones, when listening to a pair of speakers in a room, both ears hear both the left and right channels.
Good-quality headphones are useful for revealing some details that even the best speakers gloss over. In particular, I often find that it's much easier to hear edit points in the audio when using headphones — edits that sound perfect on speakers can sometimes be really obvious on headphones! On the other hand, stereo imaging and panning information is much harder to judge on headphones, as is equalisation sometimes, and stereo mixes which sound impressive over headphones can sound very wrong on speakers, and vice versa.
If your room is acoustically problematic and you have poor monitors, then headphones may well be a better and more reliable approach. It is certainly possible to achieve good results by mixing using headphones alone, although it does take practice and require a good deal of familiarity with the particular headphones you use. But whichever way you look at it, using headphones, it is a lot harder in some respects to achieve the same kind of quality and transferability that comes more naturally on good monitor speakers in a reasonably good acoustically-treated room.
Since we can’t clearly answer which is better, what’s one to do? Use both! A combination of headphones and speakers could be your friend. Throughout your career, you’ll find a process that works for you—a gameplay loop, if you will. You may build your mix on speakers, check for forensic issues on cans, and continue switching between the two while mixing. Perhaps you’ll work differently, setting up the balances in cans for clarity’s sake and then finishing the mix on your monitors.
It may take some trial and error, but if you devise a routine that utilizes the strengths of both monitor types, you’re less prone to the weaknesses of either. Remember that it doest exists many correction software which can improve both your headphones and loudspeakers, whichever platform you choose.