Skip to content
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

Merged
merged 6 commits into from
Nov 25, 2023
Merged

Conversation

smcg468
Copy link
Contributor

@smcg468 smcg468 commented Nov 25, 2023

pull request

This PR addresses issue #2553, let me know if any details need updated.


Reviewer Resources:

Track Policies

Copy link
Contributor

@sanderploegsma sanderploegsma left a 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.",
Copy link
Contributor

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?

concepts/nullability/about.md Show resolved Hide resolved
concepts/nullability/about.md Show resolved Hide resolved

```java
Badge badge = new Badge();
Badge.print(id: null, "Jane Johnson", "Procurement");
Copy link
Contributor

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?

Suggested change
Badge.print(id: null, "Jane Johnson", "Procurement");
Badge.print(null, "Jane Johnson", "Procurement");

Copy link
Contributor

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")
Copy link
Contributor

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")
Copy link
Contributor

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:

  1. Printing a badge for an employee
  2. Printing a badge for a new employee
  3. Printing a badge for the owner
  4. 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) {
Copy link
Contributor

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"
Copy link
Contributor

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?

@sanderploegsma sanderploegsma added the x:size/large Large amount of work label Nov 25, 2023
Copy link
Contributor

@sanderploegsma sanderploegsma left a 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 👍

@sanderploegsma sanderploegsma merged commit e937a27 into exercism:main Nov 25, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants