Rob Thornton
Author Rob Thornton
Software Developer
Posted in Software & Development , Video , Drupal , Tech Talk
June 28, 2018
read
Back to blog

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.

Contact us and learn more about our custom ecommerce solutions

How to decode obfuscated PHP files

If you've ever had a website or server hacked, that was serving up PHP files, then you might have come across a file like this: This is a real life ...
Keep Reading »

Code Review: How to Take on Unfamiliar Code

It’s commonplace for developers to be shuffled between projects and it can be challenging to work with unfamiliar code. You’ve probably experienced ...
Keep Reading »

Memory Usage in PHP - Dealing with Arrays

Drupal is built on PHP so any developer working with Drupal needs some PHP knowledge. PHP memory management is something that can initially be a ...
Keep Reading »
Get Free Widget

Fields marked with * are required.

×
×