Life's Miscellaneous Et Ceteras

Brandon Valosek's reflections on life, philosophy, and programming

Questionable Coding Practices

As I’m trying to finish up one of my programming projects, I was scanning through some of the code I had written and found something that was rather… interesting.

Normally, I consider myself a good programmer, but sometimes I have to take shortcuts and cut corners.

Here is a snippet from one of my recent projects in my CS 375 Compilers class:

/* Increment the index and return the next entry
   we can use as a label. New entry should be
   validated as well and safe for whomever wants
   to peek at it. */

int GetNextLabel ()
{
   return 3;
}

The amount of code like this seems to be proportional to the margin of time between the due date and the time I actually finish the assignment.

« Previous post