Software Development

PHP – The Elvis Operator (?:) Explained

In PHP, the question mark immediately followed by a colon like this ?: is unofficially referred to as the elvis operator. The elvis operator is a variation of the ternary operator that can seem cryptic initially while reading code. However, once it is understood it is helpful way to quickly write code that reduces the …

PHP – The Elvis Operator (?:) Explained Read More »

Laravel – How To Check If A Collection Is Empty

In Laravel, it is a common mistake to use PHP’s empty() function to check if a collection is empty. When empty() is used on an empty array [] the boolean value of true is returned. However, using empty() on a collection can cause unexpected results because when a collection has no values the empty() function …

Laravel – How To Check If A Collection Is Empty Read More »

PHP – Loose Comparison (==) VS Strict Comparision (===)

In PHP, there are two options when comparing values in a condition. These comparison options are loose comparison (==) and strict comparison (===). PHP is a loosely typed language which means that variables can be assigned different data types during execution of the application and different data types can be compared in a conditional. This …

PHP – Loose Comparison (==) VS Strict Comparision (===) Read More »

Javascript – Equality (==) Operator VS Strict Equality (===) Operator

In Javascript, there are two options when comparing values in a condition. These comparison options are equality (==) and strict equality (===). Javascript is a loosely typed language which means that variables can be assigned different data types during execution of the application and different data types can be compared in a conditional. In strictly …

Javascript – Equality (==) Operator VS Strict Equality (===) Operator Read More »

Javascript – When To Use console.dir() Instead Of console.log For Debugging

When debugging javascript it is common to use console.log() to print variables or messages to the browser’s dev tools console. The dir() method is another tool for logging that can be useful in certain situations. From the MDN Web Docs, console.dir() is given the following description: “The method console.dir() displays an interactive list of the properties of …

Javascript – When To Use console.dir() Instead Of console.log For Debugging Read More »

C# – Lists

In C#, a list is a variable that is able to store multiple values of the same type and those values can be accessed by an index. This is similar to arrays which were covered in the previous post. However, unlike arrays, the size of the list does not need to be set at declaration …

C# – Lists Read More »

C# – Arrays

In programming, a variable is used to store a value in memory. Arrays are a type of variable that is able to store multiple values. Arrays can be thought of as a container of values. This article will explain how to use arrays in C#. In C#, arrays must be of the same data type …

C# – Arrays Read More »