Sitemap

Member-only story

Exploring the Differences Between Records, Classes, and Structs in .NET

Record Vs Class Vs Struct in C# .NET: Software Interview Question

4 min readOct 2, 2023

--

Press enter or click to view image in full size

Welcome, engineers!

Today, we are exploring the difference between a struct class and recordin C# .NET.

As a software engineer, you’ve likely encountered various data structures in C# and are familiar with the core constructs: classes and structs. However, with the introduction of C# 9.0, a new type called “records” has been added to the language. In this article, we will explore the key differences between records, classes, and structs in C#. We’ll also provide code examples and benchmarks to illustrate these differences.

If you want to see an article about records that goes in depth, I am going to place this here:

This is a question given for a Mid Software Engineer level.

Place your booty in a comfortable position and Let’s Get Right Into It!

Understanding Classes

--

--

Ivo Manolov
Ivo Manolov

Written by Ivo Manolov

I write about my life, point of view, investing business and software development. Let's grow together!