I disagree with everything said here. But to do it, you have to listen, which is a skill different from hearing.
caw
It may be only my experience, but I find that very, very, very few people can listen and learn dialogue, anymore than they can listen and learn how to sing. A tin ear is a tin ear.
Listening is one of those things that sounds good, but if it actually worked, we'd all be geniuses and masters of all we tried.
My experience is that some people are just as tone deaf when it comes to dialogue as they are when it comes to singing.
As the Bible says, they listen but they do not
hear.
"Learn by listening" also implies that good dialogue is simply writing down words exactly as people say them. This works on occasion, but most dialogue is not written as people really speak, and the difference is a lot more than simply removing the garbage.
I'm certainly not alone in this belief. I've met very few pro writers who think dialogue can be learned unless you have the ear for it, and I've certainly seen little evidence that it can learned, at lest in the sense that a write who's really bad at writing dialogue will ever become really good at it.
Other than writing characters the writer knows well, I simply see less improvement in dialogue than in any other part of writing. Those who can write good dialogue do, and those who can't will most likely never learn because they do not hear, and, I suppose, also never figure out why and how written dialogue is so different than the spoken dialogue we hear all the time in our daily lives.
If nothing else, that never learn how to make dialogue apply properly to the story, never get the cadence of when, where, and what, even if they master the how. How matters, but the best line of dialogue ever written when it comes to how is still bad dialogue if the when, where, and what are wrong.
Most who try writing can't even write themselves well, and if you don't know how to put your own words down on paper, how can you get anyone else's words right?
I do think it helps to write characters you know, your friends, family, etc., but dialogue is simply tough to write well. It makes or breaks a story, and my experience tells me many simply can't learn to write good dialogue, anymore than they can learn to sing.