4.64 out of 5
4.64
10075 reviews on Udemy

Clean Code

Learn how to write readable, understandable and therefore maintainable code - step by step, in an example-driven way
Instructor:
Academind by Maximilian Schwarzmüller
61,390 students enrolled
English [CC] More
Learn how to write code which is readable and understandable
Keep code alive by increasing maintainability with clean code
Learn about key principles, rules and concepts that allow you to write clean code
Learn with hands-on examples and "bad to good code" transformations

As a developer, you should be able to write code which works – of course!

Unfortunately, a lot of developers write bad code nonetheless – even though the code works. Because “working code” is not the same as “clean code”!

This course teaches you how to write clean code – code which is easy to read and understand by humans, not just computers!

In this course, you’ll learn what exactly clean code is and, more importantly, how you can write clean code. Because if your code is written in a clean way, it’s easier to read and understand and therefore easier to maintain.

Because it’s NOT just the computer who needs to understand your code – your colleagues and your future self needs to be able to understand it as well!

In this course, we’ll dive into all the main “pain points” related to clean code (or bad code – depending on how you look at it) and you will not just learn what makes up bad code but of course also how to turn it into clean code.

Specifically, you will learn about:

  • Naming “things” (variables, properties, classes, functions, …) properly and in a clean way

  • Common pitfalls and mistakes you should avoid when naming things

  • Comments and that most of them are bad

  • Good comments you might consider adding to your code

  • Code formatting – both horizontal and vertical formatting

  • Functions and how to limit the number of function parameters

  • How to write clean functions by focusing on “one thing”

  • How levels of abstraction help you split functions and keep them small

  • How to write DRY functions and avoid unexpected side effects

  • Avoiding deeply nested control structures with guards and by extracting functionality into functions

  • Errors and error handling as a replacement for if-statements

  • Objects & data containers/ data structures and why that differentiation could matter

  • Cohesion and how to write good (small!) classes

  • The Law of Demeter and why it matters for clean code

  • What the SOLID principles are and why they matter when it comes to writing clean code

  • Much more!

This course is a compilation of common patterns, best practices, principles and rules related to writing clean code.

In this course, you’ll learn about a broad variety of concepts, rules, ideas, thoughts and principles and by the end of course, you’ll have a good idea of what to keep in mind when it comes to writing clean code.

This is not a design patterns or general patterns course though – we will entirely focus on patterns, rules and concepts that help with writing clean code specifically.

All these concepts and rules are backed up by examples, code snippets and demos. And to ensure that you get the most out of this course, and you don’t just learn a bunch of theory which you forget soon after, there also are plenty of challenges for you to apply what you learned!

This course uses Python, JavaScript and TypeScript for code examples but you don’t need to know these languages to follow along and get a lot out of the course. In addition, the course does not focus on a specific programming style or paradigm (like functional programming, object-oriented programming etc) but instead covers general concepts and techniques which will always apply.

What are the course prerequisites?

  • Basic programming knowledge (no matter which language) is required!

  • You don’t need to know any specific programming language or programming paradigm to follow along

  • NO prior experience with writing clean code is required

Getting Started

1
Welcome to the Course!
2
What is "Clean Code"?
3
Clean Code - Key Pain Points & How To Write Clean Code
4
How Is This Course Structured?
5
Course Prerequisites
6
Clean Code & Strongly Typed Languages
7
About The Course Code Examples
8
Join Our Learning Community!
9
Functional, OOP, Procedural: The Course Concepts Always Apply!
10
Clean Code, Principles & Patterns & Clean Architecture
11
Clean Code vs Quick Code
12
Module & Course Resources

Naming - Assigning Names to Variables, Functions, Classes & More

1
Module Introduction
2
Why Good Names Matter
3
Choosing Good Names
4
Casing Conventions & Programming Languages
5
Naming Variables & Properties - Theory
6
Naming Variables & Properties - Examples
7
Naming Functions & Methods - Theory
8
Naming Functions & Methods - Examples
9
Naming Classes - Theory
10
Naming Classes - Examples
11
Exceptions You Should Be Aware Of
12
Common Errors & Pitfalls
13
Demo Time!
14
Your Challenge - Problem
15
Your Challenge - Solution
16
Module Resources

Code Structure, Comments & Formatting

1
Module Introduction
2
Bad Comments
3
Good Comments
4
What is "Code Formatting" Really About?
5
Vertical Formatting
6
Formatting: Language-specific Considerations
7
Horizontal Formatting
8
Your Challenge - Problem
9
Your Challenge - Solution
10
Module Resources

Functions & Methods

1
Module Introduction
2
Analyzing Key Function Parts
3
Keep The Number Of Parameters Low!
4
Refactoring Function Parameters - Ideas & Concepts
5
When One Parameter Is Just Right
6
Two Parameters & When To Refactor
7
Dealing With Too Many Values
8
Functions With A Dynamic Number Of Parameters
9
Beware Of "Output Parameters"
10
Functions Should Be Small & Do One Thing!
11
Why "Levels of Abstraction" Matter
12
When Should You Split?
13
Demo & Challenge
14
Stay DRY - Don't Repeat Yourself
15
Splitting Functions To Stay DRY
16
Don't Overdo It - Avoid Useless Extractions
17
Understanding & Avoiding (Unexpected) Side Effects
18
Side Effects - A Challenge
19
Why Unit Tests Matter & Help A Lot!
20
Module Resources

Control Structures & Errors

1
Module Introduction
2
Useful Concepts - An Overview
3
Introducing "Guards"
4
Guards In Action
5
Extracting Control Structures & Preferring Positive Phrasing
6
Extracting Control Structures Into Functions
7
Writing Clean Functions With Control Structures
8
Inverting Conditional Logic
9
Embrace Errors & Error Handling
10
Creating More Error Guards
11
Extracting Validation Code
12
Error Handling Is One Thing!
13
Using Factory Functions & Polymorphism
14
Working with Default Parameters
15
Avoid "Magic Numbers & Strings"
16
Module Summary
17
Module Resources

Objects, Classes & Data Containers / Structures

1
Module Introduction
2
Important: This is NOT an OOP or "Patterns & Principles" Course!
3
Objects vs Data Containers / Data Structures
4
Why The Differentiation Matters
5
Classes & Polymorphism
6
Classes Should Be Small!
7
Understanding "Cohesion"
8
The "Law Of Demeter" And Why You Should "Tell, Not Ask"
9
The SOLID Principles
10
The Single-Responsibility-Principle (SRP) & Why It Matters
11
The Open-Closed Principle (OCP) & Why It Matters
12
The Liskov Substitution Principle
13
The Interface Segregation Principle
14
The Dependency Inversion Principle
15
Module Resources

Summary & Checklist

1
Concepts Summary & Checklist

Course Roundup

1
Staying Clean!
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.6
4.6 out of 5
10075 Ratings

Detailed Rating

Stars 5
6197
Stars 4
3193
Stars 3
597
Stars 2
59
Stars 1
29
27cad173a1c6d95af3e39f5c6c36131e
Get course
30-Day Money-Back Guarantee

Includes

7 hours on-demand video
9 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion