Sep-07-2020, 04:34 PM
(Sep-07-2020, 03:40 AM)ndc85430 Wrote: If you've got one module that's used everywhere, that sounds like bad design - seems like you don't have separation of concerns.
It would be good to see a concrete example, though.
I intend to start error logging on the project I’m working on. Now granted this is my first time having to do that manually (in php, the sever was always set up to do that for me). So I wanted to set up a class, or function that I can send errors to. It would automatically add the date, time and source of the error. It would also email me if anything major happened.
Since errors can happen anywhere, it’d be nice if I could autoload that, so I could just call it when it’s needed.
The program I am working on also happens to rely on input from an external API. Different parts of the program need results from it. I’d like to be able to call the API directly from the files that need it.
Also, smaller things. I always find myself formatting stings, or arrays in a specific way. In php and JavaScript, I simply make a function that does that for me, and call it when I need it. Once again, it would be nice if those things were omnipresent in all of the code.