I know this is an avenue somewhat unrelated but in order to know where i picked up logic I'll need to explain where I started. For me; some 20+ years ago, I started out with Electronics and my first book was
Electronics Made Simple, and it was here that I learned how electrical components such as transistors, diodes, capacitors, and microchips worked. For me, this is where I learned logic, and where I began drawing my own diagrams of portable hand-held radios, transmitters, stereo encoders and amplifier diagrams as a hobby. This wasn't enough for me, and I wanted to know how all electrical components worked, especially intrigued with microchips, and so I recursively moved from Electronics and into computer programming, dipping and dabbling between the two. At the time, I was already designing websites as a hobby too; while trying to work out how that all worked... My enthusiasm grew exponentially in a variety of these fields, and I started studying how some components get programmed. In 2013 when arduino boards came out, I was instantly hooked writing my own code to micro-controllers, which helped me to expand my patterns on logical thinking. (You can buy a
test project on ebay for $140 which will have
components for you to build test projects and learn from).
I started working with websites when i was about 12 or so, I was always interested in server technology which is one of my main areas of expertise today. So I relate to Skydiver's posts re- python programming, as without this and a few other web based languages and action scripts, I may not have picked up C, Java, C# and C++, latest being VB.NET. And so, I would second python as a starting point if electronics are not your cup of tea. Alternatives are raspberry pi with a range of opensource python projects available to you online.
One of few recommended books you could also get are the collections on
The Art of Computer Programming. Highly recommended read. My expertise was devised through my years as a radio broadcasting engineer, tuning up radio broadcasting equipment for radio stations across Ireland; this included working with transmitters, compressor/limiters and stereo encoders, and all this stemmed from the book
Electronics Made Simple. And while this isn't a requirement to learning to code or becoming a better programmer, it was a requirement for me to better understand programming logic in the long run. Learning how circuit boards worked is what helped me with logic.
But it really depends on the type of learning curve you want to go on yourself; and how much you want to know on different subjects, and how much time you have to devote to it all... For me; I could never learn enough and always wanted to know more. It was the learning of Electronics that thought me the most about logic. I learned as I progressed into the fields of computer programming, and later; the programming of micro electronics such as arduino (in 2013) and pi boards that will teach you the most about logic. Have a read of
Why should I care about electronics and programming. Electronics are a part of every day programming today, and it all boils down to how much you want to know, and where you'd prefer to jump in and get started. Electronics and programming are two totally different things. I would suggest you get some basic knowledge about analog and digital electronics including microprocessors. Keep in mind that in order to learn programming, its not required to learn the above, but in terms of logic, I think you will find it helpful when constructing your own code later on.
You will learn the basics from raspberry pi/arduino regarding declarations, variable types, iterations and so much more without getting into electronics extensively. As I said, you don't need to learn what I did, but you can skip a few chapters by getting a
pi board and integrating python as a starting point to build on your skills. Logic comes with experience, so may I also suggest looking up tutorials to follow, and then when finished with those tutorials, look at how you can better adapt the code you learned and restructure and rewrite it to do the same thing, but better.
Hope this helps.