Skip to content

Pull Request итоговый - #2

Open
Iskanderius wants to merge 3 commits into
devfrom
devBranche_v3_itog
Open

Iskanderius wants to merge 3 commits into
devfrom
devBranche_v3_itog

Conversation

@Iskanderius

Copy link
Copy Markdown
Owner

Итоговый Pull Request

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всю папку .idea лучше сразу добавлять в gitignore - в ней хранятся локальные настройки разработчика, специфичные для проекта. После добавления важно не забыть удалить папку с репозитория

Comment thread src/main/kotlin/Main.kt
Comment on lines +12 to +51








































Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Повторяющиеся пустые строки в коде лучше удалять, чтобы код лучше смотрелся и читался проще. Логически делимые блоки можно разделять одной пустой строкой

fun <T> toInput(obj: T, MaxChoose: Int): Int
}

interface select{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интерфейсы и классы в Котлин принято называть с большой буквы

Comment thread src/main/kotlin/Class.kt
@@ -0,0 +1,165 @@
import java.util.Scanner
open class Note() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не стоит все классы делать open - для описания моделей данных (архивов и заметок) лучше воспользоваться data class

Comment thread src/main/kotlin/Class.kt
}

override fun <T> toInput(obj: T, MaxChoose: Int): Int {
while (true) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не рекомендую писать бесконечные циклы через while (true) - лучше всегда явно прописывать условие выхода из цикла, чтобы уменьшить вероятность ошибиться и повысить читабельность кода

Comment thread src/main/kotlin/Class.kt
if (obj is DataBaze) {
println("Введите название архива:")
val nameInput = scanner.nextLine()
if (nameInput.isNotBlank()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код для считывания непустой строки с ввода лучше вынести в отдельную функцию - код, разделённый на небольшие функции, легче читать, поддерживать и переиспользовать

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

Successfully merging this pull request may close these issues.

2 participants