DEV Community

Discussion on: No Sacred Cows: I, Interface

Collapse
 
_genjudev profile image
Larson
  • They create a consistent look to the code, so that readers can focus on content, not layout.

Look at my name and tell me what I'm. That is also how you can structure projects. When looking at the filename and folder in context you should already know what this is.

You see IBookRepository and knows what that is. Thats the whole reason. Analyzing the layout distracts from programming. When working in multiple projects it's really helpful not to think a second about what something is.

Collapse
 
sam_ferree profile image
Sam Ferree

When you say "what this is" do you mean you should be able determine domain specific information about what's in the file? If so I agree.

If you're saying I need to know whether the file contains an interfaces or some other type, then I'm not really sure you've provided anything sufficient to convince me why. If I see ScheduleWriter and ScheduleReader I don't need to spend any more time than I do when I see IScheduleRepository. I will either need to examine those files or not based on whether or not I need to persist Schedules.

If I don't need to persist Schedules, I can ignore ScheduleWriter and ScheduleReader as easily as I can ignore IScheduleRepository.

If I do need to persist Schedules, then I need to look at those files to see what the API is.