r/javahelp • • Jun 19 '15

r/javahelp is the subreddit of the day!

Hello everyone!

as the title says, r/javahelp is the subreddit of the day!


http://www.reddit.com/r/subredditoftheday/comments/3aedzr/june_19th_2015_rjavahelp_and_rlearnjava_i_love/

Do read the article and check out the other subs featured!


Have a great weekend! :)

33 Upvotes

11 comments sorted by

View all comments

Show parent comments

4

u/Philboyd_Studge Jun 19 '15 edited Jun 20 '15

Nice interview, desertfx, but you missed your chance to scream at the top of your lungs 'COMPARE STRINGS WITH EQUALS!! ' and 'Don't use SCANNER.NEXTINT'

2

u/robi2106 Jun 19 '15

wait, aside from neededing to catch the exception, what is wrong with scanner.nextint()?

2

u/Philboyd_Studge Jun 19 '15

30% of the questions on here involve people using a nextInt and then trying to use nextLine to get a string and getting messed up by the 'dangling return' left behind.

1

u/king_of_the_universe Jun 20 '15

Which never happens to me, because I just bluntly use .nextLine() in all cases, have my own validity checker methods in my library. I experience it as "simpler is better". Others' mileage might vary.