Writing dialogue for the first time is probably the most demoralising experience in the entire process of filmmaking. It's like a baby trying to read Shakespeare. The only way you can ever learn from it is to hear the dialogue being acted out. To see a completed film of your script is the most invaluable lesson. Only then do you really understand what you were trying to do with the typewriter.
Bad dialogue is very hard to define.
The worst dialogue, and acting for that matter, is usually that which strives incredibly hard to be real , and then fails spectacularly. Even if you're aiming for realism, you are still using the language of film, not life. The two are very different. The most important thing to discover about dialogue is that it does not tell the story. The action tells the story.