Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review #1

Open
xtmq opened this issue May 7, 2024 · 1 comment
Open

Review #1

xtmq opened this issue May 7, 2024 · 1 comment

Comments

@xtmq
Copy link

xtmq commented May 7, 2024

Hello Ernest,

thank you for participating JetBrains Intership program and for choosing my internship project! My name is Evgeny, I am Team Lead in Rider Platform. Now I am going to provide you a comprehensive code review.

First of all, you written excellent readme.md file with detailed explanation of your vision and various feature. I liked it. Do the same in the future.

About UX. I am not sure I like your desing because it is sometimes difficult to read black code symbols on dark-gray background. Also I constantly feel application is unfocuced because of that background color.

The code is quite simple and easy-to-read. It is fine. Also you made avalonia integration well, left a good amount of comments in business logic and tried to split view and view model. However, the lack of industrial programming experience is very noticeable. Below there are several examples which I suggest you to improve.

  1. Do not put business logic into code behind. For example in OnTreeCaretEvent you mixed up some AST/Text operations and UI updates. Usually this approach leads to the spaghetti code over the years.

private void OnTreeCaretEvent(object sender, SyntaxTreeCaretEventArgs e)

  1. There are code duplicates. Cleanup such things before final commit/merge/review. Code base should be clean and straightforward.


  1. Meaningless or unused code. Try to avoid it.

string rootString = root.ToString();

int endOffset = _textEditor.Document.GetOffset(endLine, 0) + endDocumentLine.Length;

  1. Naming. private StackPanel stackPanel; but one line above private SyntaxTreeCaretEvent _treeCaretEvent;

  2. StringBuilder is your friend when you work with strings.

currString += $"Node: [{node.Kind()}]\n";

The general suggestion is to pay more attention to small details and code tidiness. While this may not seem important for a one-day home project, it becomes critical in real production. It's better to demonstrate the ability to write clean code and have knowledge not only of .NET or Avalonia frameworks, but also of MVC/MVVM and SOLID. This may sound a bit 'old-school', but I have to repeat, it becomes crucial in production.

@molczane
Copy link
Owner

molczane commented May 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants