Skip to content

Commit

Permalink
fix link for lesson3, take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
caalo committed Oct 15, 2023
1 parent b3af4b0 commit 5f897a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 03-lesson3.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Today, we will understand deeply how functions work, and continue learning more
We write functions for two main, often overlapping, reasons:

1. Following DRY (Don't Repeat Yourself) principle: If you find yourself repeating similar patterns of code, you should write a function that executes that pattern. This saves time and the risk of mistakes.

2. Create modular structure and abstraction: Having all of your code in one place becomes increasingly complicated as your program grows. Think of the function as a mini-program that can perform without the rest of the program. Organizing your code by functions gives modular structure, as well as abstraction: you only need to know the function name, inputs, and output to use it and don't have to worry how it works.

Some useful mantra on writing functions:
Some advice on writing functions:

- Code that has a well-defined set of inputs and outputs make a good function.

- A function should do only one, well-defined task.

### Anatomy of a function definition
Expand Down
1 change: 1 addition & 0 deletions _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repo: https://github.com/jhudsl/OTTR_Template/
rmd_files: ["index.Rmd",
"01-lesson1.Rmd",
"02-lesson2.Rmd",
"03-lesson3.Rmd",
"About.Rmd",
"References.Rmd"]
new_session: yes
Expand Down

0 comments on commit 5f897a8

Please sign in to comment.