Education Station:
Explicit is Better Than Implicit
By Chris Tankersley
The argument over strict typing is nothing new in PHP. When the PHP 7.0 release was under development and the idea of scalar type hinting came up, there were developers on all sides with opinions on how it should work. While PHP 7.0 could introduce backward compatibility breaks, introducing strict typing had the potential to break years and years worth of code. How far the language went with this surfaced a variety of opinions. Let’s look at the benefits of using scalar type hints to clarify the intent of your code.
@dragonmantank is always a good read in @phparch . Appreciate the March 2019 article on implicit vs. explicit programming. Great examples.
— D.Lo (@DLoBoston) April 10, 2019
This article was originally published in the March 2019 issue of php[architect] magazine. To read the complete article please subscribe or purchase the complete issue.
Leave a comment
Use the form below to leave a comment: