Computer Programmers very often use headphones at work rather than earpieces. Why?
Well, the primary reason they wear anything over their ears at all is to allow them to get into the flow state, and once there they don't want any distractions.
But why headphones instead of earpieces? A few reasons. One is that headphones block out outside noise much better than earpieces. Particularly when high-end headphones are involved.
Another reason is that headphones allow you to crank up the music volume to any level you want, whereas, with earpieces, the noise from the music they like to listen to may travel to the next cubicle with an earpiece.
Still, another reason is practicality. When using an earpiece the chord tends to be short. Earpieces are primarily designed to walk around with a smartphone or device, and so the chords are short.
Alternatively, when you use headphones, it's possible to get headphones with chords up to 18 feet in length. Headphones with long chords allow you a great deal of freedom to stand up and stretch or bend into the bowels of your desk to retrieve a notebook or other data.
In short, headphones provide you the freedom to move around that you may not get from earphones.
Of course, if you are programming from home it doesn't really matter. You can use Bluetooth to even listen to music wirelessly. However, BlueTooth is not really practical in the home office where there may be 30 programmers crammed into a tight space. Imagine the chaos if everyone tried to use Bluetooth at work simultaneously.
So stick to headphones as a programmer. It's your better option.