So, check it out. When you’re writing programs there’s a lot of prompt messages. It’s repetitive. So, what I did today is think ahead, figure out all the prompts I am going to ask the user in the program. Then, with my list at hand, I keep them inside individual String variables. For example, I wrote a small program that asks the user to enter the name of a season, the prompt itself is contained in a String variable called “message.” Then, I contained the translation of each season inside distinct variables, like fall = “El otono.” I did this sort of pseudo-modular organizing of my code and I found it all to be more organized. I feel more comfortable with this workflow because I don’t have to bother with concatenating long messages. Instead, just write out the message and then plug it into System.out.println(plugThatVariableIn);
If you’re curious, here, take a look.
If you’re an advanced programmer, in a comment could you tell me whether or not this is going to lead to good coding habits? Thanks.