Skip to main content
  • Book
  • © 2018

Good Habits for Great Coding

Improving Programming Skills with Examples in Python

Apress

Authors:

  • Distills a lifetime of lessons learned to provide advice, unique insights, and best practices to improve your coding skills
  • Teaches how to write code that is readable, with attention to good coding style
  • Contains many code samples in Python which are accessible to beginning programmers in any language

Buy it now

Buying options

eBook USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (21 chapters)

  1. Front Matter

    Pages i-xxix
  2. Not Learned in School

    1. Front Matter

      Pages 1-1
    2. A Coding Fantasy

      • Michael Stueben
      Pages 3-13
    3. Coding Tricks

      • Michael Stueben
      Pages 15-25
    4. Style

      • Michael Stueben
      Pages 27-33
    5. More Coding Tricks

      • Michael Stueben
      Pages 35-51
  3. Coding Advice

    1. Front Matter

      Pages 53-53
    2. Function Design

      • Michael Stueben
      Pages 55-66
    3. Self-Documenting Code

      • Michael Stueben
      Pages 67-90
    4. Step-Wise Refinement

      • Michael Stueben
      Pages 91-94
    5. Comments

      • Michael Stueben
      Pages 95-103
    6. Stop Coding

      • Michael Stueben
      Pages 105-110
    7. Testing

      • Michael Stueben
      Pages 111-122
    8. Defensive Programming

      • Michael Stueben
      Pages 123-126
    9. Refactoring

      • Michael Stueben
      Pages 127-143
    10. Write the Tests First (Sometimes)

      • Michael Stueben
      Pages 145-151
    11. Expert Advice

      • Michael Stueben
      Pages 153-177
  4. Perspective

    1. Front Matter

      Pages 179-179
    2. A Lesson in Design

      • Michael Stueben
      Pages 181-195
    3. Beware of OOP

      • Michael Stueben
      Pages 197-201

About this book

Improve your coding skills and learn how to write readable code. Rather than teach basic programming, this book presumes that readers understand the fundamentals, and offers time-honed best practices for style, design, documenting, testing, refactoring, and more. 

Taking an informal, conversational tone, author Michael Stueben offers programming stories, anecdotes, observations, advice, tricks, examples, and challenges based on his 38 years experience writing code and teaching programming classes. Trying to teach style to beginners is notoriously difficult and can easily appear pedantic. Instead, this book offers solutions and many examples to back up his ideas.

Good Habits for Great Coding distills Stueben's three decades of analyzing his own mistakes, analyzing student mistakes, searching for problems that teach lessons, and searching for simple examples to illustrate complex ideas.  Having found that most learn by trying out challenging problems, and reflecting on them, each chapter includes quizzes and problems. The final chapter introduces dynamic programming to reduce complex problems to subcases, and illustrates many concepts discussed in the book. 

Code samples are provided in Python and designed to be understandable by readers familiar with any modern programming language. At the end of this book, you will have acquired a lifetime of good coding advice, the lessons the author wishes he had learned when he was a novice.

What You'll Learn

  • Create readable code through examples of good and bad style
  • Write difficult algorithms by comparing your code to the author's code
  • Derive and code difficult algorithms using dynamic programming
  • Understand the psychology of the coding process

Who This Book Is For

Students or novice programmers who have taken a beginning programming course and understand coding basics.Teachers will appreciate the author's road-tested ideas that they may apply to their own teaching.

Authors and Affiliations

  • Falls Church, USA

    Michael Stueben

About the author

Michael Stueben started teaching Fortran at Fairfax High School in Virginia in 1977. Eventually the high school computer science curriculum changed from Fortran to BASIC, Pascal, C, C++, Java, and finally to Python. In the last five years, Stueben taught artificial intelligence at Thomas Jefferson High School for Science and Technology in Alexandria, VA. Along the way, he wrote a regular puzzle column for Discover Magazine, published articles in Mathematics Teacher and Mathematics Magazine, published a book on teaching high school mathematics: Twenty Years Before the Blackboard (Mathematical Association of America, 1998). In 2006 he received a Distinguished High School Mathematics Teaching / Edyth May Sliffe Award from the Mathematical Association of America.

Bibliographic Information

Buy it now

Buying options

eBook USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access