There is no such thing as rubbish writing. Getting your ideas out is the first step to your masterpiece. Without words you will never produce a novel.
Don't restrain your imagination with editing. When the story is flowing it's hard to keep up as the ideas tumble onto the page, racing ahead before scenes and characters are properly formed.
Then, once you have something there, you have somewhere to revisit and work on improving.
Don't be surprised if it takes 20 edits to get it right. Quite often, you can't see the mistakes right away and need to take a break from it. Sometimes you'll need to start a section over from another perspective to make it stronger. Don't be afraid to delete a section completely that has no value to the story.
Scrutinise sentences and change description words; take them out if it's getting a bit wordy or add them in if it strengthens the image. Strike a balance between show and tell.
Then there are the basics such as spelling, grammar, punctuation and the layout of your manuscript.
For me, editing takes a lot longer to do than actually writing the story. I enjoy letting my imagination run wild rather than analysing what it's produced. For others to see the story as I've envisioned, editing is crucial!
Once edited I'm more confident that my novel is marketable and can then send it out to agents or publishers. Still, I do hate editing!