Make MediaMaker Great Again!

Not about sales

Not about architecture

It's about the code

Hardest problems in Computer Science

1. Cache invalidation

2. Naming things

You don't code for CPU

You don't code for interpreter

You don't code for compiler

You code for people

You code for other developers

You code for your future self

Bad practices

Abstract names

  • $data
  • $object
  • $data2
  • $data3

Abbreviations

  • $pos
  • $auth
  • $mod

<ThatThing>Manager

  • UserManager
  • StringManager
  • ProductManager
  • etc

Alternative for -Manager:

  • Builder
  • Bucket
  • Writer
  • Adapter
  • Converter
  • Factory
  • Handler
  • Provider

Lack of consistency

  • Customer
  • User

Pseudo-getters

Too long names

Name and return type don't match

Too many dependecies

And now for something

completely different

No PHPDocs

Or worse: misleading docs

Magic numbers

YAGNI

Don't pass arrays

  • no type hinting,
  • no type checking,
  • no docs

render()?

It's just POC

Good practices

Standards

Solution oriented exceptions

Code Ownership

Code review

Short, meaningful,

easy to overview, single change

getter doesn't change anything

Meaningful names

Short names

PHPDoc

Architects' role

Thank you!

Made with Slides.com