I can come to no other conclusion: .NET programmers tend to be weaker in agile software practices, design patterns, design principles, and so on. Often in my classes, the .NET programmers had never heard of these fundamental concepts. This has to change.
So take the DIP.
High level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend upon details. Details should depend upon abstractions.
Well for a beginner, or someone who is not well versed in design patterns and principles, visual aids are great tools in understanding and learning.
For example, if in a use case interactor, I see
Employee employee = storageOfficer.getEmployeeMatching(employeeId);
if(employee.isPayDay(today))
Pay(employee)
I can instantly know that this code needs to be examined, because it's a high level module and I can easily see that it's depending on low-level details (a concrete employee). Now again, keep in mind that this is from the point of view of a beginner who is learning to apply design principles and patterns.
I should add that for my example, the system from the code above only has the one type of Employee (no hourly, salaried, commissioned, etc.) for right now, but it's definitely going to change as these things always do. Now, as I gain experience, there are definitely other cues that I could use, but again, for the beginner, this simple visual aid in this instance is priceless.
Conversely, if that same code was written as
IEmployee employee = storageOfficer.getEmployeeMatching(employeeId);
if(employee.isPayDay(today))
Pay(employee)
I can instantly see that this code is properly depending on abstractions, all because the "I" in the interface name is a great visual aid to a newb.
So basically, the reason that I continue to decorate my interface names with the letter "I", is because it greatly helps me and other members of my team see where we need to examine decisions in the code. Once I've reached Jedi-master-status and don't need these anymore, then I still think they'd be helpful to future padawans.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.
GameHero hero = storageOfficer.getGameHeroMatching(gameHeroId);
hero.saveTheCity();
--
Says nothing. GameHero could be abstract. I could create a new concrete class called IGameHero and nothing would stop me.
On 4 February 2014 16:12, Terence McGhee <terence...@gmail.com> wrote:
Hey gang.
I definitely agree 100% that using features of Visual Studio can help with the visual aids. I think this is a great idea. However, the code is not always viewed in an IDE.
For example, my question to the group is this: Just by looking at the code fragment below, tell me is it coded to an abstraction?
GameHero hero = storageOfficer.getGameHeroMatching(gameHeroId);
hero.saveTheCity();Sebastian, I definitely agree with you in that naming notations in general are useless and a waste of time. It's just that in the case of interfaces, I'm willing to make an exception, because I can appreciate the value in being able to see at-a-glance where the abstractions are in the code base. But in all other cases, I don't use any other notations.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
GameHero hero = storageOfficer.getGameHeroMatching(gameHeroId);
hero.saveTheCity();
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
Interesting. I just read somewhere that .NET developers were far better at object-oriented programming (domain style, as opposed to service-oriented) than Java developers.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsubscri...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.