D-CLN-C
Writing Elegant and Readable Code

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.


Description

Topics Covered

  1. 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
  2. SURFACE-LEVEL IMPROVEMENTS
    • Packing Information Into Names
    • Names That Can’t Be Misconstrued
    • Aesthetics
    • Knowing What To Comment
    • Making Comments Precise And Compact
  3. SIMPLIFYING LOOPS AND LOGIC
    • Making Control Flow Easy To Read
    • Breaking Down Giant Expressions
    • Variables And Readability
  4. 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

Audience

Developers who aim to write better code.

Duration

1 day

Format

Instructor Lead

Prerequisites

Any programming language experience.