Автор: Chris Zimmerman
Издательство: O’Reilly Media, Inc.
Год: 2023
Страниц: 347
Язык: английский
Формат: pdf (true), epub (true)
Размер: 10.2 MB
This philosophy-of-programming guide presents a unique and entertaining take on how to think about programming. A collection of 21 pragmatic rules, each presented in a standalone chapter, captures the essential wisdom that every freshly minted programmer needs to know and provides thought-provoking insights for more seasoned programmers.
Author Chris Zimmerman, cofounder of the video game studio Sucker Punch Productions, teaches basic truths of programming by wrapping them in memorable aphorisms and driving them home with examples drawn from real code. This practical guide also helps managers looking for ways to train new team members.
The examples in the book are all written in C++. If you’re a Python or jаvascript programmer, you’ll be happier if you read Appendix A, “Reading C++ for Python Programmers”, or Appendix B, “Reading C++ for jаvascript Programmers”, before getting too far into the Rules. The two appendices act as Rosetta Stones to translate that C++ into the concepts you’re used to. If your experience is with some other language and you find the C++ examples hard to follow, then I suggest the phenomenal website Rosetta Code.
If you’re a C++ programmer, note that I’ve simplified a few things in the code examples to make them easier to read for non-C++ programmers. For example, the examples use signed integers in a few places where unsigned integers would be more typical for a C++ program, and I disabled warnings about implicit conversion between signed and unsigned values. I also compiled the examples with an implicit “using std” to avoid a boatload of distracting “std::” references.
The rules in this book include:
As simple as possible, but no simpler
Let your code tell its own story
Localize complexity
Generalization takes three examples
Work backward from your result, not forward from your code
The first lesson of optimization is don't optimize
A good name is the best documentation
Bugs are contagious
Eliminate failure cases
Code that isn't running doesn't work
Sometimes you just need to hammer the nails
Скачать The Rules of Programming: How to Write Better Code (Final Release)