From 5f897a85552cd2441c56f7c041b55bd826ee83ce Mon Sep 17 00:00:00 2001 From: Chris Lo Date: Sun, 15 Oct 2023 09:56:52 -0700 Subject: [PATCH] fix link for lesson3, take 2 --- 03-lesson3.Rmd | 4 +++- _bookdown.yml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/03-lesson3.Rmd b/03-lesson3.Rmd index 2b08660..e25b06a 100644 --- a/03-lesson3.Rmd +++ b/03-lesson3.Rmd @@ -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 diff --git a/_bookdown.yml b/_bookdown.yml index c2fc696..7426d97 100644 --- a/_bookdown.yml +++ b/_bookdown.yml @@ -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