Always use functions if possible

Ricardo Sawir
Nov 24, 2020
Photo by Luca Bravo on Unsplash

I code with PHP. And after I used class and functions, I am now leaning toward to use functions rather than class.

My reason is the simplicity. If you can optimize to use functions only, It proves that the app you’re building is actually so understandable that new developers who just onboard to your project can understand what’s going on in your app.

In my opinion, class kinds of defeats that purpose, though with the help of documentation, it certainly helps. I myself experience this. I am jumping into a project that is built only with functions. And this helps a lot for me to understand what’s going on.

Follow me on Twitter https://twitter.com/RicardoSawir to get latest tweets of my opinion

--

--