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

59 of 254 comments (clear)

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

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

      Well, that and the inconsistencies.

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

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

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

    8. 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.
    9. 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
    10. 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!
    11. 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;
  3. 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 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. 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...
  5. 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.

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

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

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

    Watchdog Timer Fault.

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

  11. 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 ShanghaiBill · · Score: 4, Funny

      Languages are irrelevant.

      01010111 01010010 01001111 01001110 01000111 00100001

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

      and even WHOSE

    6. Re:Oh good grief. by freddy.grande · · Score: 2

      Just whose. Not really which.

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

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

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

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

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

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

  14. 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; }
  15. I'm going to find out the best language... by ddd0004 · · Score: 5, Funny

    by using the search term "l33t".

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

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

  18. 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
  19. 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.
  20. 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.
  21. Re:I guess they do not have much LISP code? by Darinbob · · Score: 3, Funny

    (W (T (F)))

  22. 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.
  23. 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
  24. 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.

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

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

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

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

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

    --
    KateKarnage - Goth, Geek, Not all there......