r/learnjava • • Feb 15 '20

(Round 2)Java beginner projects

[removed] — view removed post

5 Upvotes

4 comments sorted by

View all comments

2

u/override_acid Feb 15 '20

Please, stop. Not only are the projects way too short and generic, but also is your code quite bad.

  • You don't sanitize input, yet rely a lot on String comparison (which is already bad enough - String comparison is costly in processing power). String comparison is always case sensitive (unless you use .equalsIgnoreCase, which doesn't work for switch...case statments).

  • Your program flow is often wrong. In your area/perimeter program, you always ask for the second measure, despite Square and circle not needing it. This is plain wrong. First decide if the second measure is needed, then ask for it only if it is needed.

  • Your code is convoluted. The nested switch in your temp converter is unnecessary. Get temp in initial unit, convert it to a base unit (where Kelvin would be sensible), then convert it to the target unit.

What you are doing is abusing reddit as a blogging and code review platform. Reddit is neither. You are hardly participating on the subreddit otherwise. You are basically spamming the sub.

1

u/[deleted] Feb 15 '20

Your comment made my day! I love you!💕