Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The Most WTF-y Programming Languages

Soulskill posted 1 year,24 days | from the as-long-as-it's-functional dept.

Programming 254

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

cancel ×

254 comments

Sorry! There are no comments related to the filter you selected.

Oblig.... (5, Funny)

Doug Otto (2821601) | 1 year,24 days | (#44952827)

WTF?

One for one (3, Interesting)

Anonymous Coward | 1 year,24 days | (#44952841)

C++ deserves its spot, it's pretty screwed up. I haven't dealt with Lua or Scala, so I can't comment on either. However, I imagine this probably also scales directly with the popularity of the language and indirectly with the skill of the people writing in it. So Lua would make sense; it's popular and seems to attract a lot of amateurs. I'm surprised PHP is so low, though; I hear horror stories about it that make me glad I never have to touch it.

Re:One for one (5, Insightful)

Anonymous Coward | 1 year,24 days | (#44952889)

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

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

Re:One for one (3, Insightful)

Zero__Kelvin (151819) | 1 year,24 days | (#44953577)

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

Re:One for one (5, Interesting)

Anonymous Coward | 1 year,24 days | (#44953625)

There's even a website dedicated to PHP WTFs [phpwtf.org]

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.

Re: One for one (4, Funny)

jd2112 (1535857) | 1 year,24 days | (#44953773)

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

Oh good grief. (2, Informative)

Anonymous Coward | 1 year,24 days | (#44953083)

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.

Re:Oh good grief. (5, Insightful)

beelsebob (529313) | 1 year,24 days | (#44953229)

Languages are just Syntax - get over it.

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

Re:Oh good grief. (2, Insightful)

larry bagina (561269) | 1 year,24 days | (#44953305)

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

Re:Oh good grief. (2)

Mitchell314 (1576581) | 1 year,24 days | (#44953467)

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.

Re:Oh good grief. (0)

Anonymous Coward | 1 year,24 days | (#44953779)

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.

Re:Oh good grief. (0)

Anonymous Coward | 1 year,24 days | (#44953897)

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.

Re:One for one (0)

Anonymous Coward | 1 year,24 days | (#44953121)

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

Re:One for one (1)

Zero__Kelvin (151819) | 1 year,24 days | (#44953595)

Are they hiring in your department?

Re:One for one (4, Insightful)

dgatwood (11270) | 1 year,24 days | (#44953277)

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

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

Re:One for one (4, Insightful)

Nerdfest (867930) | 1 year,24 days | (#44953325)

Well, that and the inconsistencies.

Re:One for one (4, Informative)

Aelanna (2695123) | 1 year,24 days | (#44953559)

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

Re:One for one (1)

Anonymous Coward | 1 year,24 days | (#44953535)

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?)

Re:One for one (2)

Mordok-DestroyerOfWo (1000167) | 1 year,24 days | (#44953563)

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.

Re:One for one (1)

Anonymous Coward | 1 year,24 days | (#44953763)

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

Re:One for one (0)

Anonymous Coward | 1 year,24 days | (#44953823)

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

Re:One for one (1)

Anonymous Coward | 1 year,24 days | (#44953903)

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.

Re:One for one (0)

Anonymous Coward | 1 year,24 days | (#44953941)

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.

Re:One for one (0)

Anonymous Coward | 1 year,24 days | (#44953615)

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.

Re:One for one (1)

Anonymous Coward | 1 year,24 days | (#44953987)

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

Hmm. (0)

Anonymous Coward | 1 year,24 days | (#44952845)

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.

Re:Hmm. (0)

Anonymous Coward | 1 year,24 days | (#44953819)

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?)

I guess they do not have much LISP code? (1)

Fallen Kell (165468) | 1 year,24 days | (#44952853)

Just wondering...

Re:I guess they do not have much LISP code? (3, Funny)

Darinbob (1142669) | 1 year,24 days | (#44953979)

(W (T (F)))

Visual Basic (4, Insightful)

BenSchuarmer (922752) | 1 year,24 days | (#44952857)

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

Re:Visual Basic (2, Funny)

Anonymous Coward | 1 year,24 days | (#44953125)

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

Re:Visual Basic (2)

garyebickford (222422) | 1 year,24 days | (#44953525)

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.

Don't know about your co-worker's code... (0)

Anonymous Coward | 1 year,24 days | (#44953901)

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.

Re:Visual Basic (1)

Godwin O'Hitler (205945) | 1 year,24 days | (#44953165)

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

Why would seeing 'WTF' implicate the language... (5, Insightful)

Assmasher (456699) | 1 year,24 days | (#44952861)

...instead of the code itself?

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

Re:Why would seeing 'WTF' implicate the language.. (1)

ericloewe (2129490) | 1 year,24 days | (#44953067)

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

Reading IOCCC entries illustrates this perfectly.

Re:Why would seeing 'WTF' implicate the language.. (2)

lgw (121541) | 1 year,24 days | (#44953831)

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.

Re:Why would seeing 'WTF' implicate the language.. (0)

Anonymous Coward | 1 year,24 days | (#44953097)

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.

Re:Why would seeing 'WTF' implicate the language.. (2)

Megane (129182) | 1 year,24 days | (#44953151)

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

Re:Why would seeing 'WTF' implicate the language.. (0)

Anonymous Coward | 1 year,24 days | (#44953257)

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

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

Re:Why would seeing 'WTF' implicate the language.. (0)

Anonymous Coward | 1 year,24 days | (#44953493)

Perhaps says more about the culture of the language. If you go to the raw numbers [google.com] , 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"...

WTF (0)

Anonymous Coward | 1 year,24 days | (#44952885)

WTF

WTF!?!?!? (1)

OzPeter (195038) | 1 year,24 days | (#44952907)

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

Re:WTF!?!?!? (0)

Anonymous Coward | 1 year,24 days | (#44953091)

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.

Bad statistics are bad (4, Insightful)

Anon, Not Coward D (2797805) | 1 year,24 days | (#44952913)

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

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

Re:Bad statistics are bad (5, Informative)

Kyle Jacoby (2973265) | 1 year,24 days | (#44953055)

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

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

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

Re:Bad statistics are bad (0)

Anonymous Coward | 1 year,24 days | (#44953081)

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!

LICENSE.txt (5, Funny)

TeknoHog (164938) | 1 year,24 days | (#44952929)

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.

Re:LICENSE.txt (1)

Anonymous Coward | 1 year,24 days | (#44953353)

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.

Re:LICENSE.txt (0)

Anonymous Coward | 1 year,24 days | (#44954027)

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

What's wrong with Lua? (1)

Florian Weimer (88405) | 1 year,24 days | (#44952947)

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.

Re:What's wrong with Lua? (1)

segmond (34052) | 1 year,24 days | (#44952961)

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

Re:What's wrong with Lua? (2)

lgw (121541) | 1 year,24 days | (#44953893)

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

Re:What's wrong with Lua? (0)

Anonymous Coward | 1 year,24 days | (#44953185)

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.

Re:What's wrong with Lua? (1)

ArcadeMan (2766669) | 1 year,24 days | (#44953245)

If you think PHP is bad, go check the parsing order of ExpressionEngine [loweblog.com] .

Re:What's wrong with Lua? (0)

Anonymous Coward | 1 year,24 days | (#44953361)

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

Re:What's wrong with Lua? (1)

ArcadeMan (2766669) | 1 year,24 days | (#44953767)

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.

Re:What's wrong with Lua? (2, Informative)

Anonymous Coward | 1 year,24 days | (#44953271)

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.

Re:What's wrong with Lua? (0)

Anonymous Coward | 1 year,24 days | (#44953859)

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.

Re:What's wrong with Lua? (1)

Darinbob (1142669) | 1 year,24 days | (#44953999)

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

Legacy Code (1)

Anonymous Coward | 1 year,24 days | (#44952955)

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.

template it (0)

Anonymous Coward | 1 year,24 days | (#44952969)

I have a customized WTF comment template i really like.

That's easy. (5, Informative)

gallondr00nk (868673) | 1 year,24 days | (#44952975)

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

python (0)

Anonymous Coward | 1 year,24 days | (#44952977)

Python would be my biggest WTF.

My WTF (3, Interesting)

EmperorOfCanada (1332175) | 1 year,24 days | (#44952991)

My WTF would be people posting Visual Basic to GitHub. Then another WTF for anyone posting cobol to Github. My next WTF would be where the WTF is directed. Is it directed at the code or away from the code. Also many might be directed at the language or even a specific implementation. So my regular WTF in Objective-C would be theInsanelyLongDefinedParametersThatAreUsedInTheNS library. But when it comes to much of my own past perl code I suspect I would comment WTF in that in my Perl days I could twist a regular expression into pretty much anything.

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

WTF per repository? (0)

Anonymous Coward | 1 year,24 days | (#44953009)

And not WTF per line of code? Seriously?

Re:WTF per repository? (0)

Anonymous Coward | 1 year,24 days | (#44953203)

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

WTF (3, Funny)

ArcadeMan (2766669) | 1 year,24 days | (#44953023)

Watchdog Timer Fault.

Objective-C (4, Funny)

Ukab the Great (87152) | 1 year,24 days | (#44953077)

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

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

Re:Objective-C (2)

Delirium Tremens (214596) | 1 year,24 days | (#44953609)

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

Re:Objective-C (0)

Anonymous Coward | 1 year,24 days | (#44953737)

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

Statistics, the mother of all lies... (5, Insightful)

paavo512 (2866903) | 1 year,24 days | (#44953107)

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

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

Re:Statistics, the mother of all lies... (1)

Ukab the Great (87152) | 1 year,24 days | (#44953223)

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

Re:Statistics, the mother of all lies... (0)

Anonymous Coward | 1 year,24 days | (#44953461)

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.

Re:Statistics, the mother of all lies... (1)

Anubis IV (1279820) | 1 year,24 days | (#44953465)

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.

problem domain vs language involved (0)

Anonymous Coward | 1 year,24 days | (#44953661)

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.

C++ (2, Informative)

harvestsun (2948641) | 1 year,24 days | (#44953137)

IMHO, C++ is a simple, flexible, intuitive, and powerful language... IF (and only if) you know how to use it.
The problem is, most programmers don't. So often, I end up working on spaghetti code written 5 years ago by someone who, for example, thinks inheritance is the solution to all problems, and that private member variables are for sissies.
Also, I wonder how many of those "WTF"s were from people trying to use Windows APIs (don't you just love COM?). That's what consistently causes me the most frustration.

Re:C++ (5, Insightful)

geek (5680) | 1 year,24 days | (#44953391)

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

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

Re:C++ (2)

harvestsun (2948641) | 1 year,24 days | (#44953835)

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.

Re:C++ (0)

Anonymous Coward | 1 year,24 days | (#44954015)

Then why the bitching of c++!

Re:C++ (1)

Azure Flash (2440904) | 1 year,24 days | (#44953803)

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 ;)

I'm going to find out the best language... (5, Funny)

ddd0004 (1984672) | 1 year,24 days | (#44953171)

by using the search term "l33t".

Re:I'm going to find out the best language... (0)

Anonymous Coward | 1 year,24 days | (#44953333)

Ach, and I just used up my last modpoint.

The Dumbing Down Continues (-1)

Anonymous Coward | 1 year,24 days | (#44953261)

Anyone who thinks C++ is a bad language, and garbage like Java, C#, Ruby, Python, etl. al., are good, they should be digging ditches not writing software. 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."

Re:The Dumbing Down Continues (1)

Aelanna (2695123) | 1 year,24 days | (#44953627)

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?

WTF? Python is worse than Perl (1)

umafuckit (2980809) | 1 year,24 days | (#44953315)

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

Re:WTF? Python is worse than Perl (1)

geek (5680) | 1 year,24 days | (#44953405)

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

Re:WTF? Python is worse than Perl (2)

umafuckit (2980809) | 1 year,24 days | (#44953487)

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

WTFs per nodes (1)

istartedi (132515) | 1 year,24 days | (#44953417)

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.

It stands to reason... (1)

mark-t (151149) | 1 year,24 days | (#44953423)

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

WebKit (1)

djfreestyler (2579333) | 1 year,24 days | (#44953457)

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 [webkit.org] .

Legitimate WTF instances (1)

stevegee58 (1179505) | 1 year,24 days | (#44953509)

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

Re:Legitimate WTF instances (0)

Anonymous Coward | 1 year,24 days | (#44953623)

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);
        }

I'm going to ... (1)

PPH (736903) | 1 year,24 days | (#44953553)

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

They forgot SQL! (4, Insightful)

Zero__Kelvin (151819) | 1 year,24 days | (#44953643)

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

Scala (0)

Anonymous Coward | 1 year,24 days | (#44953853)

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.

Correlation != Causation (0)

Anonymous Coward | 1 year,24 days | (#44953943)

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.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?