Software Developer Principles and Practices

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

39 Terms

1
New cards

Single Responsibility Principle (SRP)

A class should have only one reason to change, meaning it has a single responsibility or concern.

2
New cards

Open/Closed Principle (OCP)

Software entities should be open for extension, but closed for modification.

3
New cards

Liskov Substitution Principle (LSP)

Base classes should be substitutable for their derived classes without affecting the execution or correctness of the program.

4
New cards

Interface Segregation Principle (ISP)

Clients should not be forced to depend on interfaces or methods they do not use.

5
New cards

Dependency Inversion Principle (DIP)

High-level modules should not depend on low-level modules; both should depend on abstractions.

6
New cards

Inversion of Control (IoC)

A design principle where code delegates the creation and binding of dependencies to an external framework or container.

7
New cards

Explicit Dependencies Principle (EDP)

Classes and methods should explicitly request any collaborators they need via public constructors or method parameters.

8
New cards

Abstraction

Hiding complex implementation details and showing only the essential features of an object through contracts.

9
New cards

Encapsulation

Bundling data with methods into a single unit while restricting direct external access to internal state.

10
New cards

Compile-Time Polymorphism

Resolving method calls at compile time through method overloading or operator overloading without requiring inheritance.

11
New cards

Runtime Polymorphism

Resolving method calls at runtime using inheritance alongside virtual and override keywords.

12
New cards

Inheritance

Reusing code by allowing a child class to inherit properties and behaviors from a parent class.

13
New cards

Composition

Building complex objects by combining smaller objects ("has-a" relationship) rather than inheriting from base classes.

14
New cards

Delegation

An object-oriented practice where an object hands off responsibility for a task to another object or method.

15
New cards

Delegate

A type-safe C# object that holds a reference to one or more methods matching a specific signature.

16
New cards

Func

A predefined C# delegate for a method that takes zero or more parameters and returns a value of type T.

17
New cards

Action

A predefined C# delegate for a method that takes zero or more parameters and returns void.

18
New cards

Predicate

A predefined C# delegate that takes exactly one parameter of type T and always returns a boolean.

19
New cards

Event

A specialized delegate wrapper that enables multicast notifications while restricting external code to subscribing and unsubscribing only.

20
New cards

Covariance (out)

Allows substituting a more derived type in output or return positions of generic interfaces and delegates.

21
New cards

Contravariance (in)

Allows substituting a less derived (more general) type in input parameter positions of generic interfaces and delegates.

22
New cards

Invariance

Strictest generic typing where no type substitution is allowed, requiring exact type matching for both inputs and outputs.

23
New cards

Task

A reference type in .NET representing an asynchronous operation or a future result.

24
New cards

ValueType (ValueTask)

A struct in .NET that represents an async operation or completed result to reduce heap memory allocations.

25
New cards

Pure Function

A function that always returns the same output for the same input and produces no side effects.

26
New cards

DRY Principle

"Don't Repeat Yourself"—a practice focused on reducing code duplication across a system.

27
New cards

KISS Principle

"Keep It Simple, Stupid"—a design rule prioritizing simplicity over unnecessary complexity.

28
New cards

YAGNI Principle

"You Ain't Gonna Need It"—a guideline to avoid implementing features until they are strictly needed.

29
New cards

Pareto Principle (80/20 Rule)

The observation that roughly 80% of outcomes or defects stem from 20% of causes or core features.

30
New cards

REST

Representational State Transfer—an architectural style for designing stateless, networked client-server applications.

31
New cards

CRUD

Create, Read, Update, Delete—the four fundamental operations for persistent data management.

32
New cards

Primitive Obsession

A code smell where primitive data types are overused to represent domain concepts instead of dedicated value objects.

33
New cards

Magic Strings

Hard-coded string values used directly in business logic without central definition or compile-time checking.

34
New cards

Magic Numbers

Unexplained, hard-coded numeric literals used directly in logic without named constants.

35
New cards

Principle of Least Privilege

Granting a module or user only the minimum access rights required to perform their function.

36
New cards

Principle of Least Surprise

Designing software components to behave in ways that users and developers intuitively expect.

37
New cards

Law of Demeter

Also known as the Principle of Least Knowledge; states that a module should only communicate with its immediate collaborators.

38
New cards

Fail Fast Principle

Detecting invalid states or errors as early as possible and halting execution immediately to simplify debugging.

39
New cards

Postel's Law

The Robustness Principle: be conservative and strict in what you output, but liberal and flexible in what you accept as input.