在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?

请每个回答只回答一个特征。


当前回答

BrainFuck语言。真的是这样!

其他回答

Objective-C对字符串@的使用。示例:@"这是一个字符串。"

FORTRAN并不是一个真正的WTF时刻,而更像是一个“为什么我需要输入所有这些垃圾时刻”

IF(12 .gt. 11) THEN
 // Do some magic
ENDIF

“.gt.”在我玩这门语言的时候把我弄糊涂了,直到我意识到它是“>”符号。哦,我多喜欢不学生物,不用天天接触这些垃圾

JavaScript日期全是WTF。

var d = new Date("1/1/2001");

var wtfyear = d.getYear(); // 101 (the year - 1900)
// to get the *actual* year, use d.getFullYear()

var wtfmonth = d.getMonth(); // 0
// months are 0-based!

我很惊讶没有人提到大多数类c语言中丑陋的开关case实现

switch (someInt) {
    case 1:
    case 2: System.out.println("Forgot a break, idiot!");
    case 3: System.out.println("Now you're doing the wrong thing and maybe need hours to find the missing break muahahahaha");
            break;
    default: System.out.println("This should never happen -,-");        
}

好在新语言正确地实现了它。

Common Lisp的format函数有一个选项,可以将数字打印为罗马数字。

在INTERCAL中,这是你能得到的唯一输出形式。