What is Polymorphism in Programming? Polymorphism is a concept in programming where the same interface can be used for different underlying forms. The word itself originates from the Greek roots poly (meaning many) and morph (meaning change or form). Examples ...
Codepey Latest Articles
“Overriding GetHashCode When Equals is Overridden: Why it Matters”
Codepey_AdminWhy is it Important to Override GetHashCode when Equals Method is Overridden? When creating a class that represents a row in a table, it is important to override the Equals method. This is because the Equals method is used to ...
Calculating Relative Time in C#
Codepey_AdminWhen developing software applications, it is often necessary to display relative time, such as 2 hours ago, 3 days ago or a month ago. In this blog post, we will explore how to calculate relative time in C#. Jeff’s Code ...
“Understanding the Difference Between const and readonly in C#”
Codepey_AdminThe Difference Between Const and Readonly in C#: When to Use One Over the Other When discussing the differences between const and readonly in the C# language, there are a couple of different things to consider. Apart from the obvious ...
Deciphering Type Checking: typeof, GetType, or is?
Codepey_AdminType Checking in C#: typeof, GetType, or is? Type checking is an important task when coding in C#. There are three ways of doing type checking: typeof, GetType, and is. It is up to the developer to decide which method ...
How to Fix a NullReferenceException
Codepey_AdminNullReferenceException Object reference not set to an instance of an object is one of the most common exceptions thrown in the programming world. This exception is also known as a NullReferenceException and is caused by trying to use something that ...
Understanding the Double Question Mark in C#
Codepey_AdminWhat is the Null Coalescing Operator in C#? The null coalescing operator (??) is a language feature found in C# 3.0 and later that provides an easy way to assign a value to a variable, based on whether a provided ...
Create Excel Files in C# Without Office
Codepey_AdminCreating Excel (.XLS and .XLSX) Files with C# Without Installing Microsoft Office A lot of people need to create Excel files in their applications but don’t have Microsoft Office installed on their machine. This can be a difficult requirement to ...
Retrieve C# Enum Value
Codepey_AdminGetting an Integer Value from an Enum in C# An enum is a powerful tool in C# that allows developers to easily define a set of named constants. Enums are often used to represent a group of related integers, such ...
“Setting an Initial Value for a C# Auto-Property”
Codepey_AdminUnderstanding How to Give C# Auto-Properties an Initial Value When developing with C#, it can be useful to know how to give auto-properties an initial value. In this article, we will discuss the old syntax, the new syntax introduced in ...
Generating Random Integers in C#
Codepey_Admin
Randomness in C# – Understanding the Philosophy behind it Randomness is an important concept that is often used in computer programming, and C# is no exception. In this article, we’ll explore the philosophy behind randomness, and understand how it works ...
Using Directives in C#: Inside or Outside Namespace?
Codepey_AdminUsing Directives in C#: Inside or Outside the Namespace? When it comes to using directives in C#, it can be a tricky question as to whether they should be placed inside or outside the namespace. This article aims to provide ...