You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will write down issues here relating to code quality which i think could be done better or require an explanation.
Reduce branching/nesting where possible
There are areas where unnecessary branching/nesting is introduced. Ultimately as complexity of the code grows so does the overhead introduced by these control flow features. If we assume a ideal Combat Class which manages from lvl 1 to top tier raids. Its likely in current style of code it would include thousands of control structures in case of need to handle every unique case that may happen during various states of execution. This would result in a lot of time spent traversing branches. A rewrite in well written behavioral trees approach would greatly reduce this overhead and make code much more readable.
Variable/parameters/args naming conventions
Some variables/parameters/args conform neither to PascalCasing nor to camelCasing conventions.
For loops where foreach loop suffices
Some for loops actually don't have any need for use of the index, the item of foreach loop suffices
This is adressed in for loops/nesting reduction #114
Variables can be just var
Depends on consensus i am fine with vars where the underlying type is obvious from context
There are many places where variable type is apparent no need to speficy, like:
inttotalSeconds=(int)totalTime.TotalSeconds;
Separate code and data constants
It would be great to isolate various magic numbers, scripts, texts from code into data constants
Project structural problems
Combat classes do not belong to engines, however moving them proper namespace would trigger instantiation of abstract classes and therefore compilation would fail.
Enforce line ending
Matter of consensus indeed however according to theory by Markus Itkonen, Typography and readability
the optimal size of a single line should be 40 to 90 characters wide, historicaly programmers have been biased since ancient times to magically decide the number to be 80, Its hard to read file compares when lines are too long.
No need to introduce nesting on control flow feature which is followed only by one statement
This depends on consensus (IDE0011) but i vote for csharp_prefer_braces = when_multiline or multi-conditional or linq-foreachloop
if(true){
Something();}
just
if(true) Something();
Use simple 'using' statement
again as above (IDE0063) i vote for csharp_prefer_simple_using_statement = true
I will write down issues here relating to code quality which i think could be done better or require an explanation.
Reduce branching/nesting where possible
There are areas where unnecessary branching/nesting is introduced. Ultimately as complexity of the code grows so does the overhead introduced by these control flow features. If we assume a ideal Combat Class which manages from lvl 1 to top tier raids. Its likely in current style of code it would include thousands of control structures in case of need to handle every unique case that may happen during various states of execution. This would result in a lot of time spent traversing branches. A rewrite in well written behavioral trees approach would greatly reduce this overhead and make code much more readable.
Variable/parameters/args naming conventions
Some variables/parameters/args conform neither to PascalCasing nor to camelCasing conventions.
For loops where foreach loop suffices
Some for loops actually don't have any need for use of the index, the item of foreach loop suffices
This is adressed in for loops/nesting reduction #114
Variables can be just var
Depends on consensus i am fine with vars where the underlying type is obvious from context
There are many places where variable type is apparent no need to speficy, like:
Separate code and data constants
It would be great to isolate various magic numbers, scripts, texts from code into data constants
Some namespaces are incorrect
This is resolved in fix namespace issues #111
Project structural problems
Combat classes do not belong to engines, however moving them proper namespace would trigger instantiation of abstract classes and therefore compilation would fail.
Enforce line ending
Matter of consensus indeed however according to theory by Markus Itkonen, Typography and readability
the optimal size of a single line should be 40 to 90 characters wide, historicaly programmers have been biased since ancient times to magically decide the number to be 80, Its hard to read file compares when lines are too long.
No need to introduce nesting on control flow feature which is followed only by one statement
This depends on consensus (IDE0011) but i vote for
csharp_prefer_braces = when_multiline
or multi-conditional or linq-foreachloopjust
again as above (IDE0063) i vote for
csharp_prefer_simple_using_statement = true
The text was updated successfully, but these errors were encountered: