c++ const keyword explained in detail

c++ const is used very commonly. If you have ever written any code in C++, you will definitely have used const and come across it. Needless to say, is a very useful and important feature. Using c++ const can greatly improve the robustness of your code. It is also a great way to document to other developers that the object marked as const should not be modified. On the other hand, omission of the const keyword in places where it is needed results in more brittle, error-prone code.

In a nutshell, const  (constant) means that a property or value cannot change. 

Continue reading

JavaScript Fundamentals – Introduction to the JavaScript function – Part 1

This time, I want to focus a little bit on a more preliminary topic. Functions in JavaScript are one of the main building blocks. Bits of code inserted into functions makes code readable, therefore, more maintainable. Imagine a JavaScript program where everything is written in the global scope and the code spans over tens of thousands of lines. Nobody would want to maintain code like that!

Separating code into smaller parts by placing them inside of a function (based on operation) allows developers to easily look up which part is responsible for certain features, making the debugging process much more pleasant.

In this post, we will be going through some of the important basics of the JavaScript function. Right now, i have other topics as higher priority. Therefore, if you want more posts dedicated to JavaScript functions or similar, related topics, please drop a comment and let me know.

Continue reading

Strings (std::string) Demystified in C++ (including concatenation)

What is a String?

It is simply just a word. Strings are all around us. Like dog, cat, etc. A more formal definition would be the following: it is a series of characters that has a varying length.
Needless to say, strings are one of the most important concepts in programming.
Before we dive in, I would like to address those experienced only in high level languages such as Java, Python or Javascript. In C, there is no built-in support for strings.  Fortunately, the C++ standard library provides users with a string class. C++ developers probably let out a sigh of relief, since they didn’t have to write implementations for the equals operator or the 

size()

method.

Continue reading

Introduction to Javascript closure

Introduction

JavaScript closure is one of the most important concepts if you want to go anywhere with JavaScript. It is as important as pointers in C/C++. Closures empower JavaScript developers to write better code. So, if you want to become a better JavaScript developer, learn closures.With great power comes great responsibility however. Therefore, if misused, they can create a nightmare. In order to learn functional programming in JavaScript, developers first need to have a solid understanding of how JavaScript closure works.Continue reading

JavaScript Hoisting Variable Scope Explained

Introduction

What is hoisting? What is variable scope? How does JavaScript hoisting and variable scope work?  This post will explain how hoisting works in JavaScript. Before understanding how hoisting works, developers need to understand variable scope in JavaScript. This article will guide readers and explain the basics of how variable scopes work in JavaScript. Continue reading

The Stack Data Structure in Java

The stack is a fundamental data structure used in computer science.  In my opinion, it is one of the easier data structures to conceptually grasp and understand. Knowing and understanding how a stack works will not only make you a better programmer, it will also help you conceptualize problems in the future. It will become a great addition to your arsenal of data structures.  The implementation details will be written in Java.

Before continuing, readers should know about the linked list data structure. If you don’t know what a linked list is, please read my post on it before proceeding.

If there are any sections that lack detail, please shoot me a message or leave a comment. Lets dive straight into the meat!Continue reading

1 5 6 7