Skip to content

Проектная работа №1 - Николаев - #124

Closed
UltravioletDays wants to merge 7 commits into
Yandex-Practicum:masterfrom
UltravioletDays:master
Closed

UltravioletDays wants to merge 7 commits into
Yandex-Practicum:masterfrom
UltravioletDays:master

Conversation

@UltravioletDays

Copy link
Copy Markdown

No description provided.

Comment thread src/main/java/Ending.java
@@ -0,0 +1,18 @@
public class Ending {

String end(float num) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В Java, да и не только, принято называть методы глаголами.
Почитать можно здесь:
https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Comment thread src/main/java/Main.java
} else {
System.out.println("Требуется указать числовое значение!");
}
}

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), который отвечает за ввод количества гостей/ввод продуктов, в отдельные методы inputGuests, inputProducts.

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.

3 participants