Category «Programming»

Adding tracing to your code

One thing you might want in your code is to add tracing to it so that your application log file will contain entries for all function entries and exits. This is tremendously useful when debugging a running application especially when you cannot connect a debugger to it for any reason. It is also very helpful …

Broken Windows

Once upon a time, in a place far far away, there was an idyllic small town. The town had a beautiful street with elegant houses on either side and big green trees gave shade to the sidewalks. The houses had large french doors and windows made with expensive panes of glass. Kids played ball on …

RAII – Resource Acquisition Is Initialization

Resource Acquisition Is Initialization (RAII) is a programming idiom used in C++ for resource management. To understand it clearly let us look at a common programming problem. Consider a method that needs to be synchronized across multiple threads. If you were programming against Win32 and if you were using Critical Sections as your synchronization primitive, …

What I miss about C#

It has been a month or so since I started programming in C++. To be frank it is not the monster that I thought it would be and it wasn’t that hard to move to C++ from C#. Granted I haven’t faced any of the notorious and nasty bugs that is difficult to debug in …

Coming Home

C++ was my first programming language. We were “taught” C++ in our first semester for our Engineering curriculum. Needless to say it was a nightmare. C++ is too big and too hard as a first programming language. At least it was for me. I didn’t own a computer at that time and I hadn’t really …

Creating a Windows Service in Visual Studio

In earlier versions of Visual Studio there was a template to create Windows Service in C++ by going to File menu -> New and clicking on Project. In the New Project dialog, if we click the Visual C++ Projects node in the Project Types pane, there was a Window Service template. This is not available …