Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming

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:
  • Oblig.... (Score:5, Funny)

    by Doug Otto ( 2821601 ) on Wednesday September 25, 2013 @03:47PM (#44952827)
    WTF?
  • One for one (Score:3, Interesting)

    by Anonymous Coward on Wednesday September 25, 2013 @03:48PM (#44952841)
    C++ deserves its spot, it's pretty screwed up. I haven't dealt with Lua or Scala, so I can't comment on either. However, I imagine this probably also scales directly with the popularity of the language and indirectly with the skill of the people writing in it. So Lua would make sense; it's popular and seems to attract a lot of amateurs. I'm surprised PHP is so low, though; I hear horror stories about it that make me glad I never have to touch it.
    • Re:One for one (Score:5, Insightful)

      by Anonymous Coward on Wednesday September 25, 2013 @03: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"

    • Oh good grief. (Score:2, Informative)

      by Anonymous Coward

      All of us develop according to the platform. In other words, you want to make a living coding apps, code in Objective -C, C# or Java.

      What's the issue here?!

      I mean if I had to make a living coding COBOL, I'd do it!

      Languages are irrelevant. You want to develop iOS apps - Objective-C. MS apps? Well, you get a break here C# (Java Clone), VB, C++, C, etc ...

      Android - C++ and they push you to Java.

      Languages are just Syntax - get over it.

      Stuck on a language because it's the "best" tool? You are a hack. A compu

      • by beelsebob ( 529313 ) on Wednesday September 25, 2013 @04: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.

        • by Xest ( 935314 ) on Thursday September 26, 2013 @04: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.

      • Re: (Score:2, Insightful)

        Yeah, and sex is just sticking your dick in a hole. Some of us care about which hole it is.
      • The languages primarily used by people is not independent of various traits of said people. Different folks go into development for different reasons, and there will be a tendency across demographics to focus on different platforms. eg Game developers will statistically migrate to specific technologies, and the distribution of what they use won't be the same as those interested in analytics. So yes, you may see correlations between computer language used and the skills [or lack there of] of the developers.
      • by ShanghaiBill ( 739463 ) on Wednesday September 25, 2013 @05:57PM (#44954277)

        Languages are irrelevant.

        01010111 01010010 01001111 01001110 01000111 00100001

      • Comment removed based on user account deletion
      • All of us develop according to the platform. In other words, you want to make a living coding apps, code in Objective -C, C# or Java.

        There's still plenty of work targeting multiple platforms in plain old C, it's been putting the cake on my table for the last couple of decades. Having said that, most (paid) developers can do "something" in most languages simply by reading some code and googling unfamiliar constructs. I suppose when you think about it, googling an unfamiliar language is just a more relaxed version of WTF. Also, in my experience most WTF comments within the code are criticisms of the author, rather than the language itself.

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

      by dgatwood ( 11270 ) on Wednesday September 25, 2013 @04: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.

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

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

        Well, that and the inconsistencies.

      • Wish I could mod up. I get an untold amount of shit for currently working in PHP (I've had plenty of experience in C++, C, Perl, Python, etc.). Cleaning up others code and deploying a custom built framework pays my bills (quite well). If you use the right framework or build one yourself then security shouldn't be an issue. Granted, PHP let's you get away with a lot of dumbassery that other languages don't, but as a programmer if you're not parameterizing your queries and sanitizing outside variables then
      • by laffer1 ( 701823 )

        PHP is actually a lot like Perl. It also makes sense because PHP was originally a template language for Perl prior to getting rewritten in C.

        The problem with PHP is the inconsistency. Parameter order is not consistent. Point releases change behavior and break code.

        I also find PHP to be more irritating to debug than other web languages.

      • by segmond ( 34052 )

        PHP is not C with dollar signs. Syntax alone doesn't make a language. Behaviour does. C is very small, PHP is huge. C the language is small and separated from the standard libraries. PHP and it's libraries are the language. C's closeness to bare metal matters, function, references, allocating and freeing memory. no dictionaries. having to build any complex data structure from the ground up, not the same or related. When I program in C or PHP, my mind mode is not the same in any way shape or for

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

        by Phroggy ( 441 ) <slashdot3@NOsPaM.phroggy.com> on Thursday September 26, 2013 @01:38AM (#44956957) Homepage

        PHP is actually a pretty nice language.

        No it isn't.

        It could have been, if the people who created it had known what the hell they were doing. And it has gotten a lot better in recent years (for example register_globals has actually been removed from the language now), but where they started from was so mind-numbingly stupid that I don't see how they could ever make it actually good, without also breaking it in ways that would make everyone stop using it.

        Here's a general rant about how stunningly awful PHP is: http://www.codinghorror.com/blog/2012/06/the-php-singularity.html [codinghorror.com]

        And here's a specific and detailed side-by-side comparison between PHP and Perl: http://www.tnx.nl/php.html [www.tnx.nl]

        But you're spot-on about the "meta problem": most people who write in PHP have no idea what they're doing, so most PHP code out there is badly written, so if you're learning the language, there's a very good chance that you're learning from someone who didn't know what they were doing.

    • Comment removed based on user account deletion
  • Visual Basic (Score:5, Insightful)

    by BenSchuarmer ( 922752 ) on Wednesday September 25, 2013 @03:49PM (#44952857)
    I'm not sure whether it's the language, or the people who choose to use it.
    • Re: (Score:2, Funny)

      by Anonymous Coward

      Its way, way, the people who use it. For some of our in house code, I've seen for a variable:

      Select Case x
      case 1
      goto line1
      end select
      Select Case x
      case 2
      goto line2
      end select
      Line1:
      bblah blah
      goto line3
      line2:
      blah blah
      goto line3
      line3:
      rest of program

      • Haha. That was almost exactly how the original "Adventure" game was implemented, in FORTRAN. And I saw many, many BASIC programs that worked the same way back then.

        For the unenlightened, Adventure was the first of the 'cave' games that I know of (although "Hunt the Wumpus", written in Dartmouth BASIC and also running on many timesharing systems, might have had an independent birth). Output was to a text terminal, much like the original Star Trek game.

        Adventure was written as one very large linear program

    • It's the language. I use it it but not through choice, and all I can say is WTF.

  • by Assmasher ( 456699 ) on Wednesday September 25, 2013 @03: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.

    • C/C++ does allow for a lot of that.

      Reading IOCCC entries illustrates this perfectly.

      • by lgw ( 121541 )

        C++ is full of constructs that while good code and properly used, still leave the reader thinking WTF? There's just a lot of language that most people have no reason to use, and so can be baffling when first encountered. Things like overloading "new" and "placement new" make perfect sense when you have the problem they were intended to solve, but otherwise just inspire "what is this I don't even!"

        Good C code tends to make sense even if you don't know C.

    • by Megane ( 129182 )
      It's also skewed to "languages used in Github projects". More importantly, would the people programming in a real WTF language [veekun.com] not even know that it was such a WTF?
    • by QRDeNameland ( 873957 ) on Wednesday September 25, 2013 @05: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.

    • I agree. Just because some code was commented on by William T Foster doesn't mean the code or the language is bad.

  • Where are some examples of these offending comments? With no context this list of languages is meaningless.

  • by Anon, Not Coward D ( 2797805 ) on Wednesday September 25, 2013 @03: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 Kyle Jacoby ( 2973265 ) on Wednesday September 25, 2013 @04:00PM (#44953055)

      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

      Well, they DID account for it, but they did it all wrong. They counted WTFs *per repository* ...but that makes the assumption that all repositories are of equal size, which they are not. If C++ repositories have more code on average, then that simple fact could account for the increased WTFs per repository, even if everything else was equal.

  • LICENSE.txt (Score:5, Funny)

    by TeknoHog ( 164938 ) on Wednesday September 25, 2013 @03:54PM (#44952929) Homepage Journal

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    Version 2, December 2004

    Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

    Everyone is permitted to copy and distribute verbatim or modified
    copies of this license document, and changing it is allowed as long
    as the name is changed.

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. You just DO WHAT THE FUCK YOU WANT TO.

  • Is there any indication why Lua scores so highly here? It seems a rather benign little language to me. Certainly, nil-terminated arrays are can be tricky, and a missing local keyword can ruin your day, but that seem minor annoyances. And for the local-vs-global issue, there are now editors with semantics highlighting that clearly disambiguate the two cases.

    • by segmond ( 34052 )

      I do like to see some of those lua codes too, i'm a bit shocked at that.

      • by lgw ( 121541 )

        There is a C-to-LUA compiler. I'm sure its output is fun.

        • by segmond ( 34052 )

          Well, I would consider that an assembly language not lua code. It's kinda like the languages that compiler to javascript. Those codes are not meant to be read or modified by human.

          • by lgw ( 121541 )

            Oh, you've never had to maintain production assembly language for which the original source code was lost? (Well, we had the code as comments put there by the compiler, but no compiler for the original language was still around). Kids these days have it so easy!

            • Sounds like there is a need for an assembler for your platform that has an inline-C feature (much as many compilers have an inline-asm feature.) At least then one could slowly convert the code back to something relatively maintainable...

              Discloser: There hasn't been a year that has gone by since ~1987 that I have not written a good amount of assembler code for some processor, and I'm not even a god damned professional programmer.
    • Re: (Score:2, Informative)

      by Anonymous Coward

      LUA is the scripting language for World of Warcraft.

      WoW stores addon data files in the "WTF" folder.

      This is more-than-likely due to that.

    • Having read Lua language source code, there's not a lot of WTF in there, at least no more than normal.

  • That's easy. (Score:5, Informative)

    by gallondr00nk ( 868673 ) on Wednesday September 25, 2013 @03:56PM (#44952975)
    Brainfuck. Look it up, I can't even give a code example as it pisses off /.'s filter.
  • My WTF (Score:4, Interesting)

    by EmperorOfCanada ( 1332175 ) on Wednesday September 25, 2013 @03:57PM (#44952991)
    My WTF would be people posting Visual Basic to GitHub. Then another WTF for anyone posting cobol to Github. My next WTF would be where the WTF is directed. Is it directed at the code or away from the code. Also many might be directed at the language or even a specific implementation. So my regular WTF in Objective-C would be theInsanelyLongDefinedParametersThatAreUsedInTheNS library. But when it comes to much of my own past perl code I suspect I would comment WTF in that in my Perl days I could twist a regular expression into pretty much anything.

    But when you are getting to a lower level as in C and C++ you are going to be running up against strangeness in libraries like OpenGL and might be writing a comment such as "WTF won't nVidia release a proper library for Linux?" Or "WTF is wrong with the Android NDK and getting GPS data in C++?"
  • WTF (Score:4, Funny)

    by ArcadeMan ( 2766669 ) on Wednesday September 25, 2013 @03:59PM (#44953023)

    Watchdog Timer Fault.

  • Objective-C (Score:5, Funny)

    by Ukab the Great ( 87152 ) on Wednesday September 25, 2013 @04:02PM (#44953077)

    We Objective-C developers prefer more verbose WTF statements, such as

    - (void)whatTheFuckAreYouDoing:(NSString *)wtf withThatAbsurdAlgorithm:(NSString *)algorithm thatOnlyOnePersonOnDevTeamUnderstands:(BOOL)doesHeReallyUnderstandIt;

  • by paavo512 ( 2866903 ) on Wednesday September 25, 2013 @04: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.

    • 12 out of 30 Helens agree with your conclusion about statistics.

    • That's still a metric that I can't really wrap my head around. Instead, why not choose something more familiar, such as the average number of WTFs per Library of Congress written in that language? Much more useful.

  • C++ (Score:3, Informative)

    by harvestsun ( 2948641 ) on Wednesday September 25, 2013 @04:06PM (#44953137)
    IMHO, C++ is a simple, flexible, intuitive, and powerful language... IF (and only if) you know how to use it.
    The problem is, most programmers don't. 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.
    Also, I wonder how many of those "WTF"s were from people trying to use Windows APIs (don't you just love COM?). That's what consistently causes me the most frustration.
    • Re:C++ (Score:5, Insightful)

      by geek ( 5680 ) on Wednesday September 25, 2013 @04: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.

      • I don't see why "has a steep learning curve" contradicts anything. It may be intimidating at first (especially if the person has previously only worked with higher-level languages), but it all makes sense once you learn it... with some exceptions (function pointer syntax comes to mind). Whereas PHP, for instance, seems confusing no matter how experienced the programmer is.
    • by gatkinso ( 15975 )

      >> C++ is a flexible, and powerful language

      Fixed that for you.

      C++'s strengths come at a steep price.

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

      by jma05 ( 897351 ) on Wednesday September 25, 2013 @09: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.

  • by ddd0004 ( 1984672 ) on Wednesday September 25, 2013 @04:08PM (#44953171)

    by using the search term "l33t".

  • There's obviously something wrong with this metric since Python has twice the whatTheFuckability as Perl: http://www.itworld.com/sites/default/files/WTF_programming_languages-600x450.jpg [itworld.com]
    • by geek ( 5680 )

      Simple answer is because no one uses Perl anymore, so it's going to have less WTF due to less usage.

    • The only people still using Perl are the people who know it well enough to no longer have to ask What TF is going on with it.

  • I think the best way to evaluate this would be WTFs per node in a parse tree, or some other structure that accounts for the actual complexity of the code as opposed to the verbosity of the language. Otherwise, begin... end languages would appear less WTFy then {... } languages.

    The question is really moot though. Just grepping for WTF won't tell you if it's directed at a problem related to the language (WTF doesn't this template generate what I want, Lisp macros were so much better) or the code (WTF were t

  • ... that since there's always going to be detractors in any programming language, the more popular a language is in actual use, the more prevalent there is liable to be a bias against that particular language. The correlation of course, is not strictly linear, since different percentages of people familiar with a language will be biased against them, Nonetheless, I think a more interesting and informative analysis would be to normalize the list of hated languages against the individual language's actua
    • by lgw ( 121541 )

      High WTF-per-minute code can be written in any language. I'm looking at code now where "l" is used frequently as a variable name (really). Does the language even matter?

      • by mark-t ( 151149 )

        In my view, "l" might be an acceptable variable name in a scope that is only 2 or 3 lines long, and even then, only where it's pretty damn obvious even to a complete newbie who is barely qualified to be maintaining or making any changes to that code what they were thinking when they called it "l" in the first place, such as if it is explicitly being assigned as the length of something such as a string.

        In fact, I can't think of any other remotely valid reason to call a variable "l", and to be perfectly ho

  • I challenge anyone to show me a legitimate instance of WTF in code.

  • ... screw with you statistics. By writing libWTF (Wayland Terminal Framebuffer) ported to various platforms.

  • They forgot SQL! (Score:5, Insightful)

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

    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 apcullen ( 2504324 ) on Wednesday September 25, 2013 @06:35PM (#44954601)
    Given the way the author searched, the title of the article should be "Top 10 worst coded programming languages" or maybe "Top 10 worst Hacked Programming Languages". The article only measures what coders thing of other people's code, not the languages themselves.
  • ...doesn't mean you should shout "fire!" in a crowed theater.

  • by GauteL ( 29207 ) on Thursday September 26, 2013 @08:36AM (#44959097)

    When I have been part of interviewing new hires, I've tended to ask this question: "what do you find frustrating about C++?"

    If you really know C++, there are bound to be at least a few things that you find frustrating. The lack of standardisation on binary interfaces, the continued drive for flexibility at all costs (resulting in a million ways to do one simple thing) and the way they have ALWAYS emphasised pattern clutches over improving the language. Despite (or perhaps because of) the near-complete lack of ABI compatibility between versions, they nearly never remove or depricate anything in the the standard or the STL API, meaning any new "simplification" always comes in addition to the old way, it never replaces it. Sadly this means the standard is never actually simplified, they just add yet another layer of abstraction, which always leaks [joelonsoftware.com]. Lots of the STL and the standard patterns used by C++ developers are really clever and I'm sure they were intensily satisfying to develop. But satisfying cleverness is not necessarily something to build a programming language on.

    The worst part is that the patterns and algorithms which were developed to work around gaps in the core language actually become arguments not to improve the core language. Let's face it; as much as I've used std::for_each, it should never have existed. Instead, range-based for-loops should have been in way before C++11.

    The c++ FQA [yosefk.com] sums up some of my own frustrations.

    That said. There is no other language with such easy access to such a myriad of great libraries out there, especially for science/engineering/visualisation, and for this reason I cannot agree with the FQA's notion that there are no reason to start new projects in C++. By using these libraries, your own code could well become quite elegant and you would shoot yourself in the foot if you decided to avoid C++ on principle for a situation where C++ and its large set of libraries would solve your problem.

Genius is ten percent inspiration and fifty percent capital gains.

Working...