Why is programming so difficult?

Every brand of computer in common use has the same physical architecture: an instruction set, memory (also called RAM), some kind of persistent storage (formerly magnetic storage, now flash memory) and external devices like touch screens, mouse, keyboard, display. The instructions of a computer can send data in and our of the computer, but in terms of raw computation, everything boils down to arithmetic, logic operations, moving and copying of data. To save repetition of code, there is a concept of a subroutine, where a block of program code can be re-used. Since the computer at its lowest level can only deal with text ("Hello world") or numeric formulas (3+4/6*7-5), the task of every programmer is the same: decompose the objectives of the project into a series of smaller steps that eventually resolve to manipulating text or numbers. To make this process feasible without massive duplication of effort, the program is broken into layers. Some people call these layers  "Libraries", "Frameworks", "API's" (application program interfaces). 

What makes programming difficult is that these lower layers are often poorly designed, with the result that it requires reading hundreds of not thousands of pages of documentation. And often the documentation doesn't spell out the order in which the functions have to be executed. Most programming errors relate to incorrect ordering of computation. 

The key to good programming is breaking a project into the right set of layers and reducing to a minimum the requirement to execute steps in a particular order in the lower layers. There can be a difference of 10:1 in terms of net difficulty depending on how well the lower layers are defined. Apple's iOS for example has a very clean, simple architecture, and it has born abundant fruit in terms of the millions of applications written for the iPhone and iPad. Windows Mobile on the other hand has an awkward, difficult to understand lower layer, that has not done well in the mobile space.