Design Patterns and Best Practices
Contact
Prof. Dr. Claus Möbus
Secretary
Manuela Wüstefeld
Design Patterns and Best Practices
This is a personal reinterpretation of Kwong's book Design Patterns and Best Practices with Julia. Personal reinterpretation means that we stay close to the original, but modify code when we think that it is an improvement, addition, or simplification. All graphs or diagrams are and created by me.
Creating Modules and Private Packages
- Pluto-Notebook using package PCM_SICP_JP
- Package PCM_SICP_JP
Macros and Metaprogramming Techniques
- Macros and Metaprogramming I
- Experimenting with the Parser
- Single-variable Expressions
- Alternative Construction Methods for Expr-Objects
- Construction of sexpr-Objects
- Function Calls
- Function Calls with Keyword Arguments
- Nested Functions
- Macros and Metaprogramming II
- Constructing Expressions Manually
- Constructing ASTs
- Assignment
- Code Blocks
- Conditionals
- Loops
- Function Definitions
- Evaluating Expressions
- Interpolating Variables in Expressions
- Using QuoteNode for Symbols
- Interpolating in Nested Expressions
- Macros and Metaprogramming III
- Writing Our First Macro
- Passing Literal Arguments
- Passing Expression Argument
- Function showme: passing values (= evaluated expressions)
- Macro showme: passing unevaluated expressions
- Understanding the Macro Expansion Process
- Timing of Macro Expansion
- Manipulating Expressions
- Example 1: Making a New Expression
- Example 2: Tweaking the Abstract Syntax Tree
- Understanding Macro Hygiene
- Developing Nonstandard String Laterals
- Using Generated Functions
Implementing Design Patterns
Reusability Patterns
- The Delegation Pattern
- incl. Boilerplate Code
- using the ForwardMethods.@forward_methods Macro
- Example 2 - the ScitkitLearn.jl Package
- The Holy Traits Pattern (THTT) (= Tim Holy's Trait Trick)
- The Parametric Type Pattern
Performance Patterns
- The Gobal Constant Pattern
- The Struct of Arrays Pattern
- The Shared Array Pattern
- The Memoization Pattern
- The Barrier Function Pattern