Wednesday, January 22, 2014

can your language talk json?

Recently I discovered Python. It's really amazing that the language is that flexible so it can treat json literals as it's usual code. Think about constructing all objects in Java with any JSON library. Is this flexibility specific to dynamic languages? Btw I have found an example that well known and loved ;> C++ also is flexible enough to handle JSON:
std::string json_cxx = { 
  key: "value", 
  number: 53     
This will compile. But... don't be fooled by compiler letting pass that code! The result is not what javascript developer could expect :/