Live data from Hacker News

Strangest Programming Language Feature?

stackoverflow.com

11–20 of 66 posts

Re: Strangest Programming Language Feature?

#13
post #5

No 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…

Your mentioning "ALTER" made me think about a dialect of BASIC that I once used (STARDOS BASIC on a "Micro V" computer, back in the late 1980s). This BASIC dialect had an "XEQ" function that would pass a string to the tokenizer and execute it as an immediate-mode command. If you started the string with a line number you could create self-modifying BASIC code. It was dizzying to my young mind.

Re: Strangest Programming Language Feature?

#14

Fun fact, this is also the reason why 'i' is commonly used as a name for the loop counter variable.

Source?

I mean google around. It's not "it's definitely from Fortran" more like "it has been repeatedly suggested that...".

Re: Strangest Programming Language Feature?

#17

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.

This is one of the COBOL features that makes a lot more sense if you think of COBOL as SQL for tape drives than as something that is trying to be, say, Pascal or Ada and failing. (Along with, say, pretty much the entire DATA DIVISION...)

Re: Strangest Programming Language Feature?

#19
post #9

: 2 3 ; ... redefines the constant 2 as 3. FORTH. Go figure :-)

Taking about constants, the scad format (for 3D design) allows for defining and redefining constants, but they always have the last defined values...

That is, unless you import a module within redeclariations, in what case the module will inherit the values of the last declarations above the line it's imported on (not the last one of the file). And yep, that'll replace any declarations within that module.

The biggest surprise is that this is useful.

Re: Strangest Programming Language Feature?

#20
post #6

/me drops the MUMPS reference manual on the table That whole language is one long-running WTF.

This line in MUMPS is not only valid, it also actually does something potentially useful: s:foo'="" foo(foo)=foo It's actually a bit tricky to explain what it does. Everything in MUMPS is effectively a tree. Each tree has a value in the "root node" and you can set it like this: set foo="hello" You can also put data deeper into the tree: set foo("fizz")="buzz" So if something is passed to you and you want to know if y…

It is amazing that MUMPS will be 50 years old in 2 years -- and it still alive and kicking.

An emergency MUMPS project is still my highest billing project (per hour) ever.

Post reply on HN