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

Make code examples in /samples/language folder more user-friendly #1470

Closed
tcNickolas opened this issue May 3, 2024 · 2 comments · Fixed by #1561
Closed

Make code examples in /samples/language folder more user-friendly #1470

tcNickolas opened this issue May 3, 2024 · 2 comments · Fixed by #1561
Labels
enhancement New feature or request good first issue Good for newcomers samples

Comments

@tcNickolas
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently the code samples in the /samples/language folder don't produce any output; they evaluate some expressions, but the results are only listed in the comments, not printed for the user to see. This makes any mistakes (such as #1467) hard to spot, and the experience of using them not intuitive.

Describe the solution you'd like
We can add some Message commands to print the results of expression evaluation instead of assigning them to variables in most cases (unless, of course, assigning a value to a variable is the point of the example). This will let user compare the results with what they should be easily.

@tcNickolas tcNickolas added enhancement New feature or request good first issue Good for newcomers samples labels May 3, 2024
@tcNickolas
Copy link
Member Author

Taking Array.qs for example:

  • It mentions syntax elements that are not illustrated in the sample, [0, size = 10] syntax and Length function, we should add them as well.
  • We should print the results of variable assignments: after let intArray : Int[] = [1, 2, 3, 4] we should add Message($"{intArray}");, after each let slice = ... - Message($"{slice}");, and so on.

@goshua13
Copy link
Contributor

Working on this

github-merge-queue bot pushed a commit that referenced this issue May 10, 2024
#1470

---------

Co-authored-by: Joshua Aragon <jaragon32@microsoft.com>
Co-authored-by: Manvi-Agrawal <40084144+Manvi-Agrawal@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this issue May 21, 2024
Part of #1470

---------

Co-authored-by: Joshua Aragon <jaragon32@microsoft.com>
Co-authored-by: Manvi-Agrawal <40084144+Manvi-Agrawal@users.noreply.github.com>
Co-authored-by: Mariia Mykhailova <michaylova@gmail.com>
@tcNickolas tcNickolas linked a pull request May 23, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue May 23, 2024
#1470

---------

Co-authored-by: Joshua Aragon <jaragon32@microsoft.com>
Co-authored-by: Mariia Mykhailova <michaylova@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers samples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants