CPP: Control Flow

C++ is using C like control statements. These statements are based on structured programming theory. Are designed to avoid _spaghetti code_ that use to be created using goto statement. Two most important structures are conditionals and iterations. Conditionals These statements based on  logical expressions. The most important is “if” statement.…

CPP: Language Overview

This: “++” is the increment operator specific to C. Using this operator, C++ is an incremented version of C language. It is inspired from Simula and is C with classes. It was created to improve productivity of C developers. History of C During 1970 Dennis Ritchie created C Programming language.…

Introduction to Go

Go also known as GoLang is a third generation computer language. It was designed by a team of three at Google. The initial intention was to create a system language to replace C++ but this was changed later after Go has implemented a garbage collector. Now Go is just another…

Go: Type system

Type inference When declaring a variable without specifying an explicit type (either by using the := syntax or var = expression syntax), the variable’s type is inferred from the value on the right hand side. When the right hand side of the declaration is typed, the new variable is of that…

Go: Control flow

Decision Statement The decision statement in Go like in many other languages is the “if” statement. This statement is using a conditional expression that evaluate to a Boolean value. When the value is true the next statement or block of statements is executed otherwise is not executed and skipped over.…

Go: Parallel programming

Goroutine A goroutine is a lightweight thread managed by the Go runtime. A gorutine is a function that is executed using keyword “go”. Having a function “f” we can run the function using “go” keyword: f(x, y, z) go f(x, y, z) Goroutines run in the same address space, so access to…

Introduction to Rust

Rust is a systems programming language that runs fast, and guarantees thread safety. This is a basic introduction to Rust for advanced software developers not for beginners. If you are not familiar with any computer language you better learn first Python. Language Syntax Rust syntax is curly braced like C++ and…

Rust: Control flow

Control flow is a set of statements that organize the sequence of execution for each statement. This is the most important thing you must learn about structured programming: How to control the logical path of your program. Basic concepts The control flow is a metaphor. The program is compared to…