A Good Programmer is a Lazy Programmer
The Art of Being Good and Lazy
Embed:
One of my favorite sayings is that a good programmer is a lazy programmer. I know what some of you are asking: How can a lazy programmer be a good programmer? Note, though, that I didn't say a lazy programmer was a good programmer, but that a good programmer was a lazy programmer. There is a distinct difference!
The Art of Being Good and Lazy
One of the most basic rules of programming is that repetitive code should be put into a function (or a subroutine, or a class, etc.). If you were to write a piece of code that required several strings to be capitalized you would not write the logic to replace lower case with upper case for each instance of that string; you would write a function that accepted a string and returned the same string in all caps.
This is something that every programmer knows.
But, the basic idea is something that should always be on a programmers mind. Most sets of code that is repeated throughout a program, or throughout many programs, and follows a pattern can be done better by using functions or classes.
It is a fundamental rule of a good programmer, and yet it is something that many programmers don't follow. Don't get me wrong -- most developers understand and utilize the concept on a micro scale -- but the concept is not limited to micro-use. It can be used for almost any set of code, big or small, and in almost every programming language.
Take, for example, your standard data entry screen. When I developed in Visual Basic using a SQL Server to store the data we did not use dataset objects on the form. Instead, we used "unbound" forms where we would write the functions to put data onto the form or save data from the form to the database. This is good programming because it reduces the hit on both the client and the server.
But, it requires huge chunks of code to be written for each form. The fetch code would open a recordset, populate it, individually place each value form the recordset to the form, and then close the recordset. The save code would do the same thing in reverse.
You may also like...
- Signs of a Lazy Web Programmer
- PHP Object Oriented Programming OOP for Beginners
- Programming: Creating Executables
- Computer Programming - Then and Now
- The Best Approach to Learning Computer Programming
- The Visual Basic MSDN Website Overview
- The Visual Basic Language Reference on the Web
- Navigating the Visual Basic MSDN Website
- Agregar Botón De Visual Basic a Documento En Microsoft Word
- The Best Tutorial Sites for Visual Basic.NET
Comments
Type in Your Comments Below - (1000 characters left)
Most Commented On


