-
Notifications
You must be signed in to change notification settings - Fork 201
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
Яценко Ирина #174
base: master
Are you sure you want to change the base?
Яценко Ирина #174
Conversation
{ | ||
public class Result<T> | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чаще всего используют вот эту реализацию https://github.com/kontur-courses/fp/blob/master/ErrorHandling/Result.cs при выполнении этого задания. У тебя немного она отличается. Она заставляет тебя больше писать try catch. В целом я больше за твой вариант, т.к похожий я использую у себя в команде
public Result(T value, string error) | ||
{ | ||
Value = value; | ||
Error = error; | ||
} | ||
|
||
public static Result<T> Success(T value) => new Result<T>(value, null); | ||
public static Result<T> Failure(string error) => new Result<T>(default, error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавить конструктор по умолчанию добавили, но использовать не стала, а надобы
Я бы основной конструктор сделал бы private, т.к есть статичные методы которые выступают гарантией, что его вызывать нужно только вот так
namespace TagsCloudVisualization | ||
{ | ||
public class CircularCloudLayouter : ICircularCloudLayouter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не вижу использование в этом проекте патерна, да и ошибки вот прямо в классе выкидываются
if (cloud.Rectangles.Count == 0) | ||
return AddToCenterPosition(rectangleSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Немного странный метод, т.к. первая точка которую ты возвращаешь это всегда центр
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
два переноса
|
||
public Result<Bitmap> DrawWordsCloud(string filePath, VisualizingSettings visualizingSettings) | ||
{ | ||
if (filePath == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не уверен что все что в происходит в методе безопасно и не выкинет ошибку
@Pasha0666