Tailored Cyber Security.

Fundamentals of Programming

Fundamentals are literally the foundation of how things work. Typically, they aren’t as fun as some of the higher level topics but are essential to know before trying those topics. You wouldn’t decorate a house before laying the foundation would you? I don’t build houses but I’d imagine you wouldn’t.

I’m going to focus on the C family of programming languages and dip into Python as well. Powershell and Bash will likely come up at some point down the line as well. Finally, there will be some kind of web programming (HTML, PHP, Ruby, Javascript, etc) posts in the future too. Make requests for any specific topics, projects, or ideas you’d like to see worked out. You could probably teach me a few things too.

“Hello, World!” is the first program everyone learns as a programmer. Instead of reinventing the wheel, I’m going to introduce the first fundamental of programming. Do not reinvent the wheel.

Hello World in C
Hello World in C++
Hello World in C#
Hello World in Python

Those are four examples of Hello World in different languages that I didn’t write. While this is a very simple example, it just shows that you don’t need to write your code all alone. It’s unlikely that someone has example code on the internet that accomplishes everything you need on your project. However, it’s incredibly likely that several people have snippets that you can put together to at least accomplish portions of your project. Use those snippets.

Second fundamental; learn good coding practices. Each language has some kind of published best practices guide out there. For example, here’s the C# Coding Conventions Guide published by Microsoft. Find these guides whenever you start learning a new language.

Within these coding guides you’ll find things like code organization, variable naming conventions, general code philosophy, etc. If you shape your learning experience around these principles you will be an infinitely better programmer.

Commenting is one of the most popular things coders don’t do. It takes time, it isn’t functional, and it doesn’t help you finish your program. You’d thank yourself if you can get into the groove of commenting code. I can promise you that almost every programmer has a regretful story about not commenting code. It tends to be difficult to remember what code does after 6 months of not working on it.

Finally, use version control like git. Sites like gitlab.com, or the more popular github.com, make version control easy. There is a lot to learn about version control. I’ll get into it deeper in another post. However, just know that you need to use it. If you are coding in a team then it is an absolute necessity. For another time though… another time.

These aren’t in a priority order so please don’t think that commenting is less important than reusing code. The rest of you coders out there can feel free to throw other fundamentals my way.

Keep it real.

Leave a Reply