Skip to Content
Object Design Style Guide
book

Object Design Style Guide

by Matthias Noback
January 2020
Intermediate to advanced
288 pages
6h 45m
English
Manning Publications
Content preview from Object Design Style Guide

Appendix: Coding standard for the code samples

The programming language used for the code samples in this book is a generalized object-oriented programming language. Its syntax is a mix of PHP and Java. It has the following properties:

  • It’s strictly typed. Parameters and return values need explicit return types:
     public function foo(Bar bar): Baz
     {
         // returns an instance of `Baz`
     }
  • Parameters, properties, and return types can allow for null as a value by adding a question mark at the end:
     public function foo(Bar? bar): Baz?
     {
         // allow in instance of `Bar`, or `null`
    
         // returns an instance of `Baz`, or `null`
     }
  • If you don’t add a question mark after a parameter or return value’s type, null will not be an accepted value for it:
     public ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Object Design Style Guide

Object Design Style Guide

Matthias Noback
Design It!

Design It!

Michael Keeling
The Art of Clean Code

The Art of Clean Code

Christian Mayer

Publisher Resources

ISBN: 9781617296857Publisher SupportOtherPublisher WebsiteErrata PagePurchase Link