adamzalesak / PV286-Project

Data converter between different formats written in C# (collaborative university project)
0 stars 0 forks source link

Code quality and other notes #15

Open Pa3u3u opened 1 year ago

Pa3u3u commented 1 year ago

These are just general observations I made when reading your code. You are not required to fix any of these but may give you some suggestions on what to improve.

filiphajek commented 1 year ago

I know that we are not required to fix these issues. But I feel that I should comment on some of your notes and provide a better solution.

I agree that there should not be a limit to the length of arguments or how many parameters the user passes to the application. To be honest I can not really tell why I did it like this, the only reason I remember is that I wanted to stop the user from doing something weird (passing too many arguments that are obviously not necessary). But obviously, this is a weak argument .. our implementation (ArgumentParser) should handle long parameter list just fine without these limitations like MaxArgumentLength. I can add some tests to make sure that we can handle these long inputs.

About Early Return technique... I again agree that there are some functions that would benefit from this technique (3 nested if statements .. not the best solution). We use this technique in some places (e.g. checking cli parameters) so we will try to improve/refactor other parts of our implementation too.