• pkgsrc: Yesterday's changes

    It has been a while since I've done any "big" changes in pkgsrc, basically because I've been quite busy with VCS Made Easy during the past month. To make things worse, I've got back to university and there is a lot of work to do. [Continue reading]

  • Tabulators vs. spaces

    Code indentation is a very personal thing; people use 2, 4, 8, or any other amount of whitespace to align their constructions. However, few of them pay attention to the usage of spaces or tabulators to accomplish what they want. Some others do, but problems remain. Let's analyze what these are: [Continue reading]

  • Boost: Shared pointers

    The Boost Smart Pointers library provides a set of classes to manage pointers. I've started using boost::shared_ptr and am very happy with the results. Let's see what it is. [Continue reading]

  • Boost: First impressions

    Despite my previous post, I decided to give a try to Boost and switched VCS Made Easy to use some of its libraries; the modified source code is not yet on the public server (hmm, the joys of Monotone), but I think it'll be soon. [Continue reading]

  • Boost: To use or not to use it

    For at least two weeks, I've been rewriting VCS Made Easy from scratch (and it's already working fairly well), a project I announced a long time ago. It's being written in C++ and the code is organized in three (independent) layers: [Continue reading]

  • Passing information to configure scripts

    GNU Autoconf provides three ways to pass information to the generated configure scripts; these are enable-style flags, with-style flags and command line variables. Despite each one is provided with a very concrete goal in mind, many people overloads their meaning. Their purpose is clearly described in the manual, which these people "forget" to read. (I know it's impossible to read everything one would like to... not an excuse in this case, I'd say.) [Continue reading]

  • How to get the user's home directory

    Many programs need to access the user's home directory to look for files, specially configuration ones. To do that, they usually get the HOME environment variable's value and use it to construct the full path. However, if the application is security-sensible, this is probably inappropriate. [Continue reading]

  • C++: Verifying program sanity

    The C language provides a macro, called assert, that is used to verify conditions that must be true at any point of the program. These include preconditions, postconditions and invariants, all of which are explained in introductory programming courses. Whenever an assertion is violated, the program is abruptly stopped because there is most likely a bug in its code. [Continue reading]

  • C++: Containers of pointers

    One of the things C++ provides to programmers is that pointers can be avoided in much situations, and IMHO, they should be (specially in public class interfaces). However, there are some times in which pointers must be used. [Continue reading]

  • Guessing Tcl/Tk configuration

    When a program uses Tcl and/or Tk, its configuration script (if any) has to check for the presence of these libraries and retrieve some information about them, such as their version, the required link flags, etc. Unfortunately, the process to achieve this is rather obscure (AFAIK), thus it is unknown by many people. This results in unportable (and broken) configuration scripts. [Continue reading]

  • C++: Exceptions and destroyers

    If you use exceptions to signal errors in C++, you should be really careful when throwing an exception from inside a class' destroyer function, because you can easily cause an abort trap. Consider the following code: [Continue reading]