PHP has evolved massively since its first days, and it's on the road to a full-featured language. However, at the same time, there is a lot of outdated information and libraries with poorly written code.

This talk is about writing PHP Code that is: safe, robust, maintainable, and optimized for the reader. We are going to cover a set of rules, that if you follow them; they will get you on the habit of writing code well.

Get ready for a 20 to 35 min live-coding session, where I go through practical examples. You will learn how to design classes, how to think about your API to prevent breaking changes, and discover concepts around method design, naming, error handling, and much more.

Comments

Comments are closed.

Great talk. Very useful

Marcel Pociot at 18:41 on 25 May 2019

Great talk with a lot of useful examples on how to apply some nice code strategies. Well done.

This talk had some good contents like Immutability, Value Objects or declaring classes as final (composition over inheritance).

Though there was way too much opinionated stuff inside and the code examples also didn't look that great.

- Not using type hints...? Instead the speaker recommended using comments for that? Type hints are awesome for static code analysis and are a great part of defensive programming. Of course the input should be validated further, but not using any type hints at all is definitely not a good practice.

- A Money class that only declares an amount and not the currency? What are we dealing with then? 100 Euros? Or Philippine Pesos? Or maybe Zimbabwe Dollars?

- Why throwing a generic exception instead of a domain-specific exception like "NegativeAmountException()". Then there's also no need to add a comment when the exception is thrown because the exception name is already self-descriptive.

Maybe this talk is great for a Laravel conference though where code quality is defined differently it seems.

Milan Urukalo at 22:19 on 26 May 2019

Nice

Nenad Mitic at 22:04 on 27 May 2019

Nice talk with a bunch of good pointers

Miša Ković at 12:19 on 29 May 2019

Good talk, excellent examples and tips. Good job!