Source: paulund.co.uk

Write Better Functions
As a software developer, writing good functions is an essential part of creating maintainable and reliable code. #make-your-functions-small-and-focusedOne of the keys to writing good functions is to keep them small and focused.

A good function name should accurately describe what the function does and should be easy to understand even out of context.

#use-clear-and-consistent-function-signaturesThe function signature includes the name of the function, the number and types of arguments, and the return type.

For example, consider the following function: function calculateTotal(array $items, $taxRate, $discount = 0): float{ // code to calculate the total}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners