Acro Media: Reducing Unnecessary Code Nesting in PHP


The majority of Drupal’s underlying code is PHP. As a Drupal developer, the better you know PHP, the better your code will be. In this Acro Media Tech Talk video, Drupal developer Rob Thornton discusses code nesting and how you can optimize your code in order to reduce unnecessary nesting. 

Code nesting can basically be described as when a block of code is contained within another block of code. If you’re code isn’t well thought out, you can potentially end up with deep nesting that is both hard to read and difficult to maintain. Aside from reducing difficult to read code and making your code more maintainable, reducing the amount of nesting helps you find bugs and lets other developers contribute to your code easier. Rob uses a number of examples of common nesting scenarios, walking you through how to find and fix them.

If you liked this video, you might also like these posts too.

  • Memory Usage in PHP – Dealing with Arrays
  • DrupalCon 2018 Session: How Memory Works in PHP and Its Hidden Costs
  • How to decode obfuscated PHP files
  • Drupal Commerce 2: A Comprehensive Overview for Drupal Developers and Technical Managers

قالب وردپرس