Hacker News new | past | comments | ask | show | jobs | submit login

COBOL's ALTER statement.

As if COBOL weren't WTFy enough, the statement ALTER X TO PROCEED TO Y changes any subsequent GOTO X statement to go to Y instead. Meaning it's anybody's guess where a given GO TO, considered in isolation, goes to!




I upvoted you because it is the first thing I think of when I think of this question, but in Cobol's defense, self-modifying code (http://en.wikipedia.org/wiki/Self-modifying_code) was fairly normal at the time COBOL was conceived.

For a nice example from a later date, look at the GetChar subroutine on Commodore Basic. It loaded a byte from a hard-coded address, and then updated that address (hm, probably in the reverse order, since, IIRC, it shared code with GotChar, which returned the last value GetChar returned)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: