[plt-dev] request not to use all-caps identifiers

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Apr 12 09:26:11 EDT 2010

I just noticed this variable named "TEXT/HTML-MIME-TYPE" in the 
excellent Web server API, and wanted to request that PLT not get in the 
habit of using all-caps.

As far as I know, the reason Java kids use all-caps for constants is an 
artifact of 1970s C, and no longer makes sense.  C had no "const" at the 
time, and compilers and computers were very limited, but they did have 
the C preprocessor.  So people used preprocessor macros for constants.  
The C preprocessor was very crude and ill-conceived by Scheme syntax 
extension standards.  It was easy to break your code because you 
unknowingly used a preprocessor macro that, say, expanded to function 
call with side effects despite looking like a variable reference, or 
reassigned your variables, or expanded to more than one expression, or 
even expanded to an incomplete expression or statement.  Because 
preprocessor macro names were identifiers just like variable and 
function names, a naming convention of putting macro names in all-caps 
helped to flag this bit of code that did not behave as a variable or 
function.  Then, when Java was being developed, the professional 
programmers for whom it was originally targeted were at the time C and 
C++ programmers, so Java was made to look a lot like C++.  (Ironically, 
it was the analogue of COBOL and 4GL programmers who became most of the 
Java programmers, not the embedded systems, technical, and shrinkwrap 
developers who wanted the language to look like C/C++.)  Some Java 
person must've thought that using all-caps for constants was a good 
idea, because, hey, that's how it's done in C++, so they started doing 
that in Java, even though Java did not have the dangerous preprocessor 
and it did get "const".  So now you see Java programmers writing 
"someFooBar = 


Posted on the dev mailing list.