-
Notifications
You must be signed in to change notification settings - Fork 226
Task14 #818
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
base: master
Are you sure you want to change the base?
Task14 #818
Conversation
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.
Замечание в целом небольшое, но важное. Декомпозиция - важный навык, который стоит развивать с самого начала
| int[] objectCounts = new int[radars.length]; | ||
| for (int i = 0; i < radars.length; i++) { | ||
| int object = 0; | ||
| if (radars[i].length != 3 || radars[i][2] < 1) { |
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.
валидацию стоит отделять от остальной логики. Во-первых, это улучшит читабельность, во-вторых, ты лишишься риска обработать почти весь массив данных и лишь в конце узнать, что они не валидны
| } | ||
|
|
||
| objectCounts[i] = object; | ||
|
|
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.
лишняя пустая строка
| } | ||
|
|
||
| for (int j = 0; j < objectLocations.length; j++) { | ||
| if (!isValidObjects(objectLocations[j])) { |
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.
аналогично замечаниям в предыдущих ПРах. Валидация так полноценно и не выделена из логики обработки. Ожидаю, что валидация будет происходить ДО запуска цикла, производящего полезную работу - в данном случае, подсчет объектов, попадающих в радары
No description provided.