TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

IList, IComparable, ICarumba

2 pointsby acazsouzaover 13 years ago

1 comment

manuscreationisover 13 years ago
Just to get this out the way: In his example, his resulting command should be (if hes such a stickler for naming conventions) CommandBase (or BaseCommand).<p>Prefixing Interfaces with an I is not a mistake; Using an Adapter Pattern when one is not the right choice, is the mistake.<p>"I can’t think of any logic to put in the base class and the Dependancy Inversion Principles says interfaces are preferred. So I’ll make it an interface and follow the IConvention naming it ICommand."<p>But then he does think of logic that he wants in a base class, as he goes about developing it. Also, hes following DI principles without first thinking about how those principles apply. It feels as though hes just putting fingers to keyboard without putting thought towards the design itself.<p>We've all run into this scenario, and yes it can be a pain in the ass - Thats why you should stop and think before writing any code and make sure the choices you're making now, are the choices you'll want to live with later.<p>As for the hassle of having to change things... I don't think theres a developer worth his salt who hasn't gone through that scenario a dozen times over, and probably will go through it another dozen times atleast. Things always change partways through development, and you realize you based later work on an earlier assumption that did not hold up. It's part of the process.<p>tldr; Interfaces begin with an I, Base classes should be labeled as such