Message from @porco
Discord ID: 480360627752271882
He's a wannabe coder now, so he has big opinions
>said the hamburger coder
The only thing I code is my insulin pump
in my case it's not the interfaces that are too distinct, it's the classes that are not distinct enough
Get it? The joke is that I'm diabetic because I'm fat
for example, my `WikiPageListRepository` could also be `MySQLWikiPageListRepository`
`VideoSearchEngine` could be `HttpVideoSearchEngine`
but in the end, all those interfaces expose a tiny bit of replaceable functionality
tbh I'd thought that since they all use Search part then linkin them to ISearch should be enough
But then again I'm not the one hosting porn indexing site
ISearch would be waaaay to big
`ISearchQueryGenerator` generates search queries for the links
`SearchQueryGenerator` implementation does this, using the HTTP Request
soon, I will have a new implementation, that does this out of the request log
`IVideoSearchEngine` is a very simple interface
it allows you to search videos
the implementation of `IVideoSearchEngine` uses ElasticSearch
Now I could substitute this with an implementation running Lucene and use both at the same time if I was retarded
that's the reason for having an interface for everything
also what you saw there is only the DI container
the DI container needs exactly ONE interface and the classes it passes through
```csharp
public interface IExample {
IExample Test(string name);
}```
This part from your code baffles me
But maybe because I haven't experienced much with interfaces at all
you can have a fluent interface
```csharp
something.WithThat().WithThis()```
that's what it is for
the implementation then returns itself
It kinda makes sense that you could do it. Guess I need more IRL programming rather than write programs to pass tasks
the difference is clear:
```csharp
var url = searchqueryGenerator.WithTerm("asian").WithPage(13).WithOrientation(Orientation.Straight).Compile();```
vs
```csharp
searchqueryGenerator.WithTerm("asian");
searchqueryGenerator.WithPage(13);
searchqueryGenerator.WithOrientation(Orientation.Straight)
var url = searchqueryGenerator.Compile();
```
depending on the scenario, either 1 or 2 is the more readable one
Why not
```csharp
var url = searchQueryGenerator.WithTerm("asian")
.WithPage(13)
.WithOrientation(Orientation,Straight)
.Compile();```
yes that's the same, that's version 1 but with new lines
but in order to have this, it must return itself
Why not just go with ver1.5 aka new lines
I copy pasted that from my viewmodel
I use it inline HTML
I don't want to have newlines in my `<a href`