What Makes Good Code? – Should Every Class Have An Interface? Pt 1
Are you interested in learning about interfaces in C#? This article explains the idea behind a C# interface by showing examples of interfaces in code.
Are you interested in learning about interfaces in C#? This article explains the idea behind a C# interface by showing examples of interfaces in code.
What Makes Good Code? It's been a while since I've had a programming oriented post, and I figured this would be a great topic to write about. It's been a topic I've been thinking about more and more over the last year and I've been experimenting with certain patterns and practices to see if certain things actually make code "better". A lot of the information presented in this series will be completely based on my opinion, but I'll try to back up my opinion with as many concrete examples as I can. If you have a differing opinion, I'd love to hear it in the comments. I'd also like to call out that much of what I'll be discussing is in the context of object oriented programming. To be specific, there may be mostly C# examples used. If this isn't something…
Whose Job Is It? I wanted to share my experience that I had working on a recent project. If you've been programming for a while, you've definitely heard of the single responsibility principle. If you're new to programming, maybe this is news. The principle states: That every class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class You could extend this concept to apply to not only classes, but methods as well. Should you have that one method that is entirely responsible for creating a database connection, connecting to a web service, downloading data, updating the database, uploading some data, and then doing some user interface rendering? What would you even call that?! The idea is really this: break down your code into separate pieces of functionality.…
Code smells are hints that code is taking a potentially nasty turn. What are some common code smells that we should all be looking out for as we're coding?
Code smells are hints that code is taking a potentially nasty turn. What are some common code smells that we should all be looking out for as we're coding?
Leverage interfaces when creating an application to create a clean and robust API. Practice decoupling your code from concrete classes by using interfaces!