Why coding is not like building a bridge
A modern computer and software suite is by far the most technically complex edifice ever constructed - far more complex than any mechanical or civil engineering project. Thus, a software project is an inherently complex task being undertaken in an environment where the interactions are far more complex and poorly understood.
Civil and mechanical engineering also take place in environments that are subject to well understood physical laws. Assumptions about the underlying behaviour of the environment of a non-trivial software project are much less robust and predictable.
Building a bridge is a fairly predictable exercise and can usually be completely specified up front before construction begins. Interactions with the environment are much simpler for a bridge than for a non-trivial software application. Thus, the specification and design process is fairly predictable - so predictable that incidents like the Tacoma Narrows Bridge are highly newsworthy events.
The relative level of detail that it is practical to specify software in is much further apart from the actual implementation than for a bridge and the environmental interactions are much more complex and much harder to evaluate up front. This means that there is much more uncertainty in coding as the design work is still underway while you are coding. Thus, coding is much less predictable.
Software projects tend to differ from each other much more than construction projects do. As the saying goes, the devil is in the details, much more so than on a construction project. Coding is more like artisanship than construction because the coder is making design decisions and applying creative problem solving as they work. Design problems on construction projects tend to bear much greater similarity to design issues on other construction projects and small details tend to have far less influence on the overall project than on software. Even the smallest detail can completely derail a software project.
A better analogy - building in the middle of a minefield from plans sketched on a paper napkin
Thus, by and large there are far fewer significant design decisions on a construction project and they have typically been investigated and solved up front. This means that programming is not really like building a bridge. A better analogy is building a bridge where:
The client does not know where the bridge is meant to go. Requirements are almost never complete or accurate up front.
The plans are sketched on the back of a paper napkin. Completely specifying a project to exact detail essentially implies building it to test the specification. Thus, the relative level of detail of software specs to the actual complexity of the implementation is much further apart than on a consturction project.
Laws of physics may change in the middle of the project. Underlying assumptions about the environment may not be true. The environment is often not completely documented so the interactions between the project and the things it interfaces to are usually not fully understood up front.
Finance does not believe your estimates and authorises half of the proposed budget. Budget estimates are often treated as the start of a negotiation process by sponsors. Computers don't negotiate - they either work or don't. Building robust, high quality software is time consuming, expensive and requires expert labour. Most people can't afford to do it.
Materials are not subject to QA and may have critical structural flaws. Tooling and libraries may have bugs that cause problems in implementation.
The construction site is situated in the middle of an invisible minefield. External influences and political issues can cause serious or critical damage to a project. Often, these cannot be predicted or effectively neutralised up front.