Month: 6 months ago

HOW GOOD ARE SOLID PRINCIPLES?
Business Software Development

SOLID Principles in C#: Clean Code Made Easy

Writing maintainable, flexible, and scalable software is every developer’s goal. The SOLID principles are a cornerstone of object-oriented programming (OOP) that help achieve this. Here’s a breakdown with bad vs good examples, pros, and cons. 1. Single Responsibility Principle (SRP) Definition:A class should have only one reason to change — it should handle a single […]

Sthembiso Mashiyane 
IEnumerable vs ICollection
Uncategorized

Understanding IEnumerable vs ICollection in C#

When working with collections in C#, two interfaces are foundational: IEnumerable<T> and ICollection<T>. Knowing the difference between them is crucial for writing efficient, maintainable, and correct code. What is IEnumerable<T>? IEnumerable<T> is the most basic interface for collections in .NET. It allows forward-only iteration over a sequence of items. Key points: Example: Notice: IEnumerable doesn’t […]

Sthembiso Mashiyane