r/learnjava • • Feb 15 '20

(Round 2)Java beginner projects

[removed] — view removed post

5 Upvotes

4 comments sorted by

2

u/[deleted] Feb 15 '20 edited Feb 15 '20

Why did you use a nested switch?!? It’s so unnecessary. Your codes are the worst solutions to these simple and very rudimentary exercise by the way. It’s not even a “project”. What I find appalling is it seems like you didn’t really think long and hard enough about your solutions.

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!💕

•

u/desrtfx Feb 15 '20

Sorry, but what you are doing is unacceptable.

You are basically mistaking reddit for a blogging platform.

You also present solutions in your github that are very low quality code. It is understood that you are still a learner in their early stages, but this also means that you are not qualified to present your code under the label "solutions". In fact, your code is very low quality as has been already pointed out to you in your first "beginner projects" post and here.

Your "beginner projects" aren't even projects. They are minor exercises hardly worth mentioning.

Do the MOOC Object Oriented Programming with Java (for now, scroll down to "old courses" and do the 2013 edition). You will learn far more than by putting your "projects" up here.

Consider this your one and only warning. Next similar post, or rule violation in any matter will earn you a permanent and irrevocable ban from here.

Removed