Skip to content

A practical, example-driven guide to writing clean, readable, and maintainable code. Learn best practices, refactoring techniques, and coding standards through real-world before-and-after examples.

Notifications You must be signed in to change notification settings

Bakel-Bakel/clean-code-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧼 Clean Code Tutorial

β€œAny fool can write code that a computer can understand. Good programmers write code that humans can understand.”
β€” Martin Fowler

Welcome to my Clean Code Tutorial . With inspiration from Maximillian Schwarzmuller's Udemy Course on Clean Codes, this repo shows badly written code alongside its clean code equivalent. This is a practical, example-driven guide to writing better, more maintainable, and readable code. This repository is designed for developers who want to move beyond just "working code" and start writing professional-grade code that is clean, understandable, and easy to maintain.


πŸ“š What You'll Learn

  • Clean coding practices and naming conventions
  • Writing readable functions and modular code
  • Refactoring techniques
  • Writing self-documenting code
  • Real-world before & after code examples

πŸ“ Repository Structure

clean-code-tutorial/
β”œβ”€β”€ py/            # Sample of bad and clean python codes
β”œβ”€β”€ js/            # Sample of bad and clean javascript codes
β”œβ”€β”€ cpp/           # Sample of bad and clean C++ codes
β”œβ”€β”€ c/             # Sample of bad and clean C codes
β”œβ”€β”€ rust/
β”œβ”€β”€ matlab/
└── README.md      # This file (apparently)

πŸš€ Getting Started

  1. Clone the repo:
git clone https://github.com/bakel-bakel/clean-code-tutorial.git
cd clean-code-tutorial
  1. Explore examples:
cd py/

✍️ Conventions Followed

  • PEP 8 for Python formatting
  • Clear, descriptive variable and function names
  • Functions with single responsibilities
  • Minimal comments (code should be self-explanatory)
  • No magic numbers β€” constants used instead
  • DRY (Don't Repeat Yourself)
  • KISS (Keep It Simple, Stupid)

🧠 Who Is This For?

  • Junior developers who want to write professional code
  • Students learning software development best practices
  • Professionals trying to improve code quality and readability
  • Anyone tired of messy legacy codebases

πŸ™Œ Contributing

Please, contributions are welcome! If you want to add new examples, improve existing ones, or share clean code tips:

  1. Fork the repo
  2. Create a new branch
  3. Submit a pull request

πŸ“œ License

This project is licensed under the MIT License.


Happy cleaning! ✨

About

A practical, example-driven guide to writing clean, readable, and maintainable code. Learn best practices, refactoring techniques, and coding standards through real-world before-and-after examples.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •