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;
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.
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.
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.
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; }
by using the search term "l33t".
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.
Or perhaps Perl's conciseness means that it requires fewer WTFs per line. In fact, one WTF per file would suffice.
soylentnews.org
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
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.
There is a C-to-LUA compiler. I'm sure its output is fun.
Socialism: a lie told by totalitarians and believed by fools.
(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.
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
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.
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.
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.
http://thedailywtf.com/Articles/A_Case_of_the_MUMPS.aspx
;1/16/92 11:36 AM
;;19.0;VA FileMan;;Jul 14, 1992
;
;
;
; ;
%DTC
%DTC ; SF/XAK - DATE/TIME OPERATIONS
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 %
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.
The most WTF language is "Anything they don't use" ;-)
KateKarnage - Goth, Geek, Not all there......