Tuesday, January 24, 2006

deducing types from code

One of the ugliest things in C++ is reading complex type names. It is even uglier to deduce types from ugly code. It gets worst if templates are involved as well. We skip templates here for a first shot. Watch the correct(!) C++ statement 0[new weird](1)()(3,"strange")((weird(*)())0,5); and try to understand the syntactic meaning. Next describe the signature of the class weird that contains one method only.

I hope you will never _write_ code like that but you most likely will _read_ similar code if you have to work with code from other people. --- This is not a joke but a horror!

No comments: