Strangest Programming Language Feature?
41–50 of 66 posts
Re: Strangest Programming Language Feature?
#42No mention of "ALTER" ( http://en.wikipedia.org/wiki/COBOL#Self-modifying_code ) on the first page? 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. I also miss call by name ( http://en.wikipedia.org/wiki/Man_or_boy_test ) on the first page. In general, one should read the Intercal ( http://en.wikipedia.org/w…
But I did always liked the COBOL, OCCURS DEPENDING ON ( http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/inde... ) and how you could use it to write variable length records to files, saving space on tape or DISC and with that faster and cheaper.
it is after all effeciency and getting that extra drop of performance that drives the weird and wonderful quirks and usage and practices that this topic aspires to highlight.
Re: Strangest Programming Language Feature?
#43I have a blog entry about it (http://boston.conman.org/2008/06/18.2) 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).
There isn't much about the language on the Internet. In fact, the only 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 (https://groups.google.com/forum/#!topic/rec.arts.int-fiction...) which has a few inaccuracies (or perhaps was looking at a version of the code before processing).
Re: Strangest Programming Language Feature?
#44/me drops the MUMPS reference manual on the table That whole language is one long-running WTF.
f p=2,3:2 s q=1 x "f f=3:2 q:f(asterisk)f>p!'q s q=p#f" w:q p,?$x\8+1 8 (Not sure if this is going to mess up the formatting, so apologies in advance). This (shamelessly stolen from a usenet sig) will print out a table of primes with formatting. Adding a quit based on max prime size is left as exercise to the reader. Explanation: f = for, but basically used as a while loop since we don't have a terminate condition ('…
and something about that code reminds me of vi commands.
Re: Strangest Programming Language Feature?
#45I heart what should be called a "truth injection attack" in Python: http://stackoverflow.com/a/2021553/109618
I think you can do something like this in C# too (not surprisingly).
Re: Strangest Programming Language Feature?
#46In CoffeeScript I discovered the other day that: 0
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
having "==" be semantically quite different to "arguably coffeescript has made things worse in this case compared to plain javascript, where you're probably not going to expect === to behave similarly to not obvious how you'd improve this to make it consistent, without say redefining how "==" and "<=" work to make them raise type errors or evaluate to something undefined if the types of the arguments don't match.
Re: Strangest Programming Language Feature?
#47Compare these two:
Re: Strangest Programming Language Feature?
#48Re: Strangest Programming Language Feature?
#49In CoffeeScript I discovered the other day that: 0
JavaScript doesn't have strict relational operators (>, =,
CoffeeScript: 0
[1]: http://coffeescript.org/#operators[2]: http://www.ecma-international.org/ecma-262/5.1/#sec-11.8
EDIT: Forgot to include 'is' and 'isnt' operators.
Re: Strangest Programming Language Feature?
#50Smalltalk's "become" is a pretty interesting one... http://gbracha.blogspot.it/2009/07/miracle-of-become.html
Smalltalk also is rather famous for giving developers enough freedom to more or less destroy the environment with the terrifying looking command "Smalltalk := nil"