Writing Elegant and Readable Code
Developers who aim to write better code.
Any programming language experience.
If you're a developer, then there probably have been times when you've written code and, after a few days, weeks, or months, you looked back at it and said to yourself What does this piece of code do? The answer to that question might have been I really don't know! In that case, the only thing you can do is going through the code from start to finish, trying to understand what you were thinking when you wrote it In this course, we will give you practical techniques for writing clean code. We won't be talking about specific architectures, languages, or platforms. The focus lies on writing better code.
- CODE SHOULD BE EASY TO UNDERSTAND
- What Makes Code “Better”?
- The Fundamental Theorem of Readability
- Is Smaller Always Better?
- Does Time-Till-Understanding Conflict with Other Goals
- SURFACE-LEVEL IMPROVEMENTS
- Packing Information Into Names
- Names That Can’t Be Misconstrued
- Knowing What To Comment
- Making Comments Precise And Compact
- SIMPLIFYING LOOPS AND LOGIC
- Making Control Flow Easy To Read
- Breaking Down Giant Expressions
- Variables And Readability
- REFACTORING YOUR CODE
- Principles in Refactoring
- Bad Smells in Code
- Building Tests
- Toward a Catalog of Refactorings
- Composing Methods
- Moving Features Between Objects
- Organizing Data
- Simplifying Conditional Expressions
- Making Method Calls Simpler
- Dealing with Generalization
- Extracting Unrelated Subproblems
- One Task at a Time
- Writing Less Code
- Big Refactorings