Skip to content

Added switch case solutions#8

Merged
BinaryWrought merged 1 commit intomasterfrom
SwitchCase
Sep 15, 2017
Merged

Added switch case solutions#8
BinaryWrought merged 1 commit intomasterfrom
SwitchCase

Conversation

@BinaryWrought
Copy link
Copy Markdown
Owner

I wanted to do two solutions for this practice to see how verbosity changes readability.
SwitchCase.java is the most verbose. I declared a method for each area calculation. I have separate inputs for each area parameter.
In SwitchCaseTight.java I removed the extra methods and just simply pasted the one line mathematical calculation into the println statement. I also only removed a line by making the first input happen regardless of chosen area calculation.

Looking at the two solution I feel that the more verbose one is easier to maintain in the long run. But I like how small the tight solution is. I think I will keep with the verbose solutions just because it is a better practice to make methods.

I wanted to do two solutions for this practice to see how verbosity changes readability.
SwitchCase.java is the most verbose. I declared a method for each area calculation. I have separate inputs for each area parameter.
In SwitchCaseTight.java I removed the extra methods and just simply pasted the one line mathematical calculation into the println statement. I also only removed a line by making the first input happen regardless of chosen area calculation.

Looking at the two solution I feel that the more verbose one is easier to maintain in the long run. But I like how small the tight solution is. I think I will keep with the verbose solutions just because it is a better practice to make methods.
@BinaryWrought BinaryWrought merged commit f68666f into master Sep 15, 2017
@BinaryWrought BinaryWrought deleted the SwitchCase branch September 15, 2017 18:49
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.

1 participant