Slashdot Mirror


The Most WTF-y Programming Languages

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."

254 comments

  1. Oblig.... by DougOtto · · Score: 5, Funny

    WTF?

    --
    Solving Unix problems since 1989...
    1. Re:Oblig.... by EdhelDil · · Score: 2
      Another obligatory:

      The WTF metric : http://http//www.osnews.com/images/comics/wtfm.jpg:

    2. Re:Oblig.... by EdhelDil · · Score: 2
      Another obligatory:

      The WTF metric : http://www.osnews.com/images/comics/wtfm.jpg

    3. Re:Oblig.... by OhSoLaMeow · · Score: 1

      WTF?

      Well, that's fine.

      --
      They can take my LifeAlert pendant when they pry it from my cold dead fingers.
    4. Re:Oblig.... by Anonymous Coward · · Score: 0

      Or as I like to spell it "APL" (the most WTF-y language EVER!)

    5. Re:Oblig.... by K.+S.+Kyosuke · · Score: 2

      Or as I like to spell it "APL" (the most WTF-y language EVER!)

      APL? APL is actually a fine language. The actual WTF Award belongs to such languages as BANCStar and the like.

      --
      Ezekiel 23:20
  2. One for one by Anonymous Coward · · Score: 3, Interesting

    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.

    1. Re:One for one by Anonymous Coward · · Score: 5, Insightful

      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"

    2. Re:One for one by Anonymous Coward · · Score: 0

      If that is what you think, you should be a janitor not a programmer.

    3. Re:One for one by dgatwood · · Score: 4, Insightful

      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.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    4. Re:One for one by Nerdfest · · Score: 4, Insightful

      Well, that and the inconsistencies.

    5. Re:One for one by Anonymous Coward · · Score: 1

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

      Well, it's going to be interesting seeing Brian Kernighan issue his first Fatwa. I must say that my personal opinion would be that PHP is basically just C in the same way that faeces is basically just food that's been processed a little. Are you sure you weren't thinking of C++ (sans dollar signs?)

    6. Re:One for one by Aelanna · · Score: 4, Informative

      ...and all of the API methods being in a single, global namespace...

    7. Re:One for one by Mordok-DestroyerOfWo · · Score: 2

      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 you deserve all of the horrible things that will happen to you. There will always be elitism in any field, and sometimes it just feels like PHP is the stinky kid on the playground that always gets bullied.

      I do completely agree that the function list and needle/haystack confusion is unconscionably bad.

      --
      "Never let your sense of morals prevent you from doing what is right" - Salvor Hardin
    8. Re:One for one by Zero__Kelvin · · Score: 3, Insightful

      Or more accurately, everything written in PHP is one big WTF.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    9. Re:One for one by Zero__Kelvin · · Score: 1

      Are they hiring in your department?

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    10. Re:One for one by Anonymous Coward · · Score: 0

      Scala

      Scala people are just crazy. That language is accumulating redundant expressions of multiple programming paradigms simultaneously. They're getting compile times of many minutes for a few thousand lines of code.

      Lua I don't know. C++? Lemme just add another template parameter to my polymorphic SFINAE typename with a constexpr auto lambda closure inside my RAII CRTP. You can create some unbelievable nonsense in C++. Good taste is absolutely essential.

    11. Re:One for one by Anonymous Coward · · Score: 5, Interesting

      There's even a website dedicated to PHP WTFs

      Consider that a language (rather than a programmer) causes a WTF moment when it behaves other than would intuitively be expected according to its own rules of grammar. On that basis alone, PHP wins hands down.

    12. Re:One for one by Anonymous Coward · · Score: 1

      Obligatory http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

    13. Re: One for one by jd2112 · · Score: 4, Funny

      Everything written in PHP looks like it was written on PCP.

      --
      Any insufficiently advanced magic is indistinguishable from technology.
    14. Re:One for one by Anonymous Coward · · Score: 0

      [PHP is] basically just C with dollar signs, classes, and better string and array handling

      ROTFLMAO.

      Either a great troll, or a truly ridiculous thing to believe. There are a number of very critical differences:

      * C offers direct memory management, PHP does not (refcounted garbage collection is mandatory in PHP).
      * C allows direct memory access, thus supporting weak typing, PHP does not (there is no way to change the type of an object once created)
      * C has semantically transparent and simple data types: basic numeric and character data types, and pointers. PHP's data types are non-transparent (sometimes values behave like pointers, but more often than not even complex data types behave like atomic types, causing memory copies to be made when references are assigned), and non-intuitive (arrays are not the same data structure nearly every other language calls an array, but rather a weird-ass attempt at supporting the features of an array on top of a hashtable implementation).
      * PHP is rife with poorly-thought-out language and runtime features (the entire "array" mess as above; treating object variables as values rather than references unless declared otherwise; automatic variable creation without declaration or initialization; session support which in the default implementation enforces one-simultaneous-request-per-client if it is used; support for HTTP cookies that cannot cope with cookies produced by other environments because it enforces the use of a non-standard encoding mechanism) many of which may have been deprecated but were not removed for years after they were known to be dangerous because of huge quantities of code that still depended on them ("magic quotes"; automatic creation of global variables based on externally-supplied [untrusted] data) or which really should be removed but have not yet been (the "mysql" extension), all of which have the combined effect of rendering PHP unsuitable for a novice user working in a field with security risks despite the fact that this is explicitly the type of user it was created for. C, on the other hand, may be dangerous, but that is part of the language design -- it is written to not hold your hand, not to get in your way. It is clear from the very moment you start working with it that it is not a language for novices.
      * C's standard library is small and self-consistent. PHP's is huge, inconsistent, and poorly designed.

    15. Re:One for one by Anonymous Coward · · Score: 1

      PHP is actually a pretty nice language. It's basically just C...

      If C is your benchmark for a "good language" you aren't equipped to evaluate languages for usability.

    16. Re:One for one by Anonymous Coward · · Score: 0

      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.

      First problem there. Who thought of the bright idea to embed a programming language in a document format? While it doesn't really make much of a difference it would have been much more intuitive to have it the other way around. (Same goes for javascript by the way. Embedding a scripting language in a document that it is supposed to modify is a great way to make things.. less elegant.)

      Also PHP have pretty much the same problem as VB. It has a lot of neat built in functions that does what you want plus a little bit extra, so you have to add extra glue around to compensate for PHP doing too much rather than adding together smaller functions to get the desired result.

    17. Re:One for one by Anonymous Coward · · Score: 1

      Scala

      Scala people are just crazy. That language is accumulating redundant expressions of multiple programming paradigms simultaneously. They're getting compile times of many minutes for a few thousand lines of code.

      Lua I don't know. C++? Lemme just add another template parameter to my polymorphic SFINAE typename with a constexpr auto lambda closure inside my RAII CRTP. You can create some unbelievable nonsense in C++. Good taste is absolutely essential.

      Lua is a very nice language for what it is designed to do (embedded scripting and structured data storage).

      It has a nice minimalist design (the table as the universal data structure), can do some nice LISP-ey tricks, while being syntacticly simple.

      That said it's main usecase is game scripting so, I don't doubt that most of the people coding in Lua are not up to writing clean code, and many of the nice features (multiple return values, dynamic typing, functions as first class variables, executing strings as code, etc.) that let a good programmer treat Lua like psuedocode can become sources of aggravation when you have to maintain someone else's code and it looks like this:

      for i, the_thing do
      do_thing(the_thing.run_step, (load_string(myCodeString)()).cleanup(true, 5, "because I said so"));
      end

    18. Re:One for one by segmond · · Score: 1

      Symfony2's code is beautiful.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    19. Re:One for one by laffer1 · · Score: 1

      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.

    20. Re:One for one by segmond · · Score: 1

      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 form. I can program in PHP carelessly and lazily, with C. I proceed cautiously because I don't want to have to fire up the debugger to chase a run away pointer. I won't call PHP a nice language, but nice code can be written in it. I won't call C a nice language because it can be beautiful. The beauty of C for me is the dense/speed, the things I will consider beautiful in C, if you did it in PHP, I would fight you.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    21. Re:One for one by dgatwood · · Score: 1

      A significant percentage of those are leaky abstractions from the underlying C library routines, thus furthering my assertion that PHP is basically C with dollar signs.

      • strpos = strstr
      • mysql_real_escape_string = mysql_real_escape_string

      And so on. Besides, if you haven't ripped out all your escaping code and replaced it with parameterized queries by now, chances are you've been compromised more than once already.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    22. Re:One for one by datavirtue · · Score: 1

      Having just finished a VBA project I now feel that PHP is the VBA of the web. It works, but my god is it a trip to get there.

      --
      I object to power without constructive purpose. --Spock
    23. Re: One for one by datavirtue · · Score: 3, Funny

      Seriously, PHP is the only "language" I can program in while intoxicated. It's actually fun when you have had a few whereas I cannot seem to do anything in other languages when I'm a little tipsy.

      --
      I object to power without constructive purpose. --Spock
    24. Re:One for one by dgatwood · · Score: 1

      Let me restate that. Syntactically, PHP is very, very close to C with dollar signs. The syntax of its class implementation is somewhat different from that of C++, but given that pure C has no notion of classes whatsoever, this cannot reasonably be called a difference between C and PHP except inasmuch as such a syntax exists at all.

      • Direct memory access is precisely why C code has metric f**ktons of serious security holes. Pointers don't exist in PHP for a reason. Pointer manipulation truly has no place in proper code unless you're down in the kernel. For all other code, if you depend on such hackery, you're almost always doing it wrong.
      • PHP's conversion of data types is usually what a reasonable person would expect. C's excess rigor causes lots of headaches for little gain, and much of the gain you do get comes from avoiding security holes that would not exist were it not for the aforementioned stray pointers....
      • IMO, PHP arrays behave pretty sanely compared with the unholiness that is C's array syntax (and if you've ever needed an associative array in C, you'll wish you had a nice tall bridge to jump from). That said, I'm pretty sure I mentioned that difference, so the only thing we disagree on is which style is more programmer friendly.

      • I haven't dealt with PHP objects enough to have a strong opinion on that.
      • Session functionality is not really part of the language itself in any meaningful sense; it's just an optional library, and you can always roll your own session system if it doesn't meet your needs. For that matter, conceptually, the notion of sessions is, by its very nature, so hopelessly broken that where possible, you should try to redesign your code in a way that does not rely on server-side statefulness.
      • I'm not sure what you're talking about with respect to cookies. AFAIK, libcurl works pretty much the same way under C as it does under PHP. Are you talking about some other, broken HTTP client API here? How is that a flaw in the language?
      • Magic quotes and automatic registration of global variables are both unsupported in PHP 5.4 and later. You're complaining about what is, to most people, ancient history.

      I do agree that PHP's standard library is probably too big, and that parts of it are a bit screwy. Then again, I'll see your PHP standard libraries and raise you the C++ STL. :-D

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    25. Re:One for one by dgatwood · · Score: 1

      By removing the rest of that sentence, you completely changed the meaning of what I said. C is a walking disaster, but PHP's non-pointer-based string/array handling removes the sharp edges that make C a walking disaster.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    26. Re:One for one by dgatwood · · Score: 1

      First problem there. Who thought of the bright idea to embed a programming language in a document format?

      It works really well for generating certain types of web pages, such as forms, tables, etc.

      While it doesn't really make much of a difference it would have been much more intuitive to have it the other way around.

      You mean like PHP's heredoc syntax?

      echo <<<EOT
      <p>Blah blah blah</p>
      EOT;

      Also PHP have pretty much the same problem as VB. It has a lot of neat built in functions that does what you want plus a little bit extra, so you have to add extra glue around to compensate for PHP doing too much rather than adding together smaller functions to get the desired result.

      When PHP is doing too much, at least on UNIX/Linux, you can typically call the POSIX functions from your PHP code instead.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    27. Re:One for one by Anonymous Coward · · Score: 0

      C++ makes great sense to me. If you were going to say anything about C++ is its flexibility is hard to comprehend, and garbage collection requires discipline. No one has written a C++ program that uses all its power.

    28. Re:One for one by Darth+Snowshoe · · Score: 1

      APL should get the top honors - but they hadn't invented the expression WTF what that was still in use.

    29. Re:One for one by MouseTheLuckyDog · · Score: 1

      Or github.

    30. Re:One for one by Anonymous Coward · · Score: 1

      A significant percentage of those are leaky abstractions from the underlying C library routines, thus furthering my assertion that PHP is basically C with dollar signs.

      • strpos = strstr
      • mysql_real_escape_string = mysql_real_escape_string

      And so on. Besides, if you haven't ripped out all your escaping code and replaced it with parameterized queries by now, chances are you've been compromised more than once already.

      A leaky abstraction is a serious indicator that a designer hasn't properly thought things through. That pretty much sums up PHP's design. It superficially has the niceties of a high level language but they fail because they are only a thin wrapper over C.

      Where PHP innovates over C it makes things worse. A C compiler generally doesn't provide you with things that you haven't asked for. PHP trips over itself providing you with things you haven't asked for.

    31. Re:One for one by DMUTPeregrine · · Score: 3, Insightful

      Naw, PHP causes a WTF when it behaves as one would intuitively expect it to, according to its own rules of grammar.

      --
      Not a sentence!
    32. Re: One for one by Laxori666 · · Score: 1

      Once while drunk I made a python program which displayed a window with the text "I am drunk" smoothly rotating and bouncing around in it

    33. Re:One for one by Anonymous Coward · · Score: 0

      Direct memory access is precisely why C code has metric f**ktons of serious security holes. Pointers don't exist in PHP for a reason. Pointer manipulation truly has no place in proper code unless you're down in the kernel. For all other code, if you depend on such hackery, you're almost always doing it wrong.

      Don't get me wrong. I'm not saying that PHP should implement pointers the way C does. What I am saying is that its handling of references leaves a lot to be desired.


      function test ($data)
      {
            $data[2] = 3;
      }
      $a = array (1, 2, 3);
      test ($a);
      echo $a[2];

      What's the result? In a sane implementation it's 3, but it isn't, it's 2. Now try:

      class Test
      {
      }

      function test ($data)
      {
          $data->value = 3;
      }

      $a = new Test;
      $a->value = 2;
      test($a);
      echo $a->value;

      In this case, the result is 3, as expected.

      PHP's conversion of data types is usually what a reasonable person would expect.

      Not really, no. Quick: what's the result (including type) of the following expressions?

      ("1" + 3) / 2
      ("1 hello" + 3) / 2
      ("1.0" + 3) / 2
      ("1e1" + 3) / 2
      (1 + "3") / 2
      ("1" + "3") / 2

      Now, what's the resulting type of $_GET["input"] + 0?

      I'm not sure what you're talking about with respect to cookies. AFAIK, libcurl works pretty much the same way under C as it does under PHP. Are you talking about some other, broken HTTP client API here?

      No, I'm talking about the HTTP server integration API, i.e. the $_COOKIE variable. The keys and values stored in this array are taken from the HTTP cookie, but are url-decoded before they're stored in the variable, which is not specified by the HTTP standard, and means that if another environment sets a cookie with, say, a '+' in its value, you cannot easily read it as it was originally set. This is a problem as many systems use Base64-encoded cookie values, which get corrupted by this process.

    34. Re:One for one by Anonymous Coward · · Score: 0

      It doesn't even have the Eval that vbscript has. Fortunately one can use Application.Evaluate
      Someone posted about it here

    35. Re:One for one by Phroggy · · Score: 4, Informative

      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

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

      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.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    36. Re:One for one by Anonymous Coward · · Score: 0

      No, they just aren't intelligent enough to use git.

    37. Re:One for one by Anonymous Coward · · Score: 0

      Yup, it's a troll.

    38. Re: One for one by GNious · · Score: 1

      Tests show that programming in C++ while ingesting not-insignificant quantities of whiskey, works fine
      (disclaimer: next day, could not determine WHY the code worked as it should)

    39. Re:One for one by Xest · · Score: 1

      "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."

      It's all relative, that's the problem. If you're viewing PHP as someone who doesn't code, hasn't worked with any/many other languages, or only writes small hackish programs rather than say larger scale applications then you're going to view it as okay, because it's still probably better than what you had before which may have simply been nothing.

      But if you've had a reasonable amount of experience developing large applications in say Java, C#, C++ or the sort then coming to PHP you're going to quickly recognise severe deficiencies with it and find it makes things more awkward than they need be.

      I worked on an 18 month PHP project and whilst all of us had the competence to understand the pitfalls of the language and end up producing something on time, under budget and of good quality the fact remains that if we had instead used C# or Java we could've developed it even quicker and to an even higher degree of quality.

      I'll be honest, in part this is because PHP was the wrong tool for the job IMO (I unfortunately only took over as lead dev after the project was started and the damage was done), I think dynamically typed languages are inherently bad for large projects for the simple fact that compiled, statically typed languages catch more errors at compile time and hence create an inherently better level of software quality from the outset. The fact is that whilst PHP and interpreted languages in general let you get off the ground quicker, they also leave you spending way more time debugging, and trying to reproduce hard to reproduce errors such that the net effect is a loss in overall development time relative to the size of the project. The fact PHP has so many quirks exacerbates this problem.

      I'm not necessarily saying this applies to you, but for the most part, people who think PHP is good only think so simply because they've never had the pleasure of working with anything better, and that's the problem. The vast majority of PHP developers defend the language simply because they don't realise how much better things can actually be. If you're equally skilled in C#, Java, and PHP, you'll always have a way easier time developing a decent sized project in the first two than you will in PHP.

      Which is why the criticism of PHP - yes you can get stuff done with it, but you can get stuff done better in alternative languages and that's PHP's problem- apart from being widespread it simply does everything other languages do but not as well. I don't think there's a single area of software development now where you couldn't find something to do what PHP does but better.

    40. Re:One for one by Anonymous Coward · · Score: 0

      I have to code in PHP, and if every time I thought WTF was documented in the code's comments, there would be no room for actual statements.

    41. Re:One for one by Anonymous Coward · · Score: 0

      Lua is there because it's used for lots of World of Warcraft-related modding. The file extension for those mods is "wtf" (Warcraft Text File).

      It's actually a very nice language, not wtf-y in the latest.

    42. Re:One for one by Anonymous Coward · · Score: 0

      Well, that and the implementations, for the lack of unicode support, for example. Since web programming is basically about outputting text, one might wonder how this even worked so far.
      Well, that and the idea of having warning suppressors and having two types of exceptions.
      Well, that and the standard libraries and functions.

      The set of features is OK for a programming language.

    43. Re:One for one by Anonymous Coward · · Score: 0

      PHP retains all/b. the goodness that makes C great!

    44. Re:One for one by snemarch · · Score: 1

      Naw, PHP causes a WTF when it behaves as one would intuitively expect it to, according to its own rules of grammar.

      PHP has actual rules of grammar? I thought it was one big kludge :)

      --
      Coffee-driven development.
    45. Re:One for one by Gibgezr · · Score: 1

      >No one has written a C++ program that uses all its power.

      And no one should; it will usually lead to totally unreadable ( and often inefficient) code if you attempt it.

    46. Re:One for one by Phroggy · · Score: 1

      And here's an even better article about specifically what makes PHP so awful: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    47. Re:One for one by dgatwood · · Score: 1

      A leaky abstraction is a serious indicator that a designer hasn't properly thought things through.

      Or that the designer wants the language to be C-like. Providing a near-exact clone of the C API in another language isn't necessarily a bad thing if you think that a significant percentage of your programmers are going to be writing code in both languages.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    48. Re:One for one by dgatwood · · Score: 1

      Not really, no. Quick: what's the result (including type) of the following expressions?

      The strings are coerced into numbers just as they should be. The only one that's even slightly questionable is "1 hello", which you might reasonably argue should have thrown an exception. That said, the behavior is basically the same as C's atoi and atol functions, so if you consider it unreasonable, you're also considering C's string to integer conversion unreasonable. The only thing significantly different about PHP is that it does this implicitly, but IMO that makes perfect sense in a dynamically typed language.

      Now I will admit that if you are used to JavaScript, the notion of having separate addition and string concatenation operations takes some getting used to, but having that strict operator separation can prevent lots of security bugs caused by failure to properly sanitize input—particularly important when you're working with programmers who lack experience in code security.

      This is a problem as many systems use Base64-encoded cookie values, which get corrupted by this process.

      The original cookie spec suggests that the value in a cookie should be URL-encoded. If you URL-encode a Base64 string when setting the cookie, then PHP's behavior gives you exactly what you want—the Base64 blob. The PHP cookie creation functions do this for you. If you're generating cookies with JavaScript, use encodeURIComponent.

      Also, if you need the raw cookie values in some other form, you can always split $_SERVER['HTTP_COOKIE_VARS'] yourself. AFAIK, that contains the raw data.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    49. Re:One for one by Anonymous Coward · · Score: 0

      There's even a website dedicated to PHP WTFs

      Consider that a language (rather than a programmer) causes a WTF moment when it behaves other than would intuitively be expected according to its own rules of grammar. On that basis alone, PHP wins hands down.

      Not the best PHP WTF site. Try PHP Sadness or A Fractal of Bad Design or even CodingHorror. In the interests of balance: A Fractal of Bad Design: A Rebuttal

    50. Re: One for one by avandesande · · Score: 1

      Kind of like the saying about drunks being the only ones steady on rough seas...

      --
      love is just extroverted narcissism
    51. Re: One for one by hermitdev · · Score: 1

      I've performed independent tests and can confirm the results. Also held for C#, Python & Verilog.

  3. Hmm. by Anonymous Coward · · Score: 0

    How is making a variable called WTF better than adding WTF to a comment? To me it means even the original writer didn't know WTF he was doing. For some reason Objective C apparently uses it a lot as a variable name.

    1. Re:Hmm. by Anonymous Coward · · Score: 0

      Or more likely, (occams razor and all) if you can't find "wtf" in the comments of Objective C, maybe people writing Objective C code don't use comments (as much?)

  4. I guess they do not have much LISP code? by Fallen+Kell · · Score: 1

    Just wondering...

    --
    We were all warned a long time ago that MS products sucked, remember the Magic 8 Ball said, "Outlook not so good"
    1. Re:I guess they do not have much LISP code? by Darinbob · · Score: 3, Funny

      (W (T (F)))

    2. Re:I guess they do not have much LISP code? by segmond · · Score: 2

      People get forced to write in C++ or Java, people are rarely forced to write lisp, so when they write lisp codes, they enjoy it hence rarely do you hear WTF and oh, everyone rolls out their own library.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    3. Re:I guess they do not have much LISP code? by pjabardo · · Score: 1

      (setf what-the-fuck nil) ; Creating what-the-fuck variable

  5. Visual Basic by BenSchuarmer · · Score: 4, Insightful

    I'm not sure whether it's the language, or the people who choose to use it.

    1. Re:Visual Basic by Anonymous Coward · · Score: 2, Funny

      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

    2. Re:Visual Basic by Godwin+O'Hitler · · Score: 1

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

      --
      No, your children are not the special ones. Nor are your pets.
    3. Re:Visual Basic by garyebickford · · Score: 2

      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 with GOTOs that literally moved you from one 'room' to another, with a global data structure that maintained your state. Every room was just a code segment in the loop including all of the data about the room, with various GOTOs to take you elsewhere. There were no subroutines. A coworker of mine at the time spent a while reimplementing it to use subroutines for rooms and travel, and a simple database to define the rooms, which allowed a lot more flexibility to create new rooms etc. He got it working but I don't know if any instances of that version survived or propagated elsewhere.

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
    4. Re:Visual Basic by datavirtue · · Score: 0

      My god, I think I was 12 when I was hammering out code like that and it wasn't even near that bad. If this is actual production code then the person who wrote it lacked any kind of logical sense.....much less software development skills.

      --
      I object to power without constructive purpose. --Spock
    5. Re:Visual Basic by Anonymous Coward · · Score: 0

      My programming in VB is a little rusty, but isn't that the equivalent to:

      Select Case x
      Case 1
      bblah blah
      Case 2
      blah blah
      End Select

    6. Re:Visual Basic by Anonymous Coward · · Score: 0

      VB. Lua is the new VB.

      All of those are horrible.

    7. Re:Visual Basic by Gazzonyx · · Score: 1

      I'm not sure whether it's the language, or the people who choose to use it.

      Yes.

      --

      If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.

    8. Re:Visual Basic by JakartaDean · · Score: 1

      I remember playing this in 1985, although the code was much older than that, on a PDP-8. I wonder if the code was structured that way to allow blocks of it to be read in from tape, as it wouldn't have been wise to assume a hard drive on some of those architectures.

      --
      The subject who is truly loyal to the Chief Magistrate will neither advise nor submit to arbitrary measures (Junius)
    9. Re:Visual Basic by Blaskowicz · · Score: 1

      This looks like someone thought it was a nicer variant of :
      IF ERRORLEVEL == 9 goto line9:
      IF ERRORLEVEL == 8 goto line8:
      ...
      IF ERRORLEVEL == 2 goto line2:

      line1:
      do stuff
      goto line9:
      line2:
      blah blah
      goto 9:
      ...
      9:

    10. Re:Visual Basic by cyclomedia · · Score: 1

      I grew up in C, C++, Java and - for £income purposes - trained up in c# .Net ... but 5 years ago I moved into a vb.net shop and you know what, I actually quite like it now, the feature set is 99.99% on parity with C# and i actually LIKE that it's in english, in C# we have obscure words like virtual & abstract while the VB equivalents are overridable & mustinherit .

      I think part of the hate against VB (shocking pre .net days aside) is snobbery from people who consider themselves "proper" programmers who think that if the code is too to understand they'll loose their hard earned super-clever status

      it's like programming languages are deliberately designed to use obscure terms, syntax, symbols and squiggly characters for no reason other than to obfuscate it from puny humans

      --
      If you don't risk failure you don't risk success.
    11. Re:Visual Basic by Hognoxious · · Score: 1

      Tape? Luxury!

      Stacks of cards, more like.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    12. Re:Visual Basic by garyebickford · · Score: 1

      Indeed. My first computer job was running an IBM 1130 clone. It had a one MB 14 inch hard drive, plus a 5MB Winchester 'washing machine' - removable cartridges contained 5MB on five platters, and the head arm was driven by a 5 Horsepower stepping motor. The thing walked across the floor when certain jobs were run. One amusing program (on cards, as you note) was an assembler program that played music. This worked by sending certain bitpattern signals to the Winchester drive, and the EMI on the channel was strong enough that you could put an AM radio (one of those early one-transister types) on top of the console, and it would play 'Jingle Bells' or whatever. There was even a data deck of cards to play different songs.

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
  6. Why would seeing 'WTF' implicate the language... by Assmasher · · Score: 5, Insightful

    ...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.

    --
    Loading...
  7. WTF by Anonymous Coward · · Score: 0

    WTF

  8. WTF!?!?!? by OzPeter · · Score: 1

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

    --
    I am Slashdot. Are you Slashdot as well?
    1. Re:WTF!?!?!? by Anonymous Coward · · Score: 0

      This could indicate only the precentage of newbies/bad programmers working in each language, thus making c++ the most popular of them all. A skilled programmer has no reason whatsoever to leave a 'wtf' string behind. 'Cause that would be lame. Thus this statistics could also indicate the probability of project teams falling apart because of incompetence and bad manners.

  9. Bad statistics are bad by Anon,+Not+Coward+D · · Score: 4, Insightful

    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

    --
    Sometimes it's better not having signature
    1. Re:Bad statistics are bad by kyle3489 · · Score: 5, Informative

      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.

    2. Re:Bad statistics are bad by Anonymous Coward · · Score: 0

      When I briefly tried my hand at iPhone development a few years back, I began referring to the mix of C, C++ and ObjC as WTF++.

      With that, I think we have a definitive winner by any measure!

    3. Re:Bad statistics are bad by dkf · · Score: 1

      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.

      The number of WTFs per project isn't a good metric to have a high score in, you know.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  10. LICENSE.txt by TeknoHog · · Score: 5, Funny

    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.

    --
    Escher was the first MC and Giger invented the HR department.
    1. Re:LICENSE.txt by Anonymous Coward · · Score: 1

      First off, I like that license and support it halfheartedly.

      Secondly, I was expecting a story about Turing Tarpits, but instead it's some lazy greping of random OSS sources.

      Thirdly, I read that license in the voice of the angry raid-leader from that old Onyxia wipe animation/audio.

    2. Re:LICENSE.txt by Anonymous Coward · · Score: 0

      Looks like most licenses on aminet except that there usually is a "1. If I ever visit you hometown you have to buy me a beer." or "1. Send me a cookie if you can find my address." or "1. If you like this program, shake hands with the third stranger you meet after reading this message."

    3. Re:LICENSE.txt by DJCouchyCouch · · Score: 1

      But is it compatible with the GPL?

    4. Re:LICENSE.txt by Anonymous Coward · · Score: 0

      Hopefully version 3 will remove the constraint of having to change the name. Having to change the name directly conflicts with DOING WHATEVER THE FUCK I WANT.

    5. Re:LICENSE.txt by DMUTPeregrine · · Score: 1

      Yes. You do what the fuck you want to. If that means relicensing it as GPL, well, that's what the fuck you wanted to do.

      --
      Not a sentence!
  11. What's wrong with Lua? by Florian+Weimer · · Score: 1

    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.

    1. Re:What's wrong with Lua? by segmond · · Score: 1

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

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    2. Re:What's wrong with Lua? by Anonymous Coward · · Score: 0

      I'm shocked as well, I would have expected something like PHP being considerably higher than something like Lua, PHP is a nightmare.

      Mind you, anyone that uses PHP likely uses pre-made libraries DUE to that fact after giving up on what a horrible language it is with its inconsistencies everywhere.
      Never touching that language unless it is a matter of life or death.
      I even gave up paid work because PHP is that bad. Paid work that could have led to regular projects being handed to me (freelance if you never caught that) and I gave up on it.

      'WTF were the devs thinking?', there is a WTF for you.
      I'd sooner make an interpreter out of Malbolge for websites than use PHP again.

    3. Re:What's wrong with Lua? by ArcadeMan · · Score: 1

      If you think PHP is bad, go check the parsing order of ExpressionEngine.

    4. Re:What's wrong with Lua? by Anonymous Coward · · Score: 2, Informative

      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.

    5. Re:What's wrong with Lua? by Anonymous Coward · · Score: 0

      Templating languages written in templating languages are a whole other dimension of WTF unto themselves.

    6. Re:What's wrong with Lua? by ArcadeMan · · Score: 1

      That's not the worst part of it, their insane parsing order means that templates are a nightmare to understand. Throwing sequential parsing logic out the window and following that guide is the only way to understand what's going on.

    7. Re:What's wrong with Lua? by Anonymous Coward · · Score: 0

      Is there any indication why Lua scores so highly here?

      My guess is because of its primary use case, which is embedding extension points to an existing application. This means that most people using it are more interested in the application they want to extend than the language itself, and hence most authors of Lua code are probably complete novices with the language.

    8. Re:What's wrong with Lua? by lgw · · Score: 2

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

      --
      Socialism: a lie told by totalitarians and believed by fools.
    9. Re:What's wrong with Lua? by Darinbob · · Score: 1

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

    10. Re:What's wrong with Lua? by segmond · · Score: 1

      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.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    11. Re:What's wrong with Lua? by lgw · · Score: 1

      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!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    12. Re:What's wrong with Lua? by tibman · · Score: 1

      Sounds like your bias got in the way of developing. I write C# for money. Complaining is fine but you should not only do the work but become great at it. I'd rather write PHP than C#, fyi : )

      --
      http://soylentnews.org/~tibman
    13. Re:What's wrong with Lua? by Rockoon · · Score: 1

      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.

      --
      "His name was James Damore."
    14. Re:What's wrong with Lua? by Anonymous Coward · · Score: 0

      Main problem with Lua is that people that shouldn't be programing program in it. Its the new VB.

      Its been my experience that if someone uses Lua, one can automatically deduct 50 points from their IQ.

    15. Re:What's wrong with Lua? by Florian+Weimer · · Score: 1

      Bingo. I agree that's the most likely explanation.

    16. Re:What's wrong with Lua? by 91degrees · · Score: 1

      Lua is a scripting language. It's not meant for full application development.

    17. Re:What's wrong with Lua? by Anonymous Coward · · Score: 0

      Lua is used massively for writing World of Warcraft modifications. The file extensions for these mods is "wtf" (Warcraft Text File). That's why.

    18. Re:What's wrong with Lua? by ockegheim · · Score: 1

      Yes, I was surprised, because Lua is the only programming language my brain has taken kindly to. Of course, it could just be my brain, but is more likely to the WoW’s WTF folder, as mentioned elsewhere.

      --
      I’m old enough to remember 16K of memory being described as “whopping”
    19. Re:What's wrong with Lua? by lgw · · Score: 1

      Heh, that was a platform with no C compiler (at least, that we had access to), if you can believe it (IBM S/370 mainframe), but the assembly language wasn't bad to code for, really. The problem was that compiler-generated assembly is just a mess, as you might expect.

      I've been quite satisfied with modern C/C++ compilers' optimization - I don't even attempt hand-coded assembly any more, instead I find the C code that gives me the assembly I want under full optimization (and for Intel they're scary good - things like turning x * 8 into 3 x+=x equivalents distributed carefully though then next 20 instructions because the parts of the processor that would do a shift left were still busy from some previous step, or future step.)

      --
      Socialism: a lie told by totalitarians and believed by fools.
  12. Legacy Code by Anonymous Coward · · Score: 1

    Whenever I start on a maintenance project, the first thing I do is grep the codebase for profanity. It always gives me an idea of how painful the job will be.

  13. template it by Anonymous Coward · · Score: 0

    I have a customized WTF comment template i really like.

  14. That's easy. by gallondr00nk · · Score: 5, Informative

    Brainfuck. Look it up, I can't even give a code example as it pisses off /.'s filter.

    1. Re:That's easy. by Anonymous Coward · · Score: 0

      You comment reads a byte from the console and prints out, twice.
      My post is better, it reads and writes the first byte, skips the second and prints the third.

    2. Re:That's easy. by Anonymous Coward · · Score: 0

      Meh, brainfuck's not so messed up. It's pretty much about as basic of a turing machine as you can get with a few extra niceties (a true turing machine would have 3 (increment, advance pointer, and jump), instead of brainfuck's 8 ops). Anyone who has done advanced computational theory will have at least been a bit familiar with writing code on that low of a level. In that sense, it's not really worth a WTF, as it does have some real world value, albeit not anywhere near production code, but just academically.

      A real WTF language would be something like Malbolge. Brainfuck isn't even in the same league when it comes to that.

    3. Re: That's easy. by Anonymous Coward · · Score: 0

      I was about to say that too. Honestly, no idea how people have written anything in that god forsaken language. Imagine someone reading your source code on github.

    4. Re: That's easy. by DMUTPeregrine · · Score: 1

      As one of the crazy bastards who's written things in it (even wrote an IDE for it with a friend) it's not really that hard. It just breaks things down into very small steps, so you have to develop your standard routines one at a time from the ground up.
      eg
      addition of the byte at array location n to array location n+1, storing the result in location n+1.
      [->+<]
      Multiplication is repeated addition. Exponentiation is repeated multiplication. Etc, etc. Exponentiation takes a pretty good sized chunk of code.

      --
      Not a sentence!
    5. Re:That's easy. by Tablizer · · Score: 1

      But WTF in Brainfuck is redundant, so why bother. Instead comments would look more like, "I actually figured this out!" (IAFTO)

  15. python by Anonymous Coward · · Score: 0

    Python would be my biggest WTF.

  16. My WTF by EmperorOfCanada · · Score: 3, Interesting

    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++?"

    1. Re:My WTF by laejoh · · Score: 1
      I don't object to people posting cobol to Github. I only object to those who insist on line numbering their cobol source in the first 6 positions. The following is evil:

      000010 identification division.
      000020 program-id. hello.
      000030 environment division.
      000040 data division.
      000050 working-storage section.
      000060 procedure division.
      000070 hello-00.
      000080 display "hello world".
      000090 stop run.

      This isn't:

      identification division.
      program-id. hello.
      environment division.
      data division.
      working-storage section.
      procedure division.
      hello-00.
      display "hello world".
      stop run.

  17. WTF per repository? by Anonymous Coward · · Score: 0

    And not WTF per line of code? Seriously?

    1. Re:WTF per repository? by Anonymous Coward · · Score: 0

      seriously. WTF, right? *per repository* doesn't really give any insight.

  18. WTF by ArcadeMan · · Score: 3, Funny

    Watchdog Timer Fault.

  19. Re:Why would seeing 'WTF' implicate the language.. by ericloewe · · Score: 1

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

    Reading IOCCC entries illustrates this perfectly.

  20. Objective-C by Ukab+the+Great · · Score: 4, Funny

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

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

    1. Re:Objective-C by Delirium+Tremens · · Score: 2

      Now that's why I need a Cinema Display so that it can all fit on one line.

    2. Re:Objective-C by Anonymous Coward · · Score: 0

      Wanted to try it out but Xcode crashed on me :(

    3. Re:Objective-C by Anonymous Coward · · Score: 0

      retain

    4. Re:Objective-C by GrahamCox · · Score: 1

      Well done sir, a beautiful example of how Obj-C is extremely self-documenting when well-written.

  21. Oh good grief. by Anonymous Coward · · Score: 2, Informative

    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 computer scientist KNOWS that languages are just syntax and anyone worth their salt can implement their algorithm in ANY language.

    Morons.

    1. Re:Oh good grief. by beelsebob · · Score: 5, Insightful

      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.

    2. Re:Oh good grief. by larry+bagina · · Score: 2, Insightful

      Yeah, and sex is just sticking your dick in a hole. Some of us care about which hole it is.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Oh good grief. by Mitchell314 · · Score: 2

      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. Not everybody who codes is a software developer. For example, I personally am in the life sciences (biology/math double major), and only have studied programming/databases as a past-time interest. I, like many other of my science-oriented peers, are going to lag in computer skill development behind those who study and work full time as a programmer. In fact, many of the Daily WTFs I love to read pale in comparison to what I've seen from science coders (I'm a horrible, horrible culprit :) ). Not that there's anything wrong with that, we focus most our energy on our bread and butter, and coding is only a partially used tool that just helps in accomplishing our goals.

      --
      I read TFA and all I got was this lousy cookie
    4. Re:Oh good grief. by Anonymous Coward · · Score: 0

      A computer scientist KNOWS that languages are just syntax and anyone worth their salt can implement their algorithm in ANY language.

      Morons.

      I guess you are forgetting this nice little thing called programming models and paradigms. But yeah, you can keep on thinking that it's all just syntax.

      Obligatory: moron.

    5. Re:Oh good grief. by Anonymous Coward · · Score: 0

      Once you separate the language and the compiler there is not much left to most languages than the syntax.
      Very few languages enforce paradigms and models. If you want to code object oriented assembly language or procedural java you are free to do so.

      I guess that is part of the problem. The less strict the language is the easier it is to write code of unexpected readability.

    6. Re:Oh good grief. by ShanghaiBill · · Score: 4, Funny

      Languages are irrelevant.

      01010111 01010010 01001111 01001110 01000111 00100001

    7. Re: Oh good grief. by Anonymous Coward · · Score: 0

      or, use C and simply run one source code on all platforms (iOS,Android,OSX,Win32/64,Linux..)

    8. Re:Oh good grief. by datavirtue · · Score: 1

      OK....but what about the platform and tools which make those languages livable....or enjoyable to build solutions with?

      --
      I object to power without constructive purpose. --Spock
    9. Re:Oh good grief. by Anonymous Coward · · Score: 5, Funny

      and even WHOSE

    10. Re:Oh good grief. by Anonymous Coward · · Score: 0

      what of the guilty pleasure of trying to stick it in the wrong hole?

    11. Re:Oh good grief. by TapeCutter · · Score: 1

      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.

      C++ is a common entry point into programming for serious students. LUA is a relatively simple scripting language which cannot 'implement any algorithm' because (last time I looked) it's not a general programming language, it is however a popular video game interface which introduces a lot of young people to game programming. The languages that professional developers traditionally consider more difficult to learn properly are at the bottom of the list, namely C, Ruby, and Pearl.

      At the end of the day, professional developers learn syntax to practice programming, somewhat like a doctor learns anatomy to practice medicine. The difference being that anatomy doesn't change much over time. ;)

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    12. Re:Oh good grief. by Alomex · · Score: 1

      Actually once you remove the compiler (which commonly contains the parser as well ) all is left is ASCII, your point being?

    13. Re:Oh good grief. by ATMAvatar · · Score: 0

      Some languages are akin to using the hole in a beehive.

      --
      "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
    14. Re:Oh good grief. by VGPowerlord · · Score: 1

      Languages are just Syntax - get over it.

      Except in PHP where certain functions change their behavior depending on what values are set in an .ini file.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    15. Re: Oh good grief. by hedley · · Score: 1

      It can go wrong sometimes. That said, don't knock hive till you've tried it.

      http://www.ibtimes.co.uk/articles/467900/20130515/man-sweden-dies-sex-hornet-s-nest.htm

      H.

    16. Re:Oh good grief. by DMUTPeregrine · · Score: 1

      LUA is certainly capable of implementing any algorithm. It's a Turing-complete language.

      That doesn't mean it's EASY, of course, but it's certainly easier than doing it in unlambda.

      --
      Not a sentence!
    17. Re:Oh good grief. by freddy.grande · · Score: 2

      Just whose. Not really which.

    18. Re:Oh good grief. by aztracker1 · · Score: 1

      node.js + npm is the first platform I really like.. and even then, I do get why some either don't care for or are afraid of JS. I've worked with great tools for PHP, it doesn't make the language any better, and the abstractions are heavy and slow. C# can be really nice but dealing with a scripted environment which winds up being faster than a build/compile step, I'm inclined to leave it behind, along with assembly/dll hell.

      --
      Michael J. Ryan - tracker1.info
    19. Re:Oh good grief. by Xest · · Score: 4, Insightful

      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.

    20. Re:Oh good grief. by TheRaven64 · · Score: 1
      And what's the difference between that and

      FOR i = 0 TO 9
      PRINT i

      Or

      0 to: 9 do: [ :x | Transcript show: x ]

      That's right, the difference is syntax and you've picked a terrible example. A better example would be method invocation. The differences between calling a C function pointer, a C++ virtual function, a Java method or an Objective-C method are significant.

      --
      I am TheRaven on Soylent News
    21. Re: Oh good grief. by Anonymous Coward · · Score: 0

      Death by zu-zu?

    22. Re:Oh good grief. by Anonymous Coward · · Score: 0

      That's right. However, to say, the syntax is not important is shockingly dumb. As programming languages are just the programmers textual user interface, syntax matters a lot.

      Seriously, inventors of PLs often seem to have a pretty small horizont.
      I mean, it may be a bit much to ask for studying, ergonomics, economics, psychology, advanced garbage collection or methods of good manual memory management, advanced IDE design, text encodings, vm design, advanced compiler design, parallel stuff, etc.
      But please...

    23. Re:Oh good grief. by h3st · · Score: 1

      That's a function of which hole, though. I'd say one car's exhaust pipe is not the same as another car's exhaust pipe, even if they're the same model and everything.

      --
      hei katter
    24. Re:Oh good grief. by Alomex · · Score: 1

      Woosh.

      I used that example to show that a language is syntax and semantics. I could easily define SlashdotFortran in which


      FOR i = 0 TO 9
      PRINT i

      reformats the hard drive. And what would be the difference between my SlashdotFortran example and yours? Semantics.

    25. Re:Oh good grief. by slash.jit · · Score: 1

      01010111 01010100 01000110 ?

    26. Re:Oh good grief. by Anonymous Coward · · Score: 0

      01010111 01010010 01001111 01001110 01000111 00100001

      01010111 57 W
      01010010 52 R
      01001111 4F O
      01001110 4E N
      01000111 47 G
      00100001 21 !

      I am glad this ended up being a real string, I would've been dissapointed.

    27. Re:Oh good grief. by Anonymous Coward · · Score: 0

      Ok, what's a quicksort in brainfuck? You could do it, but versus the time it would take in C or python, why would you want.

    28. Re:Oh good grief. by hazah · · Score: 1

      For a real brain teaser, I recommend comparing and contrasting the type system adopted from Simula (C++, Java, PHP, etc) with OOP type concepts from languages stemming from Smalltalk like Ruby, where classes are themselves runtime objects, to the type system of Haskell.

    29. Re:Oh good grief. by oldCoder · · Score: 1

      Syntax is important. Can't communicate without it.
      Languages usually imply runtimes, which have important semantics, slowdowns, conventions, environments.

      Try to code in whitespace sometime...

      --

      I18N == Intergalacticization
  22. Re:Why would seeing 'WTF' implicate the language.. by Anonymous Coward · · Score: 0

    More like 'WTF was I thinking when I wrote this?"

    And then one day I started working on a mobile application regulated by the FDA as a medical device and realized that I'd better start making smarter comments.

    Turns out the better you comment your code as you go, there are less or no WTF's in the final commits.

    Of course then there is JavaScript where WTF returned as undefined so who knows.

  23. Statistics, the mother of all lies... by paavo512 · · Score: 5, Insightful

    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.

    1. Re:Statistics, the mother of all lies... by Ukab+the+Great · · Score: 1

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

    2. Re:Statistics, the mother of all lies... by Anonymous Coward · · Score: 0

      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.

      I was about to post that, but will give you mod points instead -- the article is just plain stupid because it could easily be showing the spread of language preferences in GitHub, we just don't know. WTFs per LOC by language would be the only accurate way to do what it purports to do.

    3. Re:Statistics, the mother of all lies... by Anubis+IV · · Score: 1

      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.

    4. Re:Statistics, the mother of all lies... by Anonymous Coward · · Score: 0

      According to TFA, he "calculated the average number of WTF commit comments per repository". So why not per line of code or whatever?

      As stated in TFA, it was all done for shits and giggles so whining about methodology is rather pointless.

  24. C++ by harvestsun · · Score: 2, Informative

    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.

    1. Re:C++ by geek · · Score: 5, Insightful

      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.

    2. Re:C++ by Azure+Flash · · Score: 1

      I'm sure we all know by now, from this single but very reputable and totally 100% serious source, that Stroustrup designed C++ to be practically impossible to master so that projects would be bigger and C++ programmers would be worth more ;)

    3. Re:C++ by harvestsun · · Score: 2

      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.

    4. Re:C++ by Anonymous Coward · · Score: 0

      Then why the bitching of c++!

    5. Re:C++ by Dodgy+G33za · · Score: 3, Insightful

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

    6. Re:C++ by gatkinso · · Score: 2

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

      Fixed that for you.

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

      --
      I am very small, utmostly microscopic.
    7. Re:C++ by Anonymous Coward · · Score: 0

      the problem is so many people still think c++ = c with classes. And if you think that, you're already wrong.

    8. Re:C++ by jma05 · · Score: 4, Insightful

      > 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.

    9. Re:C++ by Anonymous Coward · · Score: 0

      You know that Slashdot is full of idiots when a comment like this gets marked as a troll by someone.

    10. Re:C++ by Anonymous Coward · · Score: 0

      So, since it is not intuitive to you, it's not intuitive to anyone? *I* find C++ very simple and intuitive. *I* find programming in C++ a joy.

    11. Re:C++ by Dixie_Flatline · · Score: 1

      Right, and I'm currently working on a project where someone thought that template heavy code and functors everywhere without comments are the solution to everything.

      The problem with C++ is that NOBODY knows how to use it. It doesn't straddle the line between functionality and readability very well, and programmers have somehow increasingly been skipping the part of their education that relates to commenting their damn code so the next poor bastard that comes along doesn't have to decipher everything from scratch.

      A friend of mine (who now has a PhD in robotics and last I heard was working on autonomous vehicles) once said, "The philosophy of C++ is that you don't pay for anything that you don't use. The result is a language where there's nothing worth paying for." There are few times where the extra features of C++ don't come at a cost that's HIGHER than the benefit that they give, either syntactically or even in terms of performance.

      Here's a page that runs down some of the most egregious problems with C++. It's broken by design. http://yosefk.com/c++fqa/defective.html

    12. Re:C++ by jma05 · · Score: 1

      It is irrelevant whether it is intuitive to you or me. The only thing that matters is whether it is intuitive to a preponderance of programmers.
      Every programming language has its fans. By your logic, that means every programming language is intuitive because someone, somewhere finds it a joy.
      It is a relative term. Which mainstream programming languages do you feel are less intuitive than C++? And why?
      A good part of C++11 standard was to make it more consistent and easier to use. Is C++ the only language you know well?... such that you are unable to see it in context?

    13. Re:C++ by MadKeithV · · Score: 1

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

      If you think C++ is simple or intuitive you haven't used it enough, and/or enough of it. There is nearly always some dark corner of the standard that does something which is at first glance totally illogical until you understand the way the compiler or history has had to deal with the construct in question. The most vexing parse, for example, or the fact that there are three char types (char, unsigned char and signed char are distinct types).

    14. Re:C++ by Anonymous Coward · · Score: 0

      Simple, flexible and intuitive to use for solving problems and writing good code IFF you know how to use it.

      That better?

  25. Re:Why would seeing 'WTF' implicate the language.. by Megane · · Score: 2

    It's also skewed to "languages used in Github projects". More importantly, would the people programming in a real WTF language not even know that it was such a WTF?

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  26. I'm going to find out the best language... by ddd0004 · · Score: 5, Funny

    by using the search term "l33t".

    1. Re:I'm going to find out the best language... by Anonymous Coward · · Score: 0

      Ach, and I just used up my last modpoint.

  27. Re:Why would seeing 'WTF' implicate the language.. by Anonymous Coward · · Score: 0

    I knew a guy whose initials were WTF......

    I don't know if he ever used them as a login, though.

  28. WTF? Python is worse than Perl by umafuckit · · Score: 1

    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

    1. Re:WTF? Python is worse than Perl by geek · · Score: 1

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

    2. Re:WTF? Python is worse than Perl by umafuckit · · Score: 2

      Or perhaps Perl's conciseness means that it requires fewer WTFs per line. In fact, one WTF per file would suffice.

    3. Re:WTF? Python is worse than Perl by forkazoo · · Score: 1

      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.

    4. Re:WTF? Python is worse than Perl by Smallpond · · Score: 1

      No. Its because Perl has things like "0 but true". WTF? is just not strong enough.

    5. Re:WTF? Python is worse than Perl by Anonymous Coward · · Score: 0

      and in python the "1" object can have value "0", so WTF is your point.

    6. Re:WTF? Python is worse than Perl by MachineShedFred · · Score: 1

      And here it is:

      use WTF::Unreadable;

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
  29. WTFs per nodes by istartedi · · Score: 1

    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 they thinking when they created this mother-of-all classes?).

    WTFs could also relate to the environment in which the code is being written. Start-ups using JavaScript might not mind if you swear in the code. They might let you do that until the company gets big, then the boss tells you to do a global search and replace on all the swears. I've seen that happen. Perl is more likely being used for mature projects where that happened a long time ago, and you really should have got the memo or read in the company handbook that any hint of unprofessional language isn't allowed in the code.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  30. It stands to reason... by mark-t · · Score: 1

    ... 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 actual real-world use.

    1. Re:It stands to reason... by lgw · · Score: 1

      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?

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:It stands to reason... by mark-t · · Score: 1

      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 honest would generally prefer a slightly more verbose name anyways, such as "len", if it's really meant to be a length.

      Nonetheless, I'd let it slide in a code review if the scope was short enough and the purpose of the variable was otherwise completely obvious.

  31. WebKit by djfreestyler · · Score: 1

    Anyone know how many clones of WebKit and related projects are on GitHub? Because I can imagine that pretty much skewing the statistics for C++ due to this: https://trac.webkit.org/browser/trunk/Source/WTF.

  32. Re:Why would seeing 'WTF' implicate the language.. by Anonymous Coward · · Score: 0

    Perhaps says more about the culture of the language. If you go to the raw numbers, you'll see that WTF is not used in the more than 20k Ada repos. First -- surprised that there is that much overlap between Ada programmers and Github users; and second -- the kind of people that would use Ada generally would not type "WTF"...

  33. Legitimate WTF instances by stevegee58 · · Score: 1

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

    1. Re:Legitimate WTF instances by Anonymous Coward · · Score: 0

      Look at Android's Log class. Love this one:
      . /**
                * What a Terrible Failure: Report a condition that should never happen.
                * The error will always be logged at level ASSERT with the call stack.
                * Depending on system configuration, a report may be added to the
                * {@link android.os.DropBoxManager} and/or the process may be terminated
                * immediately with an error dialog.
                * @param tag Used to identify the source of a log message.
                * @param msg The message you would like logged.
                */
              public static int wtf(String tag, String msg) {
                      return wtf(tag, msg, null);
              }

  34. I'm going to ... by PPH · · Score: 1

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

    --
    Have gnu, will travel.
  35. Re:The Dumbing Down Continues by Aelanna · · Score: 1

    I'm so sick of the idiots coming out of college now that only know Java, the way they look at you in horror when you say, "No, there is not a library for that. You have to write it yourself."

    I can agree with the sentiment that someone who only knows how to put libraries together wouldn't be a particularly good developer (and by extension, a particularly good employee), but discounting someone who prefers using a pre-existing library instead of baking their own solution seems a bit of an overreaction. Software development is like any other aspect of collaboration: you won't get very far by reinventing the wheel every time, so what's wrong with building on the work of others in order to accomplish a goal?

  36. They forgot SQL! by Zero__Kelvin · · Score: 4, Insightful

    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

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    1. Re:They forgot SQL! by Anonymous Coward · · Score: 0

      AS little as Ive used SQL, makes sense to me

      really need a full list ranked to see what this signifies

      Trying to do a complex program in a simplistic language can be quite horrific too

    2. Re:They forgot SQL! by cerberusss · · Score: 1

      Heh, this is nothing :-)
      I worked at Oracle, and five-pages-long SELECT queries did happen in projects. Real life is sometimes complicated :-)

      --
      8 of 13 people found this answer helpful. Did you?
    3. Re:They forgot SQL! by Zero__Kelvin · · Score: 1

      "Real life is sometimes complicated :-)"

      ... and real life is full of incompetence. A five page long SELECT is a clear sign of incompetence, not complexity.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  37. problem domain vs language involved by Anonymous Coward · · Score: 0

    there is a reason there isn't WTF for java.... because nobody uses Java to write, for example, a graphics card driver or code that has to interface with graphics card drivers. Because you can't. It's like saying, look at how many bullets get shot at you if you are in a police car vs an ice cream truck, then saying that ice cream trucks are better cars because they get shot less.

    1. Re:problem domain vs language involved by Anonymous Coward · · Score: 0

      No, that's not it at all. It is just that in Java we prefer to use full names with camel case, so those WTF's are all written as "WhatTheFuck", which was not searched for.

  38. Re:Why would seeing 'WTF' implicate the language.. by lgw · · Score: 2

    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.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  39. Scala by Anonymous Coward · · Score: 0

    Noting that you can write WTF code in any language, and putting up a defense of C++ on the basis that just because a feature exists you don't need to (mis)use it, even though sadly the majority of coders using it tend to so, Scala is really the most unsuitable language I've ever encountered for preety much any application due to what I call the novely factor whereby nobody using it in commercial projects knows how it can be used advantageously to build something better than they could with more mature application frameworks: I watched a total slow motion car crash of a Scala project descend into mayhem over 9 months, at which point the only happy event noticeable was that all the "Scala evangelists" were told never to turn up ever again.

  40. Don't know about your co-worker's code... by Anonymous Coward · · Score: 0

    But it sounds similiar to how muds/mushes from the early 80s to mid 90s looked.

    Thankfully there weren't many gotos in those codebases, but a *TON* of them relied on some pretty convoluted switch statements for a number of years before moving to saner data structures for command parsing.

    1. Re:Don't know about your co-worker's code... by Requiem18th · · Score: 1

      What is a better data structure for command parsing?

      --
      But... the future refused to change.
  41. Correlation != Causation by Anonymous Coward · · Score: 0

    WTF comments could also reflect on the project's setup. Or people working on a project's skills. Etc etc et. Language is just a tool, I've had WTF moments in many languages that where not dependent on the language.

  42. Re:Why would seeing 'WTF' implicate the language.. by QRDeNameland · · Score: 3, Insightful

    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.

    --
    Momentarily, the need for the construction of new light will no longer exist.
  43. Are they really? by Anonymous Coward · · Score: 0

    Or are the results skewed by how many lines of code and how popular those languages are?

  44. Bad Article Title by apcullen · · Score: 2

    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.

    1. Re:Bad Article Title by Anonymous Coward · · Score: 0

      If you're going for clarity, a better title would be Highest occurrences of "WTF" in commit comments of Github-hosted repositories created between January 1, 2012 and September 23, 2013 segmented by programming language.

  45. Re:Why would seeing 'WTF' implicate the language.. by datavirtue · · Score: 1

    Good code in any language should make sense to a layman. If a "user" can walk up and start reading your code/comments and follow the logic flow then you are doing your job. I maintain a codebase at work that is very good and very clean but the naming is a tad terse and it lacks comments that are needed when such a style is used. In other words, you need to be a seasoned developer to understand even the simplest constucts. There are not many things that even qualify as WTF, although people complain all the time, but it takes a lot of time for experienced developers to dig deep.

    --
    I object to power without constructive purpose. --Spock
  46. Re:The Dumbing Down Continues by tibman · · Score: 1

    I don't think he's discounting someone who wants to use a pre-existing library. He's saying he enjoys making them write libraries because one doesn't exist for the given task. But i think calling people coming out of college idiots is itself idiotic. College doesn't teach people to be good and experienced programmers/developers. It gives them a lot of different experiences. He calls C#, Java, Ruby, and Python garbage because he probably has never worked with them. I'm sure he still writes his website's back-end in C++ too, lol.

    --
    http://soylentnews.org/~tibman
  47. Just becuase a language allows it... by gatkinso · · Score: 1

    ...doesn't mean you should shout "fire!" in a crowed theater.

    --
    I am very small, utmostly microscopic.
  48. Re:The Dumbing Down Continues by gatkinso · · Score: 2

    I have been writing C++ for over 20 years. I love it. But I also think Java and Python are decent languages as well (and I have heard great things about Ruby).

    --
    I am very small, utmostly microscopic.
  49. Re:The Dumbing Down Continues by gatkinso · · Score: 1

    PS you haven't lived until you have written a Python extension in C++ (which of course lives in a C wrapper). Good clean fun, that.

    --
    I am very small, utmostly microscopic.
  50. Re:Why would seeing 'WTF' implicate the language.. by sunderland56 · · Score: 1

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

  51. Re:Why would seeing 'WTF' implicate the language.. by antifoidulus · · Score: 0

    C++ tends to make way too much implicit making the code much harder to read at a logical level, as you always have to keep all of C++s quirks in mind when reading. For instance, C++ is the only language I know of where the following is not equivalent:

    Widget foo; foo=bar;

    And:

    Widget foo=bar;

    Having to keep in mind one evokes the default constructor and the other invokes the copy constructor makes it much more difficult to focus on what the code is actually doing, and things like that tend to lead to a lot of subtle bugs in C++ code.

  52. WTFs/minute by Anonymous Coward · · Score: 1
  53. Re:The Dumbing Down Continues by Anonymous Coward · · Score: 0

    I've worked with all of those. Java is ugly and overly verbose, but usable. It's basically cobalt. C# is better than java, but useless because it's tied to windows. Ruby is shit. Using it for anything beyond a silly script for yourself is asking for disaster. Python is amazing.

  54. The WTF in Lua is due to documentation by Anonymous Coward · · Score: 0

    Lua is designed to have very minimal documentation so while learning it there is sort of a constant WTF going on. I like the fact Lua can be used in this manner but while learning to do things in it I was sort of aghast at how much thinking on your feet you have to do. C# is like an art supply store and Lua is like a single piece of chalk but with either it is possible to create amazing artwork.

  55. Weighted metrics? by Anonymous Coward · · Score: 2, Insightful

    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.

  56. baffling c++ by Anonymous Coward · · Score: 0

    C++ amongst 3 most baffling ...

    Wonder if a breakdown of features within the language would show the template features as the largest subset for bafflement

    or possibly something more dealing with libraries which might, with more low level usages/utility, be more diverse (and more marginally documented by minority user groups)

  57. http://thedailywtf.com/Articles/A_Case_of_the_MUMPS.aspx

    %DTC
    %DTC ; SF/XAK - DATE/TIME OPERATIONS ;1/16/92 11:36 AM
    ;;19.0;VA FileMan;;Jul 14, 1992
    D I 'X1!'X2 S X="" Q
    S X=X1 D H S X1=%H,X=X2,X2=%Y+1 D H S X=X1-%H,%Y=%Y+1&X2
    K %H,X1,X2 Q
    ;
    C S X=X1 Q:'X D H S %H=%H+X2 D YMD S:$P(X1,".",2) X=X_"."_$P(X1,".",2)
    K X1,X2 Q
    S S %=%#60/100+(%#3600\60)/100+(%\3600)/100 Q
    ;
    H I X<1410000 S %H=0,%Y=-1 Q
    S %Y=$E(X,1,3),%M=$E(X,4,5),%D=$E(X,6,7)
    S %T=$E(X_0,9,10)*60+$E(X_"000",11,12)*60+$E(X_"00000",13,14)
    TOH S
    %H=%M>2&'(%Y#4)+$P("^31^59^90^120^151^181^212^243^273^304^334","^",%M)+%D
    S %='%M!'%D,%Y=%Y-141,%H=%H+(%Y*365)+(%Y\4)-(%Y>59)+%,%Y=$S(%:-
    1,1:%H+4#7)
    K %M,%D,% Q
    ;
    DOW D H S Y=%Y K %H,%Y Q
    DW D H S Y=%Y,X=$P("SUN^MON^TUES^WEDNES^THURS^FRI^SATUR","^",Y+1)_"DAY"
    S:Y<0 X="" Q
    7 S %=%H>21608+%H-.1,%Y=%\365.25+141,%=%#365.25\1
    S %D=%+306#(%Y#4=0+365)#153#61#31+1,%M=%-%D\29+1
    S X=%Y_"00"+%M_"00"+%D Q
    ;
    YX D YMD S Y=X_% G DD^%DT
    YMD D 7 S %=$P(%H,",",2) D S K %D,%M,%Y Q
    T F %=1:1 S Y=$E(X,%) Q:"+-"[Y G 1^%DT:$E("TODAY",%)'=Y
    S X=$E(X,%+1,99) G PM:Y="" I +X'=X D DMW S X=%
    G:'X 1^%DT
    PM S @("%H=$H"_Y_X) D TT G 1^%DT:%I(3)'?3N,D^%DT
    N F %=2:1 S Y=$E(X,%) Q:"+-"[Y G 1^%DT:$E("NOW",%)'=Y
    I Y="" S %H=$H G RT
    S X=$E(X,%+1,99)
    I X?1.N1"H" S X=X*3600,%H=$H,@("X=$P(%H,"","",2)"_Y_X),%=$S(X<0:-
    1,1:0)+(X\86400),X=X#86400,%H=$P(%H,",")+%_","_X G RT
    D DMW G 1^%DT:'% S @("%H=$H"_Y_%),%H=%H_","_$P($H,",",2)
    RT D TT S %=$P(%H,",",2) D S S %=X_% I %DT'["S" S %=+$E(%,1,12)
    Q:'$D(%(0)) S Y=% G E^%DT
    PF S %H=$H D YMD S %(9)=X,X=%DT["F"*2-1 I @("%I(1)*100+%I(2)"_$E(">
    <",X+2)_"$E(%(9),4,7)") S %I(3)=%I(3)+X
    Q
    TT D 7 S %I(1)=%M,%I(2)=%D,%I(3)=%Y K %M,%D,%Y Q
    NOW S %H=$H,%H=$S($P(%H,",",2):%H,1:%H-1)
    D TT S %=$P(%H,",",2) D S S %=X_$S(%:%,1:.24) Q
    DMW S %=$S(X?1.N1"D":+X,X?1.N1"W":X*7,X?1.N1"M":X*30,+X=X:X,1:0)
    Q
    COMMA ;
    S %D=X<0 S:%D X=-X S %=$S($D(X2):+X2,1:2),X=$J(X,1,%),%=$L(X)-3-
    $E(23456789,%),%L=$S($D(X3):X3,1:12)
    F %=%:-3 Q:$E(X,%)="" S X=$E(X,1,%)_","_$E(X,%+1,99)
    S:$D(X2) X=$E("$",X2["$")_X S X=$J($E("(",%D)_X_$E(" )",%D+1),%L) K
    %,%D,%L
    Q
    HELP S DDH=$S($D(DDH):DDH,1:0),A1="Examples of Valid Dates:" D %
    S A1=" JAN 20 1957 or 20 JAN 57 or 1/20/57"_$S(%DT'["N":" or
    012057",1:"") D %
    S A1=" T (for TODAY), T+1 (for TOMORROW), T+2, T+7, etc." D %
    S A1=" T-1 (for YESTERDAY), T-3W (for 3 WEEKS AGO), etc." D %
    S A1="If the year is omitted, the computer "_$S(%DT["P":"assumes a
    date in the PAST.",1:"uses the CURRENT YEAR.") D %
    I %DT'["X" S A1="You may omit the precise day, as: JAN, 1957" D %
    I %DT'["T",%DT'["R" G 0
    S A1="If the date is omitted, the current date is assumed." D %
    S A1="Follow the date with a time, such as JAN 20@10, T@10AM, 10:30,
    etc." D %
    S A1="You may enter a time, such as NOON, MIDNIGHT or NOW." D %

  58. Re:Why would seeing 'WTF' implicate the language.. by aztracker1 · · Score: 1

    It should probably also be offset by how many lines of code there are in language X.

    --
    Michael J. Ryan - tracker1.info
  59. Re:Why would seeing 'WTF' implicate the language.. by LordWabbit2 · · Score: 1

    What's sad is I've looked at code before and thought WTF, who the hell wrote this cr@p, checked the change log and it was me :-(

    --
    There are three kinds of falsehood: the first is a 'fib,' the second is a downright lie, and the third is statistics.
  60. Re:The Dumbing Down Continues by Smerta · · Score: 1

    I'm sure he still writes his website's back-end in C++ too, lol.

    But see there's the myopia (no offense intended). Who said anything about websites?

    I'm not the OP, but I've also used C++ for about 20 years (C even longer). I develop firmware for safety-critical systems. Most of them have hard real-time deadlines. My colleagues and I have to understand assembly language, schematics, compilers and linkers, optimization opportunities, etc. Most of us are pretty strong in DSP. Most of us couldn't design a website, write a javascript program or tell you jack about Ruby on Rails.

    C and C++ are the go-to languages in embedded systems. There was a LOT of code before the World Wide Web (even the internet), and you've probably used 10 embedded systems just since you woke up.

    You're welcome to stay on my lawn, but please don't poop on it.

  61. WTF by zakeria · · Score: 0

    why is this important in any regard or even news?

  62. As a C++ developer I wholeheartedly agree by GauteL · · Score: 2

    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. 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 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.

  63. Re:They forgot INTERCAL! by ZahrGnosis · · Score: 1

    Worse yet, they forgot INTERCAL! Any language with a "COME FROM" command (rather than "GO TO") should make the list by default.

    Of course, noone uses it, so maybe it didn't meet the criteria. Whereas I agree that SQL is hugely used. SQL isn't really a programming language, though... extensions such as PL/SQL help make it so, but those are very non-standard and tweaky in their own right. As a set-focused (relational) data processing tool, SQL actually does OK.

    ---Chip

  64. Platform, not language! by Anonymous Coward · · Score: 1

    The real source of WTF is the platform - you're trying to reverse-engineer the design of some library or framework that people have been overengineering for a long time. C++'s libraries and templates are mind-boggling. Android is so overengineered that I can't figure out how to do simple things without creating a big mess. Java has three or four I/O libraries and two or three threading libraries.

  65. Hasty generalization on part of Lua and Smalltalk by kriston · · Score: 1

    I'm afraid that the vanishingly small sample of Lua and Smalltalk render their WTF-yness rather invalid. One might call this the hasty generalization fallacy.

    --

    Kriston

  66. To most programmers... by KateKarnage · · Score: 2

    The most WTF language is "Anything they don't use" ;-)

    --
    KateKarnage - Goth, Geek, Not all there......
  67. C++ still amazes by TheSkepticalOptimist · · Score: 1

    I don't consider C++ code itself to be confusing or poor, but I think there can be significantly more done to modernize the language, including it's IDE and compilers to remove the contrivances of headers, slow compile and retarded linkage. Considering that large C++ projects could still take hours to compile on over-spec'd monster boxes, compared to modern languages that takes only a few seconds to compile on a far leaner machine, it is obvious C++ needs some serious overhaul at its core.

    --
    I haven't thought of anything clever to put here, but then again most of you haven't either.
  68. but what about OC by Anonymous Coward · · Score: 0

    lol objective C would have been my guess for # 1

  69. Re:They forgot INTERCAL! by Zero__Kelvin · · Score: 1

    Structured Query Language is indeed a programming language. Maybe you mean that it isn't Turing Complete, but it is none the less a programming language for computers.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  70. Re:Why would seeing 'WTF' implicate the language.. by lgw · · Score: 1

    Sure, C++ explicitly give you the freedom to do stupid shit, and if coders in fact do stupid shit in your code base, then you'll have a shitty codebase. That's why C# or Java is better for most projects: few teams have the process and discipline to keep the junior guys from doing it wrong. Though with modern code review tools, this has become far more reasonable to do, and I might actually consider C++ for a new project thanks to ReviewBoard and the like.

    But if you need the difference between the copy constructor and assignment. Or, more likely, if you need your own memory management model, or any of the other quirky stuff C++ has support for built into the language, you're just better off using C++ than re-inventing it in C - I just have too much experience with the bugfest of the latter approach to tolerate reinventing those wheels ever again.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  71. Re:Why would seeing 'WTF' implicate the language.. by TangoMargarine · · Score: 1

    Which language(s) do you currently use?

    --
    Unity? Screw that: XFCE. Slashdot Beta? Screw that: SoylentNews. Australis? Screw that: Pale Moon. UX developers DIAF
  72. Re:The Dumbing Down Continues by tibman · · Score: 1

    I wasn't doing any pooping. Only pointing out that you need to use the right tool for the right job. Saying C++ is all you need sounds like a developer making excuses for not wanting to learn new languages. You can still write C++ binaries and put them into the cgi-bin for your website back-end but yuck and ouch. Please don't take that statement to mean C++ is garbage. It is not. It just isn't as suited to web development.

    --
    http://soylentnews.org/~tibman
  73. Re:Why would seeing 'WTF' implicate the language.. by antifoidulus · · Score: 1

    I have no qualms with the copy constructor, if only it were made explicit. The fact that C++ makes way too much implicit(like in the example above) is probably what I find most objectionable about the language. It makes code much harder to read if in addition to evaluating the logic you also have to keep a million rules about what is really going on in your head.

  74. Re:Why would seeing 'WTF' implicate the language.. by lgw · · Score: 1

    Oh, I agree completely. My list of things that annoy me about C++ are pretty much all that same complaint - the C mindset of making everything as terse as possible only works with a language as simple as C.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  75. Re:They forgot INTERCAL! by ZahrGnosis · · Score: 1

    Precisely.

  76. Re:Why would seeing 'WTF' implicate the language.. by dkf · · Score: 1

    It should probably also be offset by how many lines of code there are in language X.

    Why? That just skews against more verbose languages. It should be possible to write non-trivial projects without any WTFy-ness at all. If your language can't, that's a really good indication that it is the wrong tool.

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  77. PHP by Anonymous Coward · · Score: 0

    PHP is 100% WTF