Bach's chorales follow principles very similar to those of pop tunes. The top voice sings a simple diatonic melody, while the bass and inner voices create harmonic interest. Gershwin's understanding of this strategy makes his tunes very different in character from those of Irving Berlin, who truly was the naif that some of Gershwin's critics took Gershwin for. Gershwin conceived melody and harmony together. The difference does not make Gershwin a better song composer than Berlin, but it may explain why so many of his songs have become jazz standards.
Jazz musicians throw away the melody when they improvise.
The strong harmonic structures of Gershwin's music imply a melody even when the actual melody is not being played. Gershwin made the most of his early studies. Since its premiere critics have dismissed Rhapsody in Blue, written when Gershwin was twenty-five, as a hodgepodge of tunes. The opening theme of the Eroica begins memorably but soon trails off, as if the composer had been distracted. In Rhapsody in Blue, Gershwin used the same device, perhaps a bit more crudely than Beethoven but to the same effect.