Clean Code & Code Design

Course Abstract

Code is read more often than it is written, that’s why keeping the code clean is very important part of creating maintainable and long living system. Consistency, naming rules, commenting habits, function organization, exception handling – all contribute to code readability and quality. Developers face code design and micro-architecture challenges during every coding day. Every programmer is a designer. Design patterns, code organization principles, dos and don’ts are covered in this intensive 2-day course.

Topics Covered

Understanding the impact of bad code

What does quality mean?

Read your code: names are everywhere

  • How to name variables, functions, classes

Code aesthetics
  • Be consistent
  • Formatting for readability

  • Break code into “paragraph”

  • Code organization
Comments
  • What NOT to comment
  • Show your intent
  • Put yourself in the reader’s shoes

Functions
  • One word: short!
  • Arguments and parameters

  • One level of abstraction

  • Don’t repeat yourself (DRY principle)

  • Dealing with exceptions

*Checked vs. Unchecked *Why exception hierarchies matters *Add content to your exceptions *Centralize catching and logging

  • Execution flow (switch, conditions, nesting, variable scope)

Logging

Code design

  • Understand the problem first

  • Number one rule: simplicity

  • Data vs. Object
  • Law of Demeter
  • Design patterns: use and misuse

  • Classes

*Best practices for class design *Be SOLID! The SOLID principles matters *Cohesion and changeability

  • Design anti-patterns: stuff you’ll regret later

  • Use the right tool for the job: Functional vs. Procedural

Testing your code
  • Unreadable tests stink

  • Choosing good test input

  • Making error message readable

  • TDD actually works
  • Using mocks
  • Introducing BDD
  • Unit test automation and test coverage

Developer team communication & productivity

Prerequisites

Students must have at least a few years of software development experience matching the level of

Target Audience

Junior or senior developers looking to improve their code organization skills.

Learning Objectives

  • Understand main principles behind clean code

  • Leverage knowledge of good design principles

  • Design system components and interactions for testability

Varighed
2 dage
Kursusnummer
LBE1911
Sprog
English
Lokation
Lund&Bendsen
Dato
Se næste
Pris
13.000 kr.

BOOK NU

Vi tilbyder også dette kursus som lukket firmahold. Kontakt os og hør nærmere

Kursusansvarlig

Jakob Bendsen Profil

Jakob Bendsen

Chefkonsulent | Partner

Jakob har arbejdet professionelt med it og softwareudvikling siden 1990’erne. Java og JVM frameworks (Java EE, Spring…) er hans hjemmebane, men også cloud, virtualisering og integrationteknologi (fx REST og GraphQL) er i værktøjskassen. Han er specialist indenfor facilitering af effektive udviklingsprocesser og enterprisearkitektur. 20+ års erfaring med undervisning, mentoring og rådgivning indenfor softwareudvikling i mange brancher, og altid med øjet rettet mod samspillet mellem forretning og IT.

Læs mere