Coding fundamentals and resources to help debug




I'm going to write a brief post on understanding code and logic. One of the things that really helps me is to try and connect coding logic to an everyday situation. I'll go with bananas for this, I love them and I'm quite picky when I buy them.

Let's think of an if loop. When you want to purchase bananas, you look around the display, pick the best ones and then put them in your basket. Here's how your brain logic works in this situation:

If

Banana = looks good

Then

Place in shopping basket

Else

Leave in display

The syntax may vary in each coding language but this is the basic same form that the logic will follow. Once you start to get your head around basic principles, it just becomes a case of learning the syntax. IDEs help here as they have prompts for varying coding languages. 

One great website I'm going to recommend for helping when you can't figure out where you've gone wrong is https://stackoverflow.com/. Ask a question and paste your code, you'll usually get the answer you need. Often though, your question has already been asked and answered so you just need to search it.

I'm also a big fan of open source coding languages. Python and bash are my personal favourites, I'm just waiting for when they become mainstream and windows finally shifts to use linux based systems. The other massive advantage to open source coding languages is the sheer number of resources out there to help you when you get stuck. It's a world of people with a DIY mentality to fixing problems and you generally get a mass of programmers fixing any issues quickly and efficiently.

Go and have a little exploration of Python and bash, download a linux distribution and dual boot it with your windows version. I guarantee you'll be hooked.

Happy Coding

Post a Comment

0 Comments