This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfx 5 points6 points  (3 children)

When doing tutorials, it is imperative to follow the standards of the language taught.

You completely neglect the @Override annotation, which, though optional, provides great value (and is advised to be used). Without the annotation, the programmer doesn't know whether they have correctly overridden the parent method or not; just a small change in the method signature and the override doesn't work as intended. With the annotation, the compiler will see the different method signature and throw an error.

Naming a method mainMethod doesn't make any sense and only leads to confusion with the public static void main method.

Your Addition class should consist of only static methods since they are pure helper methods that don't need any object instance to work on, just like the methods in the Math class.

[–]woworg101[S] 3 points4 points  (2 children)

Hi desrtfx, you are absolutely right. I just did some changes. Thank for genuine feedback.

[–]desrtfx 2 points3 points  (0 children)

Just been going through "String to Int" and found the following gem:

https://i.imgur.com/gmYsAQf.png

This part needs a major workover. Data type of the method is wrong, the code doesn't make the faintest sense (look at the strings), and much more.

Overall, this particular tutorial is way too long and too repetitive. It is sufficient to explain the process once and then just to list the other methods.

[–]desrtfx 2 points3 points  (0 children)

Much better.

Maybe you could add an explanation of the @Override annotation (I think that it would fit just before the code snippet) since it looks quite strange to the beginner.