Making singleton class secure: Take 2

Few days back I wrote something about the Making singleton class secure. Its my personal experience, avoid Singleton approach as far as possible in the sense you avoid Pointers and class destructors and switch to Java from c++. But, while I say this every now and then I feel that uncontrollable surge to put all the code in a singleton class and put up all sort of factories in there.

Making singleton class secure

There comes a time for a project, when you can’t resist using a Singleton class, for things that can’t be afforded to duplicate. Say, for example I’m creating a World class and I want only a single world to exist in my entire project. So, next time anyone is referring to World, he’s referring to this:

Dynamic Programming: Take I

I mean, if 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself “Dijkstra would not have liked this”, well, that would be enough immortality for me.

  • Edsger Wybe Dijkstra

iOS: Moving in and out of NSLogs

So, if you are a iPhone developer like me you must be using a lot of NSLog in your code, and at times you must have really wished for a way to turn them all ON and OFF from single place.
Here is a easy way I do it.

Step 1: Create a SJLogger.h and SJLogger.m. In the SJLogger.h add this macro: