Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _layouts/book-page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
---
{% include mathjax.html %}

<article class="post">

<header class="post-header">
Expand Down
1 change: 1 addition & 0 deletions better-code/00-preface.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Preface
layout: book-page
tags: [ better-code ]
chapter: 0
---

To understand what _better code_ is we first need to understand what _good code_ is. Students are often taught that good code is code that does what the specification says it should. But such an answer begs the question of what is a good specification? Nearly every experienced developer I've met has a snippet of code filed away that has profound beauty - it likely has no corresponding specification and may not even contain a single comment. So what is good code?
Expand Down
3 changes: 1 addition & 2 deletions better-code/01-types.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
title: Types
tagline: No Incomplete Types

layout: book-page
tags: [ better-code ]
chapter: 1
---

The notion of a _type_ is a fundemantal component of programming. Types are created to represent a class of objects. Types can be very general, such as “integer” or very specific such as “index into the collection of documents.”
The notion of a _type_ is a fundamental component of programming. Types are created to represent a class of objects. Types can be very general, such as “integer” or very specific such as “index into the collection of documents.”

{::comment}This section is referenced by chapter[03]{:/comment}

Expand Down
4 changes: 2 additions & 2 deletions better-code/02-algorithms.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Algorithms
tagline: No Raw Loops

layout: page
layout: book-page
tags: [ better-code ]
chapter: 2
---

Testing 1.2.3...
1 change: 0 additions & 1 deletion better-code/03-data-structures.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Data Structures
tagline: No Incidental Data Structures

layout: book-page
tags: [ better-code ]
chapter: 3
Expand Down
4 changes: 2 additions & 2 deletions better-code/04-runtime-polymorphism.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Runtime Polymorphism
tagline: No Public Inheritance

layout: page
layout: book-page
tags: [ better-code ]
chapter: 4
---

Object-oriented programming has been one of the paradigms supported by C++ from its invention. The idea of type inheritance and virtual functions were borrowed from Simula[^cpp-history]. Inheritance can represent a subtype or protocol relationship. Although the two are closely related, in this chapter we're primarily concerned with subtype relationships through class inheritance. Protocols are discussed in the next chapter. {::comment}link{:/comment}
Expand Down
2 changes: 1 addition & 1 deletion better-code/06-relationships.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Relationships
tagline: No Contradictions

layout: book-page
tags: [ better-code ]
chapter: 6
---

### Motivation
Expand Down
4 changes: 2 additions & 2 deletions better-code/07-epilogue.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Epilogue

layout: page
layout: book-page
tags: [ better-code ]
chapter: 7
---

Testing 1,2,3...