Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

The Most WTF-y Programming Languages 254

itwbennett writes "A couple of years ago, developer Sammy Larbi undertook a project to identify which languages had the most instances of the string 'WTF' in their GitHub code repositories. At the time, Objective C topped the list. ITworld's Phil Johnson has updated Larbi's research using GitHub data from the last 21 months, but instead of screen-scraping GitHub search results as Larbi had done, he queried the GitHub Archive for stand-alone instances of 'WTF' in the comments attached to GitHub commits to weed out cases where the string 'WTF' was legitimately used in the code. The three most baffling languages for 2012/13: C++, Lua, and Scala. Objective C comes in at #16."
This discussion has been archived. No new comments can be posted.

The Most WTF-y Programming Languages

Comments Filter:
  • Visual Basic (Score:5, Insightful)

    by BenSchuarmer ( 922752 ) on Wednesday September 25, 2013 @04:49PM (#44952857)
    I'm not sure whether it's the language, or the people who choose to use it.
  • by Assmasher ( 456699 ) on Wednesday September 25, 2013 @04:49PM (#44952861) Journal

    ...instead of the code itself?

    I've seen plenty of "WTF was this guy thinking when he wrote this?" or "WTF is he trying to do here?" comments in code.

  • Re:One for one (Score:5, Insightful)

    by Anonymous Coward on Wednesday September 25, 2013 @04:51PM (#44952889)

    perhaps the people who write PHP code do not realize when they have written a WTF.

    Also, to borrow a troll from theDailyWTF (.com)
    "TRWTF is Visual Basic"

  • by Anon, Not Coward D ( 2797805 ) on Wednesday September 25, 2013 @04:53PM (#44952913)

    those conclusions are drawn without controling for a language usage. Since c++ is widely adopted so there will be more instances of a comment where "WTF?" is used.

    Why don't use a percentage at least? Even if that was the case, the problem remains... a wtf-y language may be the most avoided and/or not present in github

  • by paavo512 ( 2866903 ) on Wednesday September 25, 2013 @05:04PM (#44953107)

    According to TFA, he "calculated the average number of WTF commit comments per repository". So why not per line of code or whatever? C++ projects tend to be rather large (because it is harder to write large projects in other languages), so surely by this metric C++ would win (aka lose) here.

    If there is one thing I have learned about statistics it is that you can prove about anything you want ... unless you want and are actually able to find the correct normalizations.

  • by beelsebob ( 529313 ) on Wednesday September 25, 2013 @05:12PM (#44953229)

    Languages are just Syntax - get over it.

    It makes me sad that so many people focus on the syntax of the language they're using. So much so, that they think that languages are just syntax.

  • Re:One for one (Score:5, Insightful)

    by dgatwood ( 11270 ) on Wednesday September 25, 2013 @05:17PM (#44953277) Homepage Journal

    PHP is actually a pretty nice language. It's basically just C with dollar signs, classes, and better string and array handling, stuffed into a fairly straightforward HTML template language.

    You hear so many horror stories about PHP because of what I would describe as a "meta problem". Like most languages that are primarily used for web coding, a sizable percentage of people who write code using PHP have no idea what they are doing, as their level of programming skill is only slightly above "can write out basic HTML markup using string manipulation". This results in terrible code with lots of horrifying bugs, poor performance, security holes, and so on. JavaScript, Ruby, etc. are also known to exhibit this phenomenon.

  • by larry bagina ( 561269 ) on Wednesday September 25, 2013 @05:19PM (#44953305) Journal
    Yeah, and sex is just sticking your dick in a hole. Some of us care about which hole it is.
  • Re:One for one (Score:5, Insightful)

    by Nerdfest ( 867930 ) on Wednesday September 25, 2013 @05:20PM (#44953325)

    Well, that and the inconsistencies.

  • Re:C++ (Score:5, Insightful)

    by geek ( 5680 ) on Wednesday September 25, 2013 @05:26PM (#44953391)

    IMHO, C++ is a simple, flexible, intuitive, and powerful language... IF (and only if) you know how to use it.

    So what you're saying is that it actually isn't simple, flexible and intuitive? Because if it was simple, flexible and intutive you wouldn't have to say "IF (and only if) you know how to use it." That's kind of a big contradiction.

  • Re:One for one (Score:4, Insightful)

    by Zero__Kelvin ( 151819 ) on Wednesday September 25, 2013 @05:39PM (#44953577) Homepage
    Or more accurately, everything written in PHP is one big WTF.
  • They forgot SQL! (Score:5, Insightful)

    by Zero__Kelvin ( 151819 ) on Wednesday September 25, 2013 @05:45PM (#44953643) Homepage

    SELECT repository_language, count(*) AS wtf_cnt
    FROM [githubarchive:github.timeline]
    WHERE type == "PushEvent" AND
    REGEXP_MATCH(LOWER(payload_commit_msg), r'wtf[^a-zA-Z0-9]')
    AND PARSE_UTC_USEC(repository_created_at) >= PARSE_UTC_USEC('2012-01-01 00:00:00')
    AND PARSE_UTC_USEC(repository_created_at) GROUP BY repository_language
    ORDER BY wtf_cnt DESC
    LIMIT 100
  • by QRDeNameland ( 873957 ) on Wednesday September 25, 2013 @06:31PM (#44954051)

    Why would seeing 'WTF' implicate the language...instead of the code itself?

    Well, my nominee for the language that enforces a "WTF" syntax is DOS/Windows batch/command language (so WTF it doesn't even have an official name). There's been more than a few times I had to google to figure out how to script some seemingly simple functionality and upon finding the answer said "Really?!?! WTF?!?" It is pretty much impossible to make more-than-trivial batch scripts readable to someone not well versed in the black art of .bat, at least not without a boat load of rem statements.

  • Re:C++ (Score:4, Insightful)

    by Dodgy G33za ( 1669772 ) on Wednesday September 25, 2013 @07:03PM (#44954339)

    You need to go and look up the meaning of the word intuitive.

  • Re:C++ (Score:5, Insightful)

    by jma05 ( 897351 ) on Wednesday September 25, 2013 @10:21PM (#44955641)

    > IMHO, C++ is a simple, flexible, intuitive, and powerful language

    > simple

    By exactly what standards is C++ a simple language? Other than Perl, can you name several more complicated languages than C++?

    > flexible

    Fine. It is.

    > intuitive

    How is C++ intuitive? There are plenty of articles explaining the gotchas of C++. Have you read them?

    > powerful

    The most abused adjective in reference to programming languages. I don't think I have seen *any* general purpose programming language that has not described as powerful.

    C++ is powerful. Python is powerful etc. Just not in the same way.

    > The problem is, most programmers don't.

    So it isn't simple or intuitive. It's the programmer syndrome. Of course my UI/API is simple and intuitive... because I get it. The only way others would not get it is because they are stupid.

    > So often, I end up working on spaghetti code written 5 years ago by someone who, for example, thinks inheritance is the solution to all problems, and that private member variables are for sissies.

    This is different - perhaps needlessly complex use of C++. So these programmers don't get OOP or good design patterns. That's not what people complain about when they talk about C++ being complicated though.

    For the record, I don't hate C++. I like what it has done with C++ 11. But simple and intuitive are the farthest things from it.

  • Re:One for one (Score:4, Insightful)

    by DMUTPeregrine ( 612791 ) on Wednesday September 25, 2013 @11:58PM (#44956229) Journal
    Naw, PHP causes a WTF when it behaves as one would intuitively expect it to, according to its own rules of grammar.
  • Weighted metrics? (Score:2, Insightful)

    by Anonymous Coward on Thursday September 26, 2013 @12:36AM (#44956457)

    Did he take into account the amount of code written in these languages and offsetting that against the WTF instances? For e.g. Clojure will not have a code base as large as that of C++. So it's obvious, that it will have lesser WTF than C++. A weight needs to be given to the amount of code as well otherwise these figures are just common sense.

  • by Xest ( 935314 ) on Thursday September 26, 2013 @05:07AM (#44957529)

    Through my career I've noticed this sort of belief come and go.

    At first, when I learnt my first language, I was impressed by people who knew multiple languages.

    Then I learnt my second language and thought hey, languages are just syntax, and I learnt a few more languages.

    But I wasn't really learning the languages per-se, I was simply learning some basics of each language - if-else, for, while, that sort of thing.

    It turns out there's more to most languages than this, so then I learnt about C#'s advanced language features and how they're implemented like LINQ, lambda expressions, extension methods, and so forth.

    But then I found other languages were also implementing or already had implemented similar things like lambdas in C++11, and that in some ways it was just syntax again.

    Eventually I realised that some of it is just syntax, but more fundamentally it's about understanding certain theory and principles of maths and computer science that are prevalent throughout languages and software and that come up in various guises and ways and it's understanding that that allows truly great developers to hope languages successfully, coupled with knowing the quirks and pitfalls of each and every language. That every now and then you'll encounter a language that follows a completely different paradigm and that what you thought you knew to be correct across all languages or all languages of a certain type/class/paradigm isn't necessarily so.

    If you're say, a Java or C# developer and you end up on a PHP project then it's not enough to just know how to write those basic and common programming constructs, you have to know that PHP has contradictory equality operators and so forth to be able to write good software in it.

    Don't feel too sad for the GP, he's just not very far along in this path of realisation. If he's the sort of developer that is good at self-improving he'll get there eventually. More than anything the idea that's it's "just syntax" that makes you sad, is simple inexperience and, everyone's inexperienced at some point. The real test of competence and worth is whether they choose to stay inexperienced or not.

I was playing poker the other night... with Tarot cards. I got a full house and 4 people died. -- Steven Wright