02. White Space

White space simply refers to the amount of spaces, tabs and blank lines you have in your source code:

private void initialDeal() {
   player.addCard(deck.deal());
   player.addCard(deck.deal());
   dealer.addCard(deck.deal());
   dealer.addCard(deck.deal());
}

private void dealersTurn() {
   while (dealer.handValue() < 17) {
      dealer.addCard(deck.deal());
   }
}

private . . .

Much like indenting, programming languages simply don’t care how many blank lines or spaces you might have in and around your code. This means that you can purposefully block sections together by simply adding line breaks between them. This makes the readability of your code even better and remember that readability is what it’s all about, so don’t be afraid to add some white space in your source code!

Leave a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>