As a programmer who was once an engineer by trade, I would say the difference is that engineering implies manipulation of the pysical sciences, where programming is just logic.
"Just logic" I think really underplays things. That logic ends up in flight control systems, valve control for oil rigs, power grid management, robotics, factory automation, satellites, etc. A lot of software programming has very physical implications.