The closest parallel we can draw between "coders" and the distant past, is that with the artisans of the middle ages. Aside from the landowning nobles, the artisan class was probably the closest thing to a true middle class. Many advanced to upper-middle and later became the industrial nuevo rich.
The reason that this parallel works, is that the artisans were able to make something coveted out of what looked like a pile of junk (or less usable) to others. What a software developer creates with a few keystrokes looks to the lay person now as "magical" as creating a sword out of a pile of rocks looked to a lay person a thousand years ago. They get the general concept and see the value, but they have no idea of how it actually happened and cannot repeat it themselves.
By today's standards, most of what artisans of old made is not very desirable if it is made today (antiques not withstanding), hence only very few "artists" are actually paid well. Most people engaged in artisanal work are now in what we call 3rd world countries and make zilch. The reason behind this, is that technology has progressed and most of this stuff can be made faster, cheaper and more consistent by a manufacturing process. Today, we can take the best artisan of old, and copy him/her a million times over to produce the same trinket, with little extra expense.
Software engineering has not yet gone through a true manufacturing disruption. We cannot put software on the kind of assembly line/stamping process we can with say door hinges or other metal works that used to require a skilled blacksmith. That doesn't mean it won't happen some day.
We are constantly trying to go the direction of commoditizing complex problems. Looking back 30-40 years, the efficiency of tools we use has gone way up. Today, a developer doesn't have to write many components from scratch (unless he or she wants to). Most of what makes an application can be taken of the shelf, and modified to fit. For consumer apps, design is also where a lot of work goes in to.
This modification or molding process is a major barrier to having a true manufacturing process in place because the quality of the modifications depends on the individual skill of the person making it. A mistake made early on can bring a future company to it's knees and derail projects years after it was made. For example, a faulty data model that is let to grow to terabytes of information. Many companies choose to through money and computing resources, rather than risk a costly migration.
When we have sufficiently advanced to the point where such mistakes do not depend on an individual and the automation process can take care of it, the value of the software engineer as we know the profession today will diminish greatly. But then again, I'm sure the profession will evolve as well.