There has always been a very close connection between logic/mathematics and programming. Apart from the theory of data structures and algorithms, which provide a theoretical understanding of how to write good code, an important contribution of theory to everday programming is the invention of programming languages, basic computer architecture, and various specific features of programming langauges.
In fact, mathematicians and logicians essentially invented many things that you probably think were invented by engineers:
The idea of a general-purpose computer, of source code, and a general programming language were all invented by a mathematician, Alan Turing.
Modern CPU-centered computer architecture was invented by a mathematician John von Neumann, in cooperation with engineers Arthur Burks and Herman Goldstine.
On of the first programming languages is FORTRAN, which stands for "(mathematical) formula translator".
The connections between mathematics, logic and programming language remain strong, and are getting even stronger. Many features of modern programming langauge were developed by theoreticians: recursion, parametric polymorphism, algebraic datatypes, continuations, etc.
These phenomena are not isolated to programing. All basic sciences (physics, chemistry, biology, ...) have had a profound impact on everyday lives of humans, who have the luxury of taking the modern life for granted. Among these are highly skilled technical experts who have first-hand experience with engineering, but may not have had the chance to see the profound impact that the so-called "theory" has had on their fields of expertise.