In any industry, there are amazing hacks that are passed down, generation to generation, at trade-shows and conferences. In organizations, these little bits of dirt solidify into idiomatic pearls and paradigms. These sorts of things can't be learned in school.

That's why one of Mac's colleagues took him in and decided to show him the dark secrets of programming. For instance, the best way to clean up variables, is illustrated below.

  int traverseGroup( Node *peer, Node *parent, Node *children[], int n )
      /* status = ... */

      if ( SUCCESS != status )
          /* Failed to complete! */
          logError("Failed to traverse successfully.");
          /* Add an error. */
          return 1;

      return 0;

      /* Free up the memory used in the function. */
      free( peer );
      free( parent );
      free( children );
      free( n );

It should be noted that this function is not supposed to change the data-structure. I guess this "senior developer" --- after whom this article is named --- just feels like stack variables deserve to be free. Mac, we're here for you.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!