-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
honest-hrundel
commented
Oct 25, 2016
🍅 Не пройден линтинг или базовые тесты
honest-hrundel
commented
Oct 25, 2016
🍏 Пройдено тестов 16 из 16
honest-hrundel
commented
Oct 26, 2016
🍏 Пройдено тестов 19 из 19
honest-hrundel
commented
Oct 26, 2016
@NiKiT0S обрати внимание решено доп. задание
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.
А если банда из 100 человек, 100 переменных создавать?
Смотри в сторону таких методов как map, reduce и т.п.
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.
array - слишком абстрактно. Массив чего?
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.
Что за число 1440 ? Стоит вынести в константы
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.
Функция называется merge, но внутри еще и сортирует, надо разбить эти действия на 2
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.
Для названия счетчика принято использовать i, 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.
А если будет +10 ? тогда вернет 0, неверно
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.
Слишком замысловатое имя функции, getTimestamp подойдет лучше
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.
Для вычленения частей даты проще написать одно регулярное выражение, чем каждый раз искать substring.
Попробуй реализовать через него
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.
DD - как будто константа, можно же назвать просто days, MM - minutes, HH - hours
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.
days = ['ПН', 'ВТ', 'CР']; day = days[DD];
ninjagrizzly
commented
Oct 27, 2016
Много замечаний к именованию переменных и функций, пытайся вложить больше смысла в названия.
Используй методы forEach, map, reduce они так и напрашиваются быть использованными в этой задаче
Хорошо бы снабдить функции хотя бы краткими комментариями (что на входе, что происходит внутри)
ninjagrizzly
commented
Oct 27, 2016
🍅
honest-hrundel
commented
Oct 30, 2016
🍅 Пройдено тестов 15 из 19
honest-hrundel
commented
Oct 30, 2016
🍅 Пройдено тестов 15 из 19
honest-hrundel
commented
Oct 30, 2016
🍏 Пройдено тестов 19 из 19
honest-hrundel
commented
Oct 30, 2016
@NiKiT0S обрати внимание решено доп. задание
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.
Это константы, их нужно вынести из функции и именовать согласно принятым стандартам CONST_HUNDRED = 100
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.
Хотелось бы увидеть комментарии к каждой функции, что на входе и что она делает со своими входными данными (т.е. этот комментарий относится ко всем функциям, а не конкретно к этой)
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.
Зачем answerArray пихать в arr
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.
Используй Object.keys(schedule) там встроенный hasOwnProperty
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.
А если банк начинает работу с 0 часов? тогда в busyIntervals появится [0, 0]. В этом случае программа отработает правильно?
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.
просто mergedArray
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.
Необязаттельно давать этой функции имя compareArrays, эту функцию ты по имени не вызываешь, она вполне может быть анонимной
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.
Длина строки времени работы банка может быть равна 8, в случае если сдвиг больше +9
Для вычленения минут/часов/дней я бы использовал regexp
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.
Кстати я обращал внимание на это еще в первом review
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.
var DAYS = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'CБ', 'ВС']; var day = DAYS[stringTime.substring(0, 2)];
Итого 2 строки вместо 6
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.
В константы можно вынести
ninjagrizzly
commented
Nov 1, 2016
🍅
No description provided.