Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 1.28 KB

intro.md

File metadata and controls

82 lines (55 loc) · 1.28 KB

Correct by construction?

  • If it compiles, it's right (probably)
  • Obviously wrong code should not compile

Hello!

  • Games
  • C++ Tools
  • Google / YouTube
  • Finance

Toolbox

  • const & constexpr
  • Enumerations
  • Lambdas
  • RAII
  • Static code analysis
  • Strong types

"But I don't make APIs"

Code is a way you treat your coworkers.

— Michael Feathers (@mfeathers)
June 25, 2020

Trading System


void sendOrder(
  const char *symbol, 
  bool buy, 
  int quantity, 
  double price); 

Selling shares


void sellMyGoogleShares() {
  sendOrder("GOOG", false, 100, 1000.00); 
}

void expensiveMistake() {
  sendOrder("GOOG", false, 1000.00, 100); 
}

But what about warnings?

$ gcc -c -Wall -Werror -Wextra expensive.cpp
$