code is a mass noun
During the Marketplace Morning Report on 11/13, there was a segment covering Google's recent release of software and a bounty surrounding Cell phones. During this segment, the use of the word "code" followed conventions that aren't preferred in the Computer Science community--academic or commercial.
During the segment they refer to "based on a code that's open". When code is used in this context, it's collective and should be used without an indefinite article. While, "based on code that's open" would be correct.
Other appropriate uses:
1. code
2. source code
3. the source code
4. some source code (usually a part of a program)
5. line of code (a single line of a program)
6. a piece of codeThe usage of "code" very much follows other words like "stuff" and "water". "code" is a mass noun in the English language and thus cannot be preceded by numerals like "one code" (when the semantics refer to computer software). As a result, it's not used with the indefinite article a or an.
Improper uses (in all below, you can simply remove the "a" or "an" for a proper usage):
I downloaded a code to solve that problem.
Google released a source-code to mobile manufacturers.
An open-source code would encourage developers.
All of the above reflects my opinion. My wife, however will often say things such as "I am trying to debug a code that I wrote a few months ago." It also seems that in the non-CS/EE/CE fields of scientific research that this usage is quite common. One of the libraries she uses in building her programs (not codes) is FFTW has a statement on their home page
Our benchmarks, performed on on a variety of platforms, show that FFTW's performance is typically superior to that of other publicly available FFT software, and is even competitive with vendor-tuned codes.
This too uses code as a count noun incorrectly.