Notes from Code Complete for intermediate programmer

Arpan
2 min readMay 24, 2020

In this article,I try to re-index code complete 2nd edition for intermediate programmer who wants to skim through big book. It is a well structured book and comes with great insights.I really recommend reading this book and I want to help lazy people out there without reducing integrity and perspective of the book.

My background

I am programmer mostly working in python and c#.I have mostly worked in projects with team size of 2 to 4.

Most Valuable Parts (in my perspective)

  • Laying the foundation
  • Creating high quality code

Most Valuable Chapters (in my perspective)

  • Measure twice, cut once: Upstream Prerequisites
  • Design in construction
  • Defensive programming
  • The pseudocode Programming process
  • Code Tuning Strategies

Some Notes from construction of software

Plan before programming

Input Data -> Barricade -> internet processors

Assert routines — program to check the end of routine completes the process and gives output

Robustness vs correctness — depends upon software

To handle exceptional cases use offensive programming (test tough conditions during development ex. High memory allocation)

Design pseudocode

  • Basic description
  • Statements in normal language
  • End

Variable

  • Declare close to where it is used
  • Make short spans of variable change
  • One variable one purpose
  • Don’t change input value(parameter value) in routines.

Loops

  • Using break and while true for easier maintenance
  • While is for not knowing when loop ends and for loop is for number of times foreach is for every array value
  • Avoid monkeying
  • Avoid code that depends on the loop index’s final value
  • Use safety counter
  • Try continue rather then big if indent
  • Create loop inside — out

Unusual control structures

  • Use guard clauses (early returns or exits) to simplify complex error processing

Recursion

General control issues

  • Use do while and if break rather then nesting in if

Optimisation

  • Use optimisation afterwords the development
  • Use caching

Hope, it is helpful.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Arpan
Arpan

No responses yet

Write a response