Tag Archives: programming

Fragmentation when allocating memory

To reduce fragmentation specially in high-activity code, allocate temporary buffers (buffers that will live only for a short while) from a separate memory pool. The idea is to avoid long-lived buffers and short-lived buffers from being allocated from the same pool.

Share
Posted in Uncategorized | Tagged | Leave a comment

Coding and Holding The Big Picture in Your Head

I find that I am often unable to complete some piece of code unless I have a mental picture of the whole thing in my head. And this is a huge problem. For small things, it is fairly easy to get a mental picture of what needs to be done and my coding happens fast. [...]

Share
Posted in Uncategorized | Tagged | Leave a comment

If you are going to print tablular information…

…in a console as a result of some debugging or control command, then try to ensure that any column that uses string or such similar output does not have spaces within that column. This helps with parsing output using tools like awk that are able to split by column and help with subsequent slicing and [...]

Share
Posted in Uncategorized | Tagged | Leave a comment

Using the right programming font

After playing around a bit with various fonts and color schemes due to increasing eye-strain, today, I finally settled on using “Lucida Console” with “ClearType” font smoothing for C/C++ programming (under Windows with Emacs and Vim) and realized something — when the code looks beautiful (as it does with this font combination), I feel like [...]

Share
Posted in Uncategorized | Tagged | 2 Comments

Programming is all about decision making

As a programmer, you are continually making decisions when you program. Both at the macro level and the micro level. For any project, you have to select the programming language, the tools and the environment. Then as you design, you have to choose continually among multiple ways of doing anything. As you code, you continually [...]

Share
Posted in Uncategorized | Tagged | Leave a comment

“Premature Flexibilization”

The author of  this coins a new phrase — Premature Flexibilization: …the practice of adding complexity to your code to make it more “flexible”, in anticipation of future change. The article, triggered an “yes” response in me because I felt the same way many times. In all my coding, I find that I waste a [...]

Share
Posted in Uncategorized | Tagged | Leave a comment