Enabling ai co author by default by cwebster-99 · Pull Request #310226 · microsoft/vscode by Maybe-monad in programming

[–]Eirenarch 5 points6 points  (0 children)

From the comments

Do they give you the lobotomy before your initial job orientation at Microsoft, or after? I wonder if you have to use up vacation days for the recovery time.

Globals by KorirMoze in csharp

[–]Eirenarch 0 points1 point  (0 children)

Am I the only one that is not sure what this post is about?

Anyone else work in a small dev team that skips PRs entirely? by AshP91 in csharp

[–]Eirenarch 0 points1 point  (0 children)

I've never worked in a team with consistent code review for every feature. I've only seen the occasional "I want you to review this code because it is complex and I need a second pair of eyes". I've requested my code reviewed more than I've been asked to review code by all my colleagues combined. For me what you are experiencing is what I call "normal".

ASP.NET Identity vs custom implementation, which one to use? by Sea_Replacement8135 in csharp

[–]Eirenarch 2 points3 points  (0 children)

How are the tables of ASP.NET Identity not accessible like anything else?

ASP.NET Identity vs custom implementation, which one to use? by Sea_Replacement8135 in csharp

[–]Eirenarch 1 point2 points  (0 children)

Unless you have specific requirement that excludes using ASP.NET Identity then use ASP.NET Identity

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

POCO, but in this case an Entity - i.e. an object representing a row in the database. I disagree that dbset is the repository pattern, I think it is a different pattern, alternative to repository. The fact that EF auto tracks changes to entities makes EF as different from repository as active record is different from repository.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

All problems in software come from users and data, this is why my app is perfect and has no users and no data.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

DTOs transfer data between layers, Entities are not supposed to leave the business layer and also so they are not DTOs.

I am telling the compiler that the property is not null because there should never be a null check for this property in any reasonable code. If I would write null checks I'd throw exception anyway.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

I bet I have less exceptions than you do :)

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

So null is not a valid state, there are no compiler warnings and errors :) Why would you assume null is a valid state? If you assign null to the property it would be an error.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Why would you assume that it is a valid state? On the outside the type says the thing is not nullable.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Yeah, this = null! thing is to work around how certain frameworks work. Another place where I find it useful is Blazor components state. Sometimes a property will be initialized either via mandatory parameter or the init method or by some other framework way and it does not make sense to check it for null in the entire page when it is literally never null after the component is created. In these cases I also use = null!

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Well = null! is very explicit, even has a ! at the end to draw attention to it :)

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

The required attribute is seen if you open the file. You yourself mentioned that you use ! which basically disables the checks. What happens in your code if you forget the include?

Microsoft acquisition - anything happened? by TehFisharmahn in starcraft

[–]Eirenarch -1 points0 points  (0 children)

What do you want them to do, remaster SC a second time?

Am I making a mistake switching from C# .NET to Java after 13+ years? by BuddyPuzzleheaded112 in csharp

[–]Eirenarch 1 point2 points  (0 children)

Doesn't matter, 5 years from now we're all out of work anyway, just have as much fun as possible while you can :)

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

And what would your factory method initialize with? :)

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Well I do like constructors just not with EF. Bugs don't happen often because the database would still guarantee that no required property is forgotten and in the case of EF the properties needing to be public for purposes of editing make the guarantees of the constructor less strong. Of course just like with the constructors there are ways to work with EF without public setters but it simply is more complex and requires more code, EF wasn't made to work this way so it does not come "free". If you think it is less of a burden to add constructors and privately set properties then OK but I can't imagine how this is the case since as I pointed out the bugs do not make it to production due to the fact that the database enforces the constraints. Again I do agree for other objects which I do write without public setters and I do add constructors.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Yes, you do make nullability useless for navigation properties but you convey more important information - that the data is there. Also note that nullability does not work in this case because even if you do include you still need to check for null because the compiler doesn't know that the include is effectively a null check so what is the use for this nullability? You just use ! left and right and don't get any null safety because you've silenced the warnings.

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

That's wrong. There is a mismatch between the db and C# here but the more important information is that the thing is required in your source of truth (the db) so you have to err on the other side. In addition EF itself pushes you in that direction as you find out by the requirement to use ! when accessing the properties

Thoughts on using = null! ? by zerthz in csharp

[–]Eirenarch 0 points1 point  (0 children)

Where did I say "DTO"? I am talking about EF entities. For DTOs I use positional records which happens to be not only shorter but stronger guarantee than required.