• Advanced - Coding - C# - Software Engineering

    Advanced C# Tips: Prefer Structs for Immutable Data

    Before diving into topic, I want to begin with clarifying the terminology. Immutable data refers to data whose state cannot be modified after it has been created. Once an immutable object is created, its internal state remains constant throughout its lifetime. Any attempt to modify the object’s state results in the creation of a new object with the updated state, leaving the original object unchanged. In C#, you can define your data using either classes or structs. The choice between a class and a struct can influence the behaviour and performance of your application. Classes are reference types and structs…

  • Advanced - Coding - C# - Software Engineering

    Advanced C# Tips: Use ‘in’ Parameter Modifier for Large Value Types

    In C#, the in parameter modifier is relatively a recent addition. It added in C# 7.2. The main point of in keyword is to pass a large value type to a method without copying the entire structure. Value types in C# are typically passed by value. This means that the entire thing is duplicated and handed off to the method. This may not be a big deal for small value types like int or bool. However, for larger value types, it can be quite expensive in terms of performance because it takes time and memory to take care of these…

  • Programming Languages - Coding - C# - Advanced - Software Engineering

    Advanced C# Tips: Don’t Use unsafe for Minor Gains

    The title could have also been “Don’t use unsafe code at all!” You will come to the same conclusion after reading this post, but still I gave a room for its usage. In C#, the usage of unsafe code is a topic of debate. On one side, it offers the potential for performance gains in specific scenarios. Yet the risks and complexities it introduces often outweigh its benefits. What is unsafe Unsafe code in C# refers to a block of code that uses pointers and allows direct memory manipulation, bypassing the .NET runtime’s type safety and security checks. This capability…

  • Intermediate - Web Development - Java - Azure - C# - React

    Azure Active Directory Login with React, with C# or Java Backend

    Keeping things secure is the important part of any application. As entire internet going to cloud, Azure Active Directory (AD) is one of the best possible among one of two popular options. It helps manage who can use your app and what they can do. Let’s see how to set up Azure AD for a C# and Java Spring Boot backend, and a React frontend to make sure only the right people get in. First, go to the Azure portal and make a new Azure AD tenant if you don’t have one yet. Then, register your app in Azure AD.…

  • Software Engineering - Coding - C# - Advanced - Web Development

    Unlock Faster Performance: Advanced Caching Tactics for .NET Core

    In software development, performance optimization is a crucial topic and one of the most effective ways to improve the performance is caching. However, caching is a double edged sword we need to very careful about when and how to use caching. So, we need to use right strategy in right place. Caching can be implemented at different levels, including memory, network, and CDN (Content Delivery Network) levels. Each level has a unique purpose and is suitable for different use cases. In this post, we will focus on memory-level caching which is simply storing the data in the memory of the…

  • Coding - C# - Containerization - Beginner

    Containerizing a .NET Application with Docker – Step by Step Guide

    Docker is a powerful tool that allows developers to package applications into containers. These containers can run on any system that has Docker installed, making it easier to deploy and run applications consistently across different environments. Containers are like lightweight, portable packages for your application, including everything it needs to run: code, runtime, libraries, and settings. I assume that you have already know what Docker is and also you have .NET and Docker installed on your machine. Don’t worry, just download and then next + next. For more details and official documentation, you can visit Docker’s official website and for…

  • Python - NoSQL - C# - Cloud Computing - Intermediate - Coding

    Remote Caching in Scaled-Out Cloud Applications: A Case Study with Redis, C# and Python

    A few weeks ago, we were discussing a problem with my team mates and a colleague raised a question about a very basic distributed remote caching problem which was about an application scaled out across multiple instances, managing how data is cached can become a significant challenge. Let me take the shortcut and directly jump into the problem. Consider a scenario where you have multiple instances doing the same job and you need to cache the result of a function which takes about 30 seconds. This function’s result needs to be cached to avoid redundant executions across different instances. The…

  • React - Web Development - Intermediate - Coding - C#

    Using SignalR with React

    Recently, I had the opportunity to work on a project where React and SignalR were integrated. This experience was quite insightful, and I am eager to share my learnings about this effective combination. SignalR is a library provided by Microsoft, designed to add real-time functionality to web applications. This means that applications can automatically push content to connected clients without them requesting it. Imagine a chat app where messages pop up instantly, or a stock monitoring tool where data refreshes in real time SignalR would be a good choice. Combining SignalR with React offers a dynamic platform for real-time web…

  • Cloud Computing - Azure - Beginner - C#

    On Azure Functions and Serverless

    There’s no shortage of tools and technologies to make developers’ lives easier In the world of cloud computing, and one such offering comes from Microsoft which is Azure Functions. Here, we’ll unravel the magic behind Azure Functions and explore why it’s becoming a favourite for certain architectures. At its core, Azure Functions is a serverless compute service. “Serverless” might sound misleading, as there definitely are servers involved; however, the idea is that the responsibility of server management, scaling, and infrastructure concerns are taken away from the developer. This allows us to focus on writing and deploying our code. Azure Functions…

  • Coding - NoSQL - C# - Databases - Beginner

    MongoDB through C# – Using the Official Library

    MongoDB is a popular NoSQL database, which means it doesn’t use tables like traditional databases. Instead, it saves data as ‘documents’, which are like flexible data entries. If you’re using C# and want to work with MongoDB, there’s an official library made just for that. In this post, we’ll check out this library, see some basic MongoDB info, and walk through some C# code examples for common tasks. In MongoDB, data is saved in collections as documents. Think of collections like folders on your computer, and documents like files in those folders. But here, each document can have different data…

  • Azure - C# - Cloud Computing - Beginner

    Azure Blob Storage and C# Integration

    Azure Blob Storage is one of Microsoft Azure’s storage solutions. Think of it as a massive cupboard in the cloud where you can keep a lot of stuff, from pictures and videos to logs and backups. In this article, we’ll explore what Azure Blob Storage is, when you might want to use it, and how to play with it using C#. Azure Blob Storage is a place in the Azure cloud where you can save large amounts of unstructured data, which means it doesn’t have a specific format or structure. It’s like having a big box where you can throw…