Shortcut, Pseudo-Modular Design Code

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.

Screen Shot 2017-08-04 at 11.38.16 PM.png

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.

2 thoughts on “Shortcut, Pseudo-Modular Design Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s