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

annalyn2: Add parts of introduction #417

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SaschaMann
Copy link
Contributor

No description provided.

@SaschaMann SaschaMann requested a review from cmcaine July 3, 2021 11:25
@SaschaMann SaschaMann requested a review from a team as a code owner July 3, 2021 11:25
@@ -1,3 +1,81 @@
# Introduction

This exercise will introduce you to Julia's key paradigm: Multiple Dispatch.
You will learn how Julia determines which function to call by generating random values.

Copy link
Contributor

Choose a reason for hiding this comment

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

It may be better to explain a little more earlier. I think the manual does this quite well by focusing on the notion of methods rather than on multiple dispatch. This may be a better approach especially for this exercise where we only use single dispatch.

Recall from Functions that a function is an object that maps a tuple of arguments to a return value, or throws an exception if no appropriate value can be returned. It is common for the same conceptual function or operation to be implemented quite differently for different types of arguments: adding two integers is very different from adding two floating-point numbers, both of which are distinct from adding an integer to a floating-point number. Despite their implementation differences, these operations all fall under the general concept of "addition". Accordingly, in Julia, these behaviors all belong to a single object: the + function.

I think that at the top of the intro we should clearly explain the relationship between functions and methods (as is done in the manual).

And I think we may want to say explicitly:

In this exercise you will call different methods of the rand function in order to pick random elements in a few different ways

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.

2 participants