-
-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nullability concept #2584
Add nullability concept #2584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you for contributing!
I left a couple of comments to address, could you work through those and request another review when you're ready?
@@ -0,0 +1,7 @@ | |||
{ | |||
"blurb": "Learn about the null literal and nullable variables in java by printing name badges.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blurb should be about the concept, not about the exercise. Could you try to think of a small blurb that just describes the null
concept?
|
||
```java | ||
Badge badge = new Badge(); | ||
Badge.print(id: null, "Jane Johnson", "Procurement"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java does not support named parameters, perhaps this was copied directly from the C# track?
Badge.print(id: null, "Jane Johnson", "Procurement"); | |
Badge.print(null, "Jane Johnson", "Procurement"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the snippets in the third task, btw.
} | ||
|
||
@Test | ||
@Tag("task:4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no task 4, I believe this test belongs to task 3 as well.
|
||
@Test | ||
@Tag("task:1") | ||
@DisplayName("The print method of the TimFromMarketing class returns the correct label for the employee") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is a bit verbose and actually confusing as the class is not called TimForMarketing
. I suggest simplifying the display names in this file. For example:
- Printing a badge for an employee
- Printing a badge for a new employee
- Printing a badge for the owner
- Printing a badge for the owner who is a new employee
@@ -0,0 +1,5 @@ | |||
public class Badge { | |||
public static String print(Integer id, String name, String department) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Java track we try to minimize the use of static methods. Especially in concept exercises I believe there is no other exercise that uses static methods, so that would technically introduce that concept here.
I would prefer if we could use an instance method instead, even if it doesn't actually interact with the Badge
class instance.
"src/main/java/Badge.java" | ||
], | ||
"test": [ | ||
"src/test/java/BadgeTests.java" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking here, but following the convention used by the other exercises this should be BadgeTest.java
. So singular, not plural.
Could you rename the file and change it in the config.json
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for your efforts 👍
pull request
This PR addresses issue #2553, let me know if any details need updated.
Reviewer Resources:
Track Policies