News for hackers. Stuff that matters.
Re:Show HN: Detecting the Programming Language of Code Using... by gkbrk on Tuesday July 19, 2016 @06:08AM (#12120869)
It incorrectly classifies the following valid C++ code as Javascript. It seems to be thrown off by the use of console.log without actually classifying based on the syntax.

    #include <iostream>

    class Logger {
        public:
            void log(std::string a) {
                std::cout << a << std::endl;
            }
    };

    int main() {
        Logger console = Logger();
        for (int i=0;i<10;i++) {
            console.log("test");
            console.log("test");
            console.log("test");
            console.log("test");
            console.log("test");
            console.log("test");
            console.log("test");
            console.log("test");
        }
    }

There are no comments on this comment yet.