For most music you’re ever going to compose, a good melody is essential.
But for most musicians I know, the construction of a good melody is utterly overlooked. The standard 4-semester theory sequence tends to overlook melody in favor of harmony. Counterpoint classes tend to focus on the rules of voice leading. It’s really not much better in jazz theory and improv courses, which tend to focus on harmonic understanding.
If we’re studying melody, it’s far more likely to be in the context of understanding how a composer transforms and develops the melody than how that composer initially creates it.
I think we tend to assume that we have already developed an innate understanding of good melodies from interpreting them as we grow. But it’s not enough. We need to know what makes a good melody. Not just instinctually but intellectually.
To my knowledge, there’s only one really fine book about what makes a melody strong. The good news is that it’s a really, really good one.
Please, if you interact with melodies, and especially if you create them – as a composer, and arranger, an improviser – read The Anatomy of Melody by Alice Parker and let it guide your melodies. It will change the way you create music.