Technology
Faster and more secure websites with JAMStack
JAMstack is the name of a specific architecture for building websites - here we tell you more.
Today there are a wide variety of programming languages, such as C++, Java and C#. Although many languages are related to each other, they are all good at different things. In this article we take a closer look at the object-oriented programming language C#.
C#, or C-sharp as it is pronounced, is an object-oriented programming language (OOP) that was developed by Microsoft in the 1990s/2000s. It is a successor to C++ but has many similarities with Java; some even say it is Microsoft's answer to Java. Since its inception, C# has become one of the most popular programming languages.
Perhaps it has become so popular precisely because it is related to other languages, like C++ and Java. That makes it relatively easy to learn and switch to as a developer. C# is also a powerful and straightforward language that can deliver complex code in a relatively simple way. It is therefore particularly well suited for developing applications – both for the web and for mobile devices. Primarily the language is used for development on Microsoft's .NET platform, but it can also be used on other platforms.
That C# is object-oriented means the program is divided into smaller parts, which makes it more manageable. The parts are called classes and describe what we know and what we can do with a certain type of thing. It works a bit like a template, or a blueprint, for how certain things should function and what should be included. When we program with C#, it means that objects are built from the same blueprint and share the same foundation, which is a major advantage
C# divides the program into smaller parts by using classes.
One could compare it to different boxes that have labels (classes), where each box contains different things (objects). Imagine a carpenter's shed where tools have been sorted and grouped into the different boxes. All screwdrivers are in one box and all saws are in another. Each box is clearly labeled with a tag that tells you what it contains. The different tools also have different functions - you hammer with a hammer and use a screwdriver to drive screws. Even though both are tools, they are entirely different things used for entirely different purposes.
A class can also contain variables and methods that define properties and functions. If we say that “Car” is a class, the variables are the car's properties in the form of, for example, model, number of doors or how much fuel is in the tank. The methods give the class (the car) functionality such as "drive forward" or "reverse". Together they become building blocks that can be reused, which makes development more cost-effective.
minBil and dinBil are different objects that can use the same class as a template
Classes also contain data that describe a specific thing (an object). In the car example, an object could be "My car". The object uses the class as a template to describe my specific car's properties and functions. Because the code can become quite extensive, a compiler is used. It keeps things organized and transforms code from one language to another.
If we return to the tools and the carpenter's workshop, the compiler would have read what was on the box's label and what it contains. It would then have translated that into a language that is understandable to the carpenter. When everything is organized into different boxes it also becomes easier for the carpenter to find a specific tool when he is going to perform a certain task. This saves both time and, in the end, money when developing an application.
So you don't have to reinvent the wheel, C# collects the various classes into a library, or framework. The code is then available to use for those who want it. The class library makes the code more structured, easier to read and simpler to reuse across different projects. This is useful, for example, if you want to expand and build on an application if the need changes.
At Limetta we like C# and the stack is based on it at the core. But because every project is different, the languages, methods and tools we use also vary. We also include TypeScript, React or Vue to name a few.