#"Formatting Exception Messages"

1 messages ยท Page 1 of 1 (latest)

celest thornBOT
#

@remote lily has a question:

aa55h

do yall end exception messages with .?

#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Do yall end exception messages with .?

It is a common practice in Java to end exception messages with a period (.) for consistency and readability. This helps differentiate the end of the message from the rest of the code and makes it easier for developers to quickly identify and understand the error. Additionally, following this convention aligns with standard programming practices and contributes to maintaining clean and organized code.

While it is not mandatory to end exception messages with a period, doing so can enhance the overall quality of your code and improve its maintainability. Consistent formatting of exception messages also promotes better communication within a development team and ensures that error handling is clear and effective.

In summary, ending exception messages with a period is recommended in Java programming as it helps improve readability, maintainability, and communication within your codebase. However, whether or not you choose to follow this convention ultimately depends on your personal preference and coding style.

rotund yew
#

You should align on the formatting, but a question mark would seem strange to me compared to a dot or exclamation mark.

remote lily
#

for example, should i use . here?

if (address.isEmpty()) throw new IllegalStateException("No symbol with name " + name + " was found");
#

making it "No symbol with name " + name + " was found."

rotund yew
#

I tend to, but just make sure it's consistent.

gaunt jetty
#

I dont but it comes down to personal preference I guess