The calculator on the trees, C#. Happy to hear why I'm wrong (about the code quality)?

I wanted to write a calculator: paste.org.ru/?nnq9gg

What is surprising is many passes my tests. But I do something like code. There is no beauty.

What to do?
October 8th 19 at 03:21
3 answers
October 8th 19 at 03:23
meditate
a more specific? - mona_Rau commented on October 8th 19 at 03:26
Rewrite it in F#, FVP and the recursion adds beauty :) But in all seriousness, everyone has their own concept of beauty. I liked the code, clean and easy to understand. - Quinton commented on October 8th 19 at 03:29
And, you can walk through the code and StyleCop to see how it will look in accordance with the recommendations in design from Microsoft. - Quinton commented on October 8th 19 at 03:32
October 8th 19 at 03:25
Purely my preference.

Not clear at first glance which variable has what level (global public, sanjita global, local, parameter, method). There are some naming rules, for example, the global for class
private string _nameOfVariable,
public string NameOfVariable,
just a local small letters as parameters of methods.

The style names are different everywhere - the m_Value and then lexemType.

The method names for my taste it should reflect what action they do. For example, there is a method LexemType() will See this and need to go into code to understand what it does. It would be better, for example GetLexemType() or GetLexemByChar(), but mostly you stick to this scheme.

The names of the classes it is very lightweight. For me the names of the Expression, ExpressionVariable, ExpressionTree and so informative. No need to guess what the author meant and how the reduction idea.

Why assign to a variable the double 0 as 0.0? There is already a specified type.

Unnecessary method calls. Why do Name.ToString() if Name is already a string ?

Directly to open fields is also not good. Can sdelat property well, so
public string Name {get; set;} or write a few methods GetName() and SetName()

Well, that's what caught the eye immediately. The implementation can later unsubscribe if you have time.
October 8th 19 at 03:27
Reduce cyclomatic complexity. It is too high.

Find more questions by tags C