Thursday, August 8, 2013

Coding is fun...

Today was the first day when I actually wrote some code at work.. and it was fun. It was expected, but still.. it was fun.

Now you might wonder which part? Well, it was not about my code but about code written by others. I mean, who writes code and at the end is making fun of it?!
(maybe mr. Stroustrup, the creator of C++).

I will note two short examples. The first was in C++, more exactly Visual Studio 2010. Some code had many constructions like this:

      _T("Message")

I looked up for this construction and found to be a macro to __T(x), which is also to be replaced by x. This must be one of those advices for good practice in Visual C++.

The second was in Java were I've found a misterious function named formatData("..") which was called several times. Go to declaration and voilĂ :

      String formatData(String s) {
        return s;
      }

Most of our time we need to read code written by others. For now, these useless constructions are just fun.


PS. I wrote this article to see if it integrates well with g+ too.