Even the simplest program flow control with nothing but a few if then else statements is logic, yes indeed.
Here we go with the "anybody can code" theory again. I will only say this--I think it's bullshit because there is much more to it than just being able to spell things out step by step. I will simply give an anecdote. If you think it's meaningless, fine. Hopefully some will "see" the meaning here:
I once hired an intern to help me with electronics design work. Part of his job would be to learn to use the scripting facilities of a PCB CAD program, then write a program to take human data entry input descriptions of high pin count devices and automatically turn them into the functional and mechanical models needed within the program, a process which, to do by hand, is extremely tedious, repetitive, and time-consuming.
Well this kid absolutely kicked ass on this problem, and wrote a piece of software that is now an important asset to my operation, in just about 2 months.
He also tried to make a few actual PCBs. Here he didn't fare so well. The first run had a serious oversight--forgot to see if the mechanical orientation of a connector mated correctly with another--that sort of thing. So he revised it and we did a 2nd run. Uh-oh, another few small mistakes that made it not quite useful. I think the 3rd rev. turned out Ok.
Now this sort of success rate is not quite good enough in the hardware design world, because, re-spins of boards are $$$. What's even worse is when lack of attention to detail results in faults you don't discover until some time down the road, when suddenly 1000s of products come back on warranty because someone didn't take the time to read every single fucking word of fine print in a datasheet, and investigate the potential significance of every single ambiguity!
Can anyone do this? No fucking way!
I am not trying to say that my intern could not have developed more attention to detail with experience, or that all people who aren't inherently this perfectionist can never develop satisfactory attention to detail. It is highly possible and probable that some might. But I am absolutely certain that there are also some people who can never, ever, develop the sort of attention to detail needed to do engineering with a success rate high enough (in the >=95%, preferably 99% range, or even much higher, depending on the sub-field) to be successful, regardless of their overall intelligence.
Now what has this got to do with whether anyone can code or not, since clearly they are different, or else why did my intern do so well at the programming problem and not so well at the hardware design?
For starters, programming has a much shorter feedback period. You blow two board designs, and by the time the 3rd is working, your competitor has had a several month lead in the marketplace. But if you are playing footloose with code, you notice the big errors, and are able to correct them, in minutes or seconds.
However, what separates programming from recipe writing is that you are dealing with a machine that has absolutely no idea what you really mean, and so ultimately, the level of attention to detail required to get programs to work right is actually very high. High enough in fact, that when combined with the fact that one must learn a programming language, which involves some unavoidable level of abstractions as well as all sorts of weird arbitrary rules, the result is that there will be a proportion of people, again regardless of intelligence, who will simply be unable to deal with it and will give up due to frustration.
The programmers who persist and get past the frustration do so because there is something that makes them inherently like programming, and this, by definition, cannot be learned or taught.
Finally, there will be some who will struggle to grasp even basic abstractions, and even more who will forever be baffled by higher abstractions. Now many might be able to accomplish useful goals through programming without having to understand or employ higher abstractions. Every one of us has a limit to our aptitude, and we learn to work within our means, so to speak.
So those who are not bright enough to grasp higher abstractions are simply precluded from becoming professional programmers. If you argue against this, then that is just plain silly.
For others who may be able to program at a basic level, they may be able to improve their own lives by automating some tasks. This is a good thing, as long as the overall benefit is positive. If they just don't like coding, then they may not code for that reason.
Ultimately the fact that not everyone can code is proven by the simple fact that not everyone IS coding. Because there is truly, in this age, nothing standing in anyone's way. If someone is bound and determined to learn to code, then even if they are struggling to acquire enough food to eat, computing resources are so ubiquitous (including free ones) that their failure to exhibit the behavior of programming simply cannot be blamed on a lack of opportunity.
So why aren't they coding? Because they don't "see" why to code! And if they don't see why they should code, it's because they either don't have and will never have an inherent liking for programming (which is necessary to progress beyond an elementary level), plus it's probably true that they will be among those who just can't grasp the basic abstractions involved with coding.