🧠 Virtual vs Abstract in C# - Finally Explained! Many junior developers see these method modifiers (keywords) everywhere in C# code, but surprisingly, a lot of them don't actually know what they mean or when to use each one. Here's the distinction that clears everything up: ✅ abstract - No implementation, MUST be overridden in child classes ✅ virtual - Has a default implementation, MAY be overridden ✅ none - Regular method, cannot be overridden Understanding these fundamentals is crucial for: 1. Designing proper inheritance hierarchies 2. Building maintainable object-oriented code 3. Acing technical interviews Which one confuses you the most? Drop a comment below! 👇 #CSharp #DotNet #Programming #SoftwareDevelopment #LearnToCode #DeveloperLife #CodeLife #TechTips #SoftwareEngineering #TechEducation #TechCommunity #OOP #CleanCode
Tanjil Ahmed-Choudhury’s Post
More Relevant Posts
-
🚀 10 Essential C# Fixes That Will Make You a Better Programmer 💻 Many developers unknowingly write C# code that’s inefficient or hard to maintain. In my latest article on CSharpCorner , I’ve shared 10 common mistakes and practical fixes to help you write cleaner, faster, and more maintainable code. Here’s a sneak peek: ✅ Avoid magic strings & numbers ✅ Stop using empty catch blocks ✅ Simplify overly complex conditions ✅ Replace async void with async Task …and more best practices you can apply today! Read the full article here 👉 https://lnkd.in/gH_AEr9j #csharp #dotnet #codingbestpractices #cleancode #programmingtips #programming #collections #codingtips #softwaredevelopment #coding #developer #dotnet #dotnetdeveloper
To view or add a comment, sign in
-
-
Finding Duplicates in an Array with C# — Let’s see how we find duplicates in an array with C#. Head over to the Azul Coding YouTube channel for more .NET and web dev tutorials: https://lnkd.in/eH4vfWAs #wpf #vbnet #csharp #dotnet #developer #visualstudio #softwaredevelopment #appdevelopment #learntocode #coding #dotnetcore
To view or add a comment, sign in
-
💡 C# Coding Tips Every Developer Should Know Even experienced developers forget the little things that make C# cleaner, faster, and easier to maintain. Here are a few reminders 👇 🧠 1. Use var wisely var improves readability when the type is obvious, but avoid it when it hides clarity. ✅ var user = new User(); ❌ var data = Get(); // What’s 'data'? ⚙️ 2. Prefer string interpolation over concatenation readable, clean, and less error-prone. ✅ $"Hello {name}, welcome back!" ❌ "Hello " + name + ", welcome back!" 🚀 3. Use using statements for automatic disposal C# 8+ introduced the simplified using declaration: using var stream = File.OpenRead("file.txt"); // No need for braces (disposed automatically) 🔁 4. Master LINQ for cleaner loops Instead of writing multiple for-loops, think declaratively. var activeUsers = users.Where(u => u.IsActive).ToList(); 🧩 5. Keep methods small and focused Each method should do one thing well. Easier to test, debug, and reuse. Great code isn’t just about logic, it’s about clarity and consistency. Your future self (and teammates) will thank you. 🙌 #CSharp #CodingTips #CleanCode #Developers #SoftwareEngineering #DotNet #Programming #TechCommunity
To view or add a comment, sign in
-
Hear from Tom Houghton-Alliss, Software Developer, on why JavaScript is the worst (but also best) programming language! #SoftwareDeveloper #JavaScript #DevLife #CodingLife #ProgrammerHumor #DeveloperTalk #TechInsights #FrontendDevelopment #BackendDevelopment #SoftwareEngineering #CodingCommunity
Why JavaScript is the Worst and the Best Language
To view or add a comment, sign in
-
🚀 Synchronous or Asynchronous? Understanding when to wait and when to run is the key to writing efficient code. Here’s a quick visual breakdown of Threads, Synchronous, and Asynchronous Programming — made simple for developers 👇 #Programming #SoftwareEngineering #Asynchronous #Multithreading #Developers #CodeSmart #JavaScript #AsyncAwait #TechLearning
To view or add a comment, sign in
-
Have you ever noticed that sometimes the exact same C# code only works when you change the order? And the reason is simple (but interesting 👇): Since .NET 6, C# supports top-level statements, which means you can write code directly inside Program.cs without defining a static void Main() method. Behind the scenes, the compiler automatically wraps your code inside a generated Main() method. That’s why all executable statements must appear before any type declarations (classes, structs, or interfaces). In other words: 🔹 Top-level statements must come before type definitions. So when you declare the class first, the compiler gets confused. But when the executable code comes first — or when the class is in a separate file — everything works perfectly. It’s one of those small but important details that show how understanding the compiler helps you master the language. C# is powerful, and every new version adds convenience… along with a few nuances like this that make a big difference in a developer’s everyday work. #CSharp #DotNet8 #SoftwareDevelopment #Programming #ObjectOrientedProgramming #CleanCode #DotNet #DeveloperCommunity #LearningCSharp
To view or add a comment, sign in
-
-
This is a great article on just how tricky casting bytes can be. It's the first article that I've read that covers all the gotchas such as aliasing, alignment, object lifetimes, and what to do about it!
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
Type punning in C++ leads to undefined behavior and still remains in our code based for several reasons: * it's a low-level code and thus can be ugly, * it works. Joseph Zalusky shows better approaches in modern C++ for the same job
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
Static Classes in C# Have you ever wondered when it makes sense to use a static class in C#? Static classes are those that don't need to be instantiated—that is, you don't create objects from them. They exist only once in memory and serve to group functionalities that don't depend on a specific object. Think of utility functions, such as mathematical calculations, specific temperature calculations, or simple validations. In these cases, it doesn't make sense to create an object every time—just call the method directly. Simple, direct, and efficient. But beware ⚠️ Not everything should be static—if the behavior depends on individual data (like a person with a name and age), then it makes sense to create objects. Use static classes only when the logic is general and independent of instances. Static classes help keep code organized, performant, and easy to reuse. Understanding when to use them is an important step in writing C# with style and purpose. #CSharp #Programming #SoftwareDevelopment #ObjectOrientedProgramming #CleanCode #DotNet #Learning #CSharpDeveloper
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development