Separating Code into Smaller Files in C
I am in the process of cleaning up my code and making it easier to maintain. I am doing this by turning my 5000+ line file into separate smaller files.
How can I avoid the “global $dbh” anti-pattern?
This is what most of my database-related library code looks like:
Various methods manipulating same member variable versus each takes inputs and provides output [closed]
Closed 9 years ago.
Early destruction of objects in c++
I am not sure if this is the right forum of this question, but I will try here since this question about the c++ language. The problem:
Early destruction of objects in c++
I am not sure if this is the right forum of this question, but I will try here since this question about the c++ language. The problem:
Using macros to protect assignment to global variables
Because there is no language feature in C to protect assignment to global variables would you recommend doing something like this?
Why create a Global-ish Object.create function?
I’m a fairly experienced programmer in the .NET and Java realms, and I’ve started reading up on JavaScript. I bought Douglas Crockford’s “The Good Parts” book, and I’m immediately put off by a few things.
Should I use a global logging variable?
Over and over again we’re told, “globals are bad” and with good reason. However, I’m working with a logger that needs to be accessible everywhere in the program. Why shouldn’t I create a global logging object? The alternative seems to be to pass the logger object into every object I instantiate and that seems very repetitive and non-productive.