Dr. Dobb's Blogs http://www.drdobbs.com//author/6821 Dr. Dobb's Copyright 2012, United Business Media. en-us Aliasing Is Particularly Troublesome With Vector Elements http://www.drdobbs.com/cpp/aliasing-is-particularly-troublesome-wit/240155096 I would like to continue our discussion with a particularly nasty case in which the result is not well defined. Thu, 16 May 2013 22:28:00 -0400 Some Subtleties of Aliasing http://www.drdobbs.com/cpp/some-subtleties-of-aliasing/240154618 Aliasing can cause paradoxical behavior. Thu, 09 May 2013 19:27:00 -0400 Sometimes, Making a Program Clearer Makes It Faster http://www.drdobbs.com/cpp/sometimes-making-a-program-clearer-makes/240154079 We can "optimize" our code by removing requests for operations that our data structures do not really need to support. Wed, 01 May 2013 21:15:00 -0400 Some Optimizations Are No-Brainers http://www.drdobbs.com/cpp/some-optimizations-are-no-brainers/240153739 Kernighan's rule for optimizations (Don't do it) is good advice. But as with most rules, there are exceptions. Fri, 26 Apr 2013 14:53:00 -0400 Sometimes Optimizations Cancel Each Other http://www.drdobbs.com/cpp/sometimes-optimizations-cancel-each-othe/240153129 Two rights can make a wrong in the software-design world. Wed, 17 Apr 2013 14:43:00 -0400 Optimizing a Program Means Making It Run Faster, Right? http://www.drdobbs.com/cpp/optimizing-a-program-means-making-it-run/240152663 People often use optimization to mean changing a program in ways that they think will make it run faster, but that casual definition is far from complete. Wed, 10 Apr 2013 14:18:00 -0400 Optimization Versus Flexibility &mdash; An Example http://www.drdobbs.com/cpp/optimization-versus-flexibility-an-exam/240152292 Last week, I <a href="http://www.drdobbs.com/cpp/is-optimization-immoral/240151916 ">discussed</a> how optimization can sometimes mislead programmers into writing code that works better in the lab than in the field, perhaps because the problems that programs encounter in the field are larger than those that are used during testing. As luck would have it, since I wrote that article, I encountered a real-world example of that phenomenon. Thu, 04 Apr 2013 15:04:00 -0400 Is Optimization Immoral? http://www.drdobbs.com/cpp/is-optimization-immoral/240151916 Dynamic memory allocation in C++ (and C) can be surprisingly expensive. Thu, 28 Mar 2013 07:50:00 -0400 If Order Relations are Such a Pain, Why Bother? http://www.drdobbs.com/cpp/if-order-relations-are-such-a-pain-why-b/240151471 Whenever a problem turns out to be harder to solve than we expected, it makes sense to ask whether perhaps we were solving the wrong problem in the first place. Fri, 22 Mar 2013 05:30:00 -0400 Comparing an Integer with a Floating-Point Number, Part 2: Tactics http://www.drdobbs.com/cpp/comparing-an-integer-with-a-floating-poi/240150886 We continue last week's discussion by getting down to details. Thu, 14 Mar 2013 21:27:00 -0400 Comparing an Integer With a Floating-Point Number, Part 1: Strategy http://www.drdobbs.com/cpp/comparing-an-integer-with-a-floating-poi/240150323 We have two numbers, one integer and one floating-point, and we want to compare them. Thu, 07 Mar 2013 21:10:00 -0500 It's Hard To Compare Floating-Point Numbers http://www.drdobbs.com/cpp/its-hard-to-compare-floating-point-numbe/240149806 Last week I posed a problem: Suppose you have an inheritance hierarchy that lets you represent integers or floating-point numbers. How would you define comparison within your hierarchy? We can restate this problem in a language-independent way: How can we compare two numbers, either of which might be integer or floating-point? Fri, 01 Mar 2013 09:06:00 -0500 Comparison and Inheritance http://www.drdobbs.com/cpp/comparison-and-inheritance/240149250 We continue last week's discussion of comparison functions by thinking about how to compare objects from different parts of an inheritance hierarchy. Fri, 22 Feb 2013 16:36:00 -0500 Concrete Examples of Orderings http://www.drdobbs.com/cpp/concrete-examples-of-orderings/240148718 There is a commonly used strategy, often called <i>lexicographical order</i> or <i>dictionary order</i>, for taking the ordering strategies for individual components and combining them. Fri, 15 Feb 2013 09:42:00 -0500 How Dictionaries Work http://www.drdobbs.com/cpp/how-dictionaries-work/240148057 Treat each object as a sequence of symbols and impose a dictionary order on the symbols. Wed, 06 Feb 2013 18:35:00 -0500 A Strategy for Defining Order Relations http://www.drdobbs.com/cpp/a-strategy-for-defining-order-relations/240147625 If you want to compare two complicated objects, the strategy is to define a function that computes a single number from each object and then compares those numbers. Fri, 01 Feb 2013 05:44:00 -0500 If C++ Objects Are Unrelated, Are They Equal? http://www.drdobbs.com/cpp/if-c-objects-are-unrelated-are-they-equa/240146950 Last week, I said that sorting in C++ depended on an appropriately defined comparison operation, and ended by explaining some properties that any such comparison operation must have. Let's continue our discussion. Thu, 24 Jan 2013 13:27:00 -0500 Introducing C++ Order Relations http://www.drdobbs.com/cpp/introducing-c-order-relations/240146592 The C++ library facilities for sorting, binary searching, and ordered containers work only on types with appropriate order relations defined on them. Fri, 18 Jan 2013 06:23:00 -0500 It's A Heisenbug! http://www.drdobbs.com/cpp/its-a-heisenbug/240146005 It's finally time to wrap up the discussion I started in December about what seemed at first to be a mysterious compiler bug. Thu, 10 Jan 2013 09:23:00 -0500 Isolating A Superbug http://www.drdobbs.com/cpp/isolating-a-superbug/240145442 How could it possibly be that concatenating <code>preamble</code> and <code>output</code> would always work with one strategy but not another? Wed, 02 Jan 2013 10:55:00 -0500 Down The Rabbit Hole http://www.drdobbs.com/cpp/down-the-rabbit-hole/240145272 Last week, I described how I almost traced a bug to the wrong program. Having come this far, I would like to describe the actual source of the bug &mdash; such a strange source that I would never have suspected it when I began looking. Wed, 26 Dec 2012 18:55:00 -0500 Are You Sure You Know What's Broken? http://www.drdobbs.com/cpp/are-you-sure-you-know-whats-broken/240144986 This week, I continue in our discussion of a bug in a multipass compiler. Wed, 19 Dec 2012 05:39:00 -0500 Debugging by Hypothesis http://www.drdobbs.com/cpp/debugging-by-hypothesis/240144365 There's a technical term for people who claim that their programs don't compile because of a compiler failure rather than a bug in their own programs: <i>arrogant</i>. Thu, 13 Dec 2012 04:34:00 -0500 Debugging As Science: A Concrete Example http://www.drdobbs.com/cpp/debugging-as-science-a-concrete-example/240144054 Last week, I argued that debugging is more science than art. I would like to continue that discussion with an example from my own experience. Thu, 06 Dec 2012 16:43:00 -0500 Debugging: Art or Science? http://www.drdobbs.com/cpp/debugging-art-or-science/240142870 Every bug is different, so saying something that applies to the act of debugging requires finding something general to say about a bunch of unrelated specific cases that defy generalization by their very nature. Thu, 29 Nov 2012 05:12:00 -0500