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

booking-up-for-beauty: add link and improve task with AnniversaryDate() #2243

Closed
Jasstkn opened this issue Jun 10, 2022 · 7 comments
Closed

Comments

@Jasstkn
Copy link
Contributor

Jasstkn commented Jun 10, 2022

Hi.

I have two questions/proposals:

  1. Do you think it will be useful to add link to https://gobyexample.com/time-formatting-parsing as well? It was helpful for me to solve this task.
  2. I think we can make it a bit harder for passing AnniversaryDate. For example, it can take a year as a parameter:
  • if this argument is empty, it should print the current year anniversary,
  • if it's not - print required year anniversary.

In my opinion it can be useful to do more calculations in terms of working with time resources.

Let me know what do you think :)

@andrerfcsantos
Copy link
Member

andrerfcsantos commented Jun 10, 2022

Do you think it will be useful to add link to https://gobyexample.com/time-formatting-parsing as well? It was helpful for me to solve this task.

Parsing time strings in Go can be confusing as it works differently from other languages, so more help is always welcome! And Go By Example is always a great source to include.

if this argument is empty, it should print the current year anniversary

Assuming the year parameter would be an int, what exactly do you mean by "empty"?

The task currently makes the student get the current year which is something new to the task and makes the student create a date from scratch using all parameters., which is also new in the task. If we were to add on this, I think we should make the student make something else with the date functions.

Alternatively, we can make a new task, especially if there's something the exercise currently doesn't talk about that you think it should.

@Jasstkn
Copy link
Contributor Author

Jasstkn commented Jun 10, 2022

Do you think it will be useful to add link to https://gobyexample.com/time-formatting-parsing as well? It was helpful for me to solve this task.

Parsing time strings in Go can be confusing as it works differently from other languages, so more help is always welcome! And Go By Example is always a great source to include.

if this argument is empty, it should print the current year anniversary

Assuming the year parameter would be an int, what exactly do you mean by "empty"?

The task currently makes the student get the current year which is something new to the task and makes the student create a date from scratch using all parameters., which is also new in the task. If we were to add on this, I think we should make the student make something else with the date functions.

Alternatively, we can make a new task, especially if there's something the exercise currently doesn't talk about that you think it should.

Thanks for reply. I'll create a PR with new link then.

Regarding improvement, I was thinking about something like that:

func AnniversaryDateV2(year ...int) time.Time {
	if len(year) == 0 {
		return ...
	}
	return ...
}

But it seems to be not ideal at all so maybe you're right and it's better to have a separate task in scope of working with time..
We can get inspired by example here: https://www.sohamkamani.com/golang/time/#duration---adding-and-subtracting-time, for e.g. we have scheduled appointment at the salon and we want to notify our client how much time has left before the appointment time.

@junedev
Copy link
Member

junedev commented Jun 10, 2022

@andrerfcsantos Can this issue be closed or is there something else open to be addressed?

@andrerfcsantos
Copy link
Member

@junedev While the first point for the link was addressed by #2246, there's still the question if we should add something to the exercise.

@Jasstkn
Copy link
Contributor Author

Jasstkn commented Jun 11, 2022

@junedev While the first point for the link was addressed by #2246, there's still the question if we should add something to the exercise.

Let me know if you have any thoughts about what I wrote here: #2243 (comment)

@junedev
Copy link
Member

junedev commented Jun 29, 2022

@Jasstkn I finally had some time to look into this more closely. I agree with André that we shouldn't add more to the anniversary date task than there already is.

Regarding adding another task "to do more calculations" as you said, I have a hard time to come up with a good candidate. The problem is that all the things like t.Sub, t.Add, time.Since require an understanding of time.Duration. And duration as a concept would be too much for this concept/exercise so it should be taught in a separate one. There is already an open issue about this here: #1391

So I would suggest to close this issue and leave the part about "more calculations" to the separate new exercise that covers duration.

@Jasstkn
Copy link
Contributor Author

Jasstkn commented Jun 29, 2022

@junedev Okay, I don't have any objections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants