Download Logo

Methods in C# (Ch. 8)

Understanding C# Methods and Functions What are Functions and Methods? A function (also called a method in C#) is a reusable block of code that performs a specific task. Think of it as a recipe that you can follow multiple times with different ingredients (parameters) to get the same type of result. Why Use Functions? Functions solve several important problems in programming: Code Reusability: Write once, use many times Code Organization: Break complex problems into smaller, manageable pieces Maintainability: Fix bugs or update logic in one place Testing: Test individual pieces of functionality Readability: Make code more self-documenting Real-World Example: The Problem Without Functions Let’s say you want to calculate the sum of two numbers with validation. Without functions, you’d write: ...

June 20, 2024 · 13 min · 2611 words · PrashantUnity
Download Logo

Linear structures (Ch. 9)

C# Linear Data Structures Arrays Arrays are fixed-size collections of elements of the same type. They allow direct access to elements via index. Example: Arrays 1 int[] numbers = new int[] { 1, 2, 3, 4, 5 }; Lists Lists are dynamic arrays that can grow in size. They provide methods to add, remove, and access elements. Example: Lists 1 2 3 List<string> names = new List<string>(); names.Add("Alice"); names.Add("Bob"); Queues Queues follow the First-In-First-Out (FIFO) principle. Elements are added at the end and removed from the front. ...

June 20, 2024 · 2 min · 375 words · PrashantUnity
Download Logo

Learn C# — links

C# Learning Resources for Beginners Welcome to this comprehensive guide of C# programming resources! Whether you’re interested in game development, web applications, or general software development, these carefully curated resources will help you start your C# journey. This guide is organized by topic, from basic setup to advanced concepts, making it easy to find exactly what you need at each stage of your learning process. Official Documentation Start your C# journey with Microsoft’s official documentation - the authoritative source for everything C#. The documentation includes: ...

October 19, 2025 · 4 min · 685 words · PrashantUnity
Download Logo

Classes in C# (Ch. 11)

Class A class represents a blueprint of an object. Currently, we know some basic data types: For representing numbers, we use types like int, long, byte, decimal, etc. For representing words, we use string or arrays of characters (char[]). For storing collections of numbers, we use arrays (int[], float[], etc.). However, what about storing complex objects like Person, Planet, etc.? For example, a Person object might have properties like Name (a string), Age (an integer), and methods like IsCoding(). classDiagram class Person{ +Name +Age +IsCoding() } From the diagram above, we see that a class named Person encapsulates a contextual representation driven by developers. It defines properties and behaviors specific to a person, allowing us to model and work with such complex entities in code. ...

June 24, 2024 · 6 min · 1173 words · PrashantUnity
Download Logo

Linked lists (Ch. 13)

Linked List I will use VS Code with Polyglot Notebook. Why? It is easier to show and visualize to others using Polyglot Notebook. You are free to use any code editor or IDE of your choice. I recommend VS Code because it allows for direct code execution without adhering strictly to C# syntax, facilitating easier visualization. Attempting to implement the same code in another editor may result in compile-time errors. I will identify lines that cause errors, and you can remove those specific lines of code. Create One Class Name CodeFrydev If you are not familiar with classes, please follow this post first; only then will you be able to understand. ...

June 24, 2024 · 11 min · 2243 words · PrashantUnity