Programmer looks better but the reason programer is included in dictionaries is that it is more in keeping with English spelling practices - even though everybody on this forum appears to dislike it!
The verb [to] program consists of two syllables, with the stress on the first one. In the second syllable there is a short vowel (a) between consonants (r, m). In such words, the last consonant is normally not doubled: targeted, targeting. But, if the stress is on the second syllable, doubling occurs: forgetting.
Sometimes one has a choice: focused / focussed. The British seem to have a penchant for double consonants; they double the l even when the stress is on the first syllable: travelled, travelling, traveller.
To sum it up: programmer is the more common of the two - but it also conflicts with conventional spelling rules.