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

Update introduction.md for tuples #2086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

wkuch
Copy link

@wkuch wkuch commented Mar 4, 2023

This is a very early concept in the c# track and a conditional operator might be confusing for a beginner as it wasn't explained before.

This is a very early concept in the c# track and a conditional operator might be confusing for a beginner as it wasn't explained before.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2023

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Mar 4, 2023
Comment on lines +28 to +34
(int, int) SumAndProduct(int x, int y)
{
return (num1 == num2, num1 > num2 ? num1 : num2);
int sum = x + y;
int product = x * y;

// return a tuple with both values
return (sum, product);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer the tuple to return two different types.

BTW This content will like also be in the concept's about.md file

@ErikSchierboom ErikSchierboom reopened this Mar 7, 2023
@michalporeba
Copy link
Contributor

michalporeba commented Apr 3, 2023

How about getting away from maths? Would something like this work?

(int, string) GetTodaysInfo()
{
    var today = DateTime.Now;
    return (today.DayOfYear, today.DayOfWeek.ToString());
}

It focuses on the return value with two different types, without obscuring the example by parameters.
What do you think @ErikSchierboom ?

@ErikSchierboom
Copy link
Member

Yep, that would be fine!

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

Successfully merging this pull request may close these issues.

3 participants