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."
WTF?
Solving Unix problems since 1989...
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.
I'm not sure whether it's the language, or the people who choose to use it.
...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...
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
Escher was the first MC and Giger invented the HR department.
Brainfuck. Look it up, I can't even give a code example as it pisses off /.'s filter.
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++?"
Watchdog Timer Fault.
Get free satoshi (Bitcoin) and Dogecoins
We Objective-C developers prefer more verbose WTF statements, such as
- (void)whatTheFuckAreYouDoing:(NSString *)wtf withThatAbsurdAlgorithm:(NSString *)algorithm thatOnlyOnePersonOnDevTeamUnderstands:(BOOL)doesHeReallyUnderstandIt;
According to TFA, he "calculated the average number of WTF commit comments per repository". So why not per line of code or whatever? C++ projects tend to be rather large (because it is harder to write large projects in other languages), so surely by this metric C++ would win (aka lose) here.
If there is one thing I have learned about statistics it is that you can prove about anything you want ... unless you want and are actually able to find the correct normalizations.
by using the search term "l33t".
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.
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.
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
(W (T (F)))
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.
Languages are irrelevant.
01010111 01010010 01001111 01001110 01000111 00100001
You need to go and look up the meaning of the word intuitive.
and even WHOSE
> 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.
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.