stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.65k stars 957 forks source link

Will using C# attributes to optimize code submissions be accepted? #2365

Closed Arc-huangjingtong closed 5 months ago

Arc-huangjingtong commented 5 months ago

Question and/or Comment

Will using C# attributes to optimize code submissions be accepted?

like

  if (fun == null)
  {
      fun.Invoke();
  }

be

fun?.Invoke();
Eideren commented 5 months ago

Not exactly sure I understand the question.

I'm guessing you meant;

if (fun != null)
{
    fun.Invoke();
}

For the first snippet.

If this question is about whether we would accept PRs which only contain code style changes, like you've shown above, not really ... we would rather your PR introduce at least a new feature, improve performance or fix a bug, if that's the case you may introduce change in style if they don't go against the style of the rest of the code base.

Reviewing style changes is very time consuming and if the PR doesn't do anything besides that it's often not worth the effort.

Let me know if I misinterpreted the question !

Arc-huangjingtong commented 5 months ago

Sorry,my english is not good ,but the word ‘like’ is ‘as sth be sth’ , In short,I understand your mean。 if i use Span replace old code to reduce GC,Is that okay? or use other High level C# Feature to improve Performance or ReFactory Code to reduce code line num?Is that okay?

Eideren commented 5 months ago

if i use Span replace old code to reduce GC,Is that okay? or use other High level C# Feature to improve Performance

Yep, very much welcome

ReFactory Code to reduce code line num?Is that okay?

Just reducing the amount of lines, not really, but if you reduce the amount of lines while fixing a bug or while improving performance, yes.

Arc-huangjingtong commented 5 months ago

Thank You!

NicusorN5 commented 5 months ago

Condider closing this thread @Arc-huangjingtong ?

Ethereal77 commented 5 months ago

I didn't notice this was an issue. Why are there issues labeled as question if we have the Discussions tab in GitHub?

Arc-huangjingtong commented 5 months ago

image

Ethereal77 commented 5 months ago

Well, then we should remove that and point users towards Discussions for questions and comments.

VaclavElias commented 5 months ago

Probably it was there historically. We can easily convert any issue to a discussion. Also, I can change that button to behave like the below, just links, so it could be just a link to Discussion.

image

image