 |
plc.myforum.ro PLCs users www.plc.myforum.ro!
|
| View previous topic :: View next topic |
| Author |
Message |
kosta Member

Joined: 09 Aug 2015 Posts: 161 Location: Salonic
|
Posted: 28/11/2017 18:38 Post subject: C# BAD PRACTICES |
|
|
C# BAD PRACTICES: Learn how to make a good code by bad example
Radosław Sadowski
A purpose of this article is to show how to write a clean, extendable and maintainable code by showing example of badly written class. I will explain what troubles could it bring and present a way how to replace it by a better solution – using good practices and stil patterns.
First part is for every developer who knows C# language basics - it will show some basic mistakes and techniques how to make code readable like a book. Advanced part is for developers who have at least basic understanding of design patterns – it will show completely clean, unit testable code.
To understand this article you need to have at least basic knowledge of:
C# language
dependency injection, factory method and strategy design patterns
Example described in this article is a concrete, real world feature – I won't show examples like build pizza using decorator pattern or implement calculator using strategy pattern
The Open Closed Principle was introduced in book "Object Oriented Software Construction" by Bertrand Meyer.
It says:
"software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification ".
C# BAD PRACTICES: Learn how to make a good code by bad example
https://www.codeproject.com/Articles/1083348/Csharp-BAD-PRACTICES-Learn-how-to-make-a-good-code
C# BAD PRACTICES: Learn how to make a good code by bad example – Part 2
https://www.codeproject.com/Articles/1213327/Csharp-BAD-PRACTICES-Learn-How-to-Make-a-Good-Co
C# BAD PRACTICES: Learn how to make a good code by bad example – Part 3
https://www.codeproject.com/Articles/1097145/Csharp-BAD-PRACTICES-Learn-how-to-make-a-good-co
C# BAD PRACTICES: Learn how to make a good code by bad example – Part 4
https://www.codeproject.com/Articles/1173928/Csharp-BAD-PRACTICES-Learn-how-to-make-a-good-co |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|