Commit 63741b88 authored by goekce's avatar goekce
Browse files

remove-slide

parent 6a9aa651
Pipeline #13898 passed with stage
in 6 minutes and 50 seconds
......@@ -274,8 +274,9 @@ rna = ''.join(map(lambda n: 'U' if n == 'T' else n, dna))
rna ## outputs 'GAUGA'
```
##
<!-- advantages of functional programming -->
<!--TODO look at WP: functional programming again. The functional programming is a declarative programming style. There is a difference between pure functional programming etc.
##
what are advantages of functional programming?
......@@ -283,11 +284,14 @@ what are advantages of functional programming?
When we define functions which only depend on the given parameters and return values (in contrast to modifying other global variables) and stick to functions (instead of writing imperative statements):
- we have shorter, cleaner code
- we can reuse the defined functions somewhere else and save time
- testing easier: after we have tested a function, then we do not have to retest it unless we modify it
- by passing the output of an output of a function as a parameter to another function, we can avoid intermediate variables (more variables could lead to bugs)
1. we have shorter, cleaner code
1. we can reuse the defined functions somewhere else and save time
1. testing easier: after we have tested a function, then we do not have to retest it unless we modify it
1. by passing the output of a function as a parameter to another function, we can avoid intermediate variables (more variables could lead to bugs)
The first three points also apply to procedural programming. But 4 is ??
-->
##
<!-- what is a good example for lambda -->
......@@ -440,9 +444,9 @@ next(cycler) # ...
Advantage:
We can iterate over them forever, but they won't consume much memory, e.g., previous iterator `cycler` needs to store `'eşek', 'donkey'`{.py}, but not unlimited amount of items.
We can iterate over them forever, but they won't consume much memory, e.g., previous iterator `cycler`{.py} needs to store `'eşek'`{.py} and `'donkey'`{.py}, but not unlimited amount of items.
We could also create the same functionality using functions, still the iterators are more compact.
We could also create the same functionality using functions, the iterators are more compact though.
---
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment