© Karl Beecher 2018
Karl BeecherBad Programming Practices 101https://doi.org/10.1007/978-1-4842-3411-2_3

3. Variables

Karl Beecher1 
(1)
Berlin, Germany
 

Objectives

In this chapter, you’ll learn:
  • The chaos that poorly named variables can induce

  • How to do variable declaration in a confusing way

  • Why being lax with the scope of variables causes problems

  • How to abuse the type system of a language

  • The power of null to cause trouble

Prerequisites

Before reading this chapter, make sure you’re familiar with basic types, like integers, strings, and collections.

Introduction

Where would programmers be without variables? Without them, there would be no way to record and keep track of information as a program goes about its business.

As variables are such a fundamental ...

Get Bad Programming Practices 101: Become a Better Coder by Learning How (Not) to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.