What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered?
Please only one feature per answer.
What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered?
Please only one feature per answer.
APL (other than ALL of it), the ability to write any program in just one line.
e.g. Conway's Game of Life in one line in APL:
alt text http://catpad.net/michael/APLLife.gif
If that line isn't WTF, then nothing is!
And here is a video
In Java:
Can be written as:
I always wondered why the simplest program was:
Whereas it could be:
Maybe this is to frighten computer science students in the first place ...
powerbasic (www.powerbasic.com) includes the compiler directive:
this increases the size of the compiled executable by
<bloatsize>
bytes. this was put in the compiler in case people creating the executable don't like the small size of the generated executable. it makes the EXE seem bigger to compete with bloated programming languages:)In JavaScript:
Whereas
Quoting Neil Fraser (look at the end of that page),
(in Java, but behaviour is apparently the same in JavaScript and Python). The result is left as an exercise to the reader.
EDITED: As long as we are on the subject consider also this: