3 ms·
You can find it in my code :) I tried very hard to understand the draw that other people had to object-oriented programming, and it never took. It seems to me
by combatentropy 9y ago
You can find it in my code :)
I tried very hard to understand the draw that other people had to object-oriented programming, and it never took. It seems to me much leaner to use functions and associative arrays.
I spend a lot of time designing both. I try first of all to give functions good names: not too long yet telling. Then I fiddle with the arguments: their number, order, and names. And then for associative arrays I spend some time figuring out the best structure for them for easy use by everything else.
Maybe it's just because I write CRUD web apps. Most the processing is done in SQL. Then it's a matter of wrapping the resultant data in an HTML template. I write as little of my app in PHP as possible.
Of course with the HTML there is often JavaScript, another chance to get complicated. But I have tried the single-page application thing and found that the app was actually slower than my past apps, which were written in the ROCA style (http://roca-style.org/ http://roca-style.org/). So back to the ROCA style I went, where just using jQuery here and there doesn't get as unwieldy.