No mention of "ALTER" (<a href="http://en.wikipedia.org/wiki/COBOL#Self-modifying_code" rel="nofollow">http://en.wikipedia.org/wiki/COBOL#Self-modifying_code</a>) on the first page?<p>Self-modifying code was fairly common at the time COBOL was developed, but incorporating it in a high-level business language was, IMO, a very weird decision.<p>I also miss call by name (<a href="http://en.wikipedia.org/wiki/Man_or_boy_test" rel="nofollow">http://en.wikipedia.org/wiki/Man_or_boy_test</a>) on the first page.<p>In general, one should read the Intercal (<a href="http://en.wikipedia.org/wiki/INTERCAL" rel="nofollow">http://en.wikipedia.org/wiki/INTERCAL</a>) paper, and figure out from which language each of its features came.
Smalltalk's "become" is a pretty interesting one... <a href="http://gbracha.blogspot.it/2009/07/miracle-of-become.html" rel="nofollow">http://gbracha.blogspot.it/2009/07/miracle-of-become.html</a>
Someone's already mentioned COBOL's ALTER X TO PROCEED TO Y, so I'll mention a programming language called COMAL. A friend with a C64 showed it to me, and it was very respectable for its time and the available resources; reminded me of BASIC09.<p>Apparently it was written by someone from Denmark, and there were commands to switch back and forth between English and Danish. I don't remember whether it was just for error messages or for those and for the language keywords as well; I want to say the latter.
INRAC, the langauge RACTER (<a href="http://en.wikipedia.org/wiki/Racter" rel="nofollow">http://en.wikipedia.org/wiki/Racter</a>) has the most bizarre flow control I've ever seen in any computer language, ever. It can best be described as "a random, pattern matched GOTO/GOSUB" which is the most succinct description I can come up with.<p>I have a blog entry about it (<a href="http://boston.conman.org/2008/06/18.2" rel="nofollow">http://boston.conman.org/2008/06/18.2</a>) but in short, each line of an INRAC program (unless it ends with a '#' mark in which case execution continues to the next line) is a subroutine, each with a label. The label does not need be unique, but when you "call" a subroutine, INRAC will just pick one line with that label at random to execute. The pattern matching comes in because you can select the label with wildcard characters (which just picks a line that matches the pattern at random).<p>There isn't much about the language on the Internet. In fact, the <i>only</i> other page aside from my blog entry (which I wrote as I went through the existing source code I found for Racter) is the Racter FAQ (<a href="https://groups.google.com/forum/#!topic/rec.arts.int-fiction/RTV5CUkJ8fs" rel="nofollow">https://groups.google.com/forum/#!topic/rec.arts.int-fiction...</a>) which has a few inaccuracies (or perhaps was looking at a version of the code before processing).
C++ has all sorts of fun stuff. One example is std::vector<bool>, which is not implemented as a simple array of booleans like every other std::vector, but instead it is a bitmap. Afaik this behavior is required by standard. One fun side-effect is that you can't take the address of individual elements of the vector.<p>Compare these two:<p><a href="http://ideone.com/qC9yOp" rel="nofollow">http://ideone.com/qC9yOp</a><p><a href="http://ideone.com/jF4krp" rel="nofollow">http://ideone.com/jF4krp</a>
The control structures in Icon are not quite what you would expect and qualify as strange: <a href="http://en.wikipedia.org/wiki/Icon_(programming_language)" rel="nofollow">http://en.wikipedia.org/wiki/Icon_(programming_language)</a>
Snobol... where patterns are first class constructs, and every line can end with a GOTO. That definitely lets you write some very, er, compact code. But it was superb to program in.<p>And how about the assigned GOTO in older versions of Fortran? "GOTO N" where N is an integer variable whose value will be known at runtime.<p>Happy days...
The COBOL MOVE-CORRESPONDING verb. I'm not going to try to explain exactly how it works here, but imagine, if you will, copying the contents of one table to another table with a different column structure, but sort of the same names.
C switch fallthrough. I know it's old and everybody's used to it and I get why it's there, but it's freaking weird. I love c#'s response that you must use goto <case> instead to make fallthrough explicit.
I <i>heart</i> what should be called a "truth injection attack" in Python: <a href="http://stackoverflow.com/a/2021553/109618" rel="nofollow">http://stackoverflow.com/a/2021553/109618</a>
Duff's device is certainly a very strange construct.<p><a href="http://www.lysator.liu.se/c/duffs-device.html#duffs-device" rel="nofollow">http://www.lysator.liu.se/c/duffs-device.html#duffs-device</a>
in vb.net: off-by-one array sizes so people who do one-based arrays don't get hurt. Also, two sets of boolean operators, the simpler ones don't short-circuit (or vs orelse, and vs andalso).
It logically follows from how arrays in C works, so I don't really know if it qualifies for weird/suprising, but the old <i>array[i]</i> / <i>i[array]</i> thing is fun to show to people who haven't seen it before.<p>The most amusingly weird thing I can think of is INTERCAL's COMEFROM: <a href="http://en.wikipedia.org/wiki/COMEFROM" rel="nofollow">http://en.wikipedia.org/wiki/COMEFROM</a>