July 2014 (2)

2014-07-12

Static class variables are just global variables in disguise

Cape Cod Gunny just wrote a blog article about how to replace a global variable by a static class instance.

But I had to react!
Using such static declaration is just another way of creating a global variable.
This is just a global variable in disguise.
In fact, the generated asm will be just like a global variable!

It encapsulates the global declaration within a class name space, but it is still IMHO a very wrong design.
I've seen so many C# or Java code which used such a pattern (there is no global variable in those languages), and it has the same disadvantages as global variables.
Just like the singleton syndrome
Code is just not re-entrant nor thread-safe.
Nightmare to debug and let evolve.

Continue reading

2014-07-04

Website of the day

Just wanted to share some awesome SOA revolutionary idea, on 4th of July... You should take a look at http://devnull-as-a-service.com ! DAAS rocks! We will write certainly a native mORMot provider for this great data provider. This is another great Open Source project (full code is included).