#"Formatting Exception Messages"
1 messages ยท Page 1 of 1 (latest)
<@&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>.
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.
You should align on the formatting, but a question mark would seem strange to me compared to a dot or exclamation mark.
the question mark was meant to signalize that my sentence is a question
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."
I tend to, but just make sure it's consistent.
I dont but it comes down to personal preference I guess