- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Wow. What a waste of time.
Admin
Mmm.... Perly! However, I can't quite place that "ifnot" language feature. What's that from?
Admin
I never did like those pesky equal signs anyway.
#define CURLY_OPEN_BRACE {
Admin
Hey, I want to see the whole file! That is only part of a Better C! Surely there must be something better than switch statements and structures!
Admin
Ugh, what a waste. It looks like he's trying to pull in some VB or SQL syntax. That makes sense, because it's so hard to remember ">" should be used for greater-than comparisons. Speaking of which, in a lot of places he replaced an operator (like ">") with a keyword that's longer than the original (now it's "GT").
I say we send him hunting with Dick Cheney.
Admin
sweet, let's confuse everyone!!! I like to use BETTER_C++ it's my fav!!!
while we're at it why don't we create BETTER_JAVA and oh, oh BETTER_VISUAL_BASIC, changing it all, talk about job security!!
Admin
Oh, it's just personal preference. He didn't like the syntax, so he changed it. Big deal.
Admin
that should be the new punishment for all bad programmers!! Cheap Oil and Better Programmers!!! ahh, a fantasy world ...
Admin
Awww, I saw the GT, GE, and LTs and thought FORTRAN. Unfortunately those control structures don't look like they're from FORTRAN. I was hoping there would finally be a WTF I could share with my co-workers. :(
Admin
This is not a WTF, this is just someone using syntactical sugar type approach. No big deal. Who really cares?
Admin
Yeah, things are better off when everyone creates their own syntax.
Admin
Reminds me of Bournegol.
http://www.goof.com/pcg/marc/bournegol.html
Admin
what if he..
#define pi 3.14159265............................................................
omg....
LOL
Admin
"It's just personal preference" is something that should be kept at home for your fan fiction website, not for something that another sane human would have to maintain, as the submitter did. Now the maintainer has to re-interpret every "repeat { ... }untilforever" in the code into something that the rest of the C-speaking world understands without depending on kooky precompiler tricks.
The WTF is why a person couldn't handle "<" or "while(1)" in their native format. I can only assume that they got "BETTER_C.h" from someone else; anyone with enough syntactic knowledge to write the header didn't need it in the first place.
Admin
Yeah, the NE, EQ, etc. are Perly. Then we have MOD, which is VBish.
What's up with 'forever?' Where was he going to use <FONT face="Courier New">forever{ //do something}</FONT> ?
Admin
Can anyone say..."VB C"?
Admin
I have no doubt that you don't care. You'll start pulling your hair out when you inherit some code like this though.
Admin
why didn't i think of that...
Admin
He was obviously trying to make C more self-documenting, which we all know is just an excuse for longer keywords that makes the language slower to code.
The real WTF is that he used acronymns (GT, LT, EQ, NEQ, ...) instead of whole words (lessthan, greatherthan, equals, ...).
Admin
> # define do_nothing
Priceless.
Admin
Congratulations, Sam, that is actually one of the biggest "WTF" comments we've seen here in a while. yeah, all he did was CHANGE THE SYNTAX of the language ... no biggie.
Admin
Um...found this lovely document:
http://www.conman.org/software/amc/docs/html/amc_usersguide.html
Full of lovely linguistic and grammatical WTFs itself to boot. It includes all of the operators listed.
Admin
Stupid VB programmers ... wait a second ... this isn't VB .... what is this? C !? how can that be? All bad coders write in exclusively in VB, and bad code can only be written in VB!! What the heck is going on?
Admin
<font size="2">I say we let him use it if he wants, but only if he renames it to I_am_an_incompetent_dumbass.h.
</font>
Admin
The original Bourne shell takes this approach even further.
Look at mac.h. Then look at args.c. Then go wash your brain out with vodka.
Admin
Kids,
the EQ, LT, GT etc. stuff is good old FORTRAN (sans leading and trailing '.').
And attempts to use the preprocessor to rape C are not new. More than 15 years ago I first saw:
#define BEGIN { #define END }
and since then I have seen it a hundred times. There are just too many idiot programmers out there.
Admin
Sweet. This is one of the de-facto obfuscation methods used by entrants to the International Obfuscated C Code Contest
Admin
Exactly, but used for the opposite purpose.
Admin
May be the guys who will have to keep his code up to date in the future?
I'm sure they WILL care about it...
Admin
You're sane.
Admin
I dunno, I'm having a hard time caring about it either. Although lately I've been messing with Ruby a lot, so maybe it's just that some of the resulting constructs are familiar. (Ruby has syntax built in for constructs like button.push unless thesign.says("Please do not push this button again").
But dude, seriously. He needed to reserve "forever"... AND <FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>untilbreak, AND untilreturn?</FONT>
And a construct called do_nothing?
(Incidentally: some of those comparison operators look Perlish, but they're not used appropriately. EQ and == aren't equivalent, for example: one compares strings, the other numeric values.)
Admin
Reminds me of my software engineering professor. He was convinced that C was the worst thing ever conceived.
And yet he said the language would be a hundred times better if we added the following lines to the top of our code:
Admin
excerpt of cruise_missile_guidance_system.c...
pos p = starting_position(), p_old, target = acquire_target();
do {
p_old = p;
p = gps_query();
trajectory t = vector(p_old, p);
correction c = calculate_course(target, p, t);
adjust_course(c);
} forever;
Admin
Looks like a half-FORTRAN, half Pascal hybrid super-language.
Admin
#define COMMENT //
Admin
May be the guys who will have to keep his code up to date in the future?
I'm sure they WILL care about it...
Admin
#define lAlpha a
#define lIndia I
#define sComma ,
#define sPeriod .
#define wBel believe
#define wBet Better_C
#define wCan can't
#define wComp competitive
#define wEd edge
#define wEn enable
#define wGv give
#define wGy guys
#define wI is
#define wImprov improvements
#define wjt just
#define wkd kind
#define wM me
#define wNd need
#define wO of
#define wSea see
#define wT to
#define wTech technology
#define wTh the
#define wThs this
#define wTht that
#define wTng thing
#define wU you
#define wWl will
wTht wBet wTech wI wjt wTh wkd wO wTng wTht lIndia wNd wT wGv wM lAlpha wComp wEd sPeriod
lIndia wCan wBel wTht wU wGy wCan wSea wTh wkd wO wImprov wTht wThs wWl wEn sPeriod
Admin
He's on the right track. Operators are works of the Devil. Weird, mysterious symbols, like Pagan runes. Must be Satan worshipping.
#define ASSIGN(x,y) (x) = (y)
#define ADD(x,y) (x) + (y)
#define SUBTRACT(x,y) (x) - (y)
#define MULTIPLY(x,y) (x) * (y)
#define DIVIDE(x,y) (x) / (y)
#define INCREMENT(x,y) (x) += (y)
#define INCREMENT1(x) INCREMENT(x,1)
#define POINTEROF(x) &(x)
#define THATPOINTEDBY(x) *(x)
#define MEMBEROF(x,y) (x).(y)
#define STOP ;
ASSIGN(a,MULTIPLY(MEMBEROF(THATPOINTEDBY(b),c),INCREMENT1(d))) STOP
And so much easier to read by the next generation of programmers.
Wait, I forgot:
#define BEGINPARENTHESES (
#define ENDPARENTHESES )
#define SEPARATOR ,
--Rank
Admin
Great!
Should be added:
#define COMMENT_START /*
#define COMMENT _END */
Admin
#define CONCATENATE_LITERAL_STRINGS(x, y) x y
Admin
you mean #define REM //
Admin
Any idea why the board software insists on putting all code on a single line in the RSS feed (except the obvious donkey-cock suckage which comes as a built-in feature)?
Admin
OMG! more defines come to my head
#define macro define
#macro . ; COMMENT every statement should finish with .
Admin
I'm taking a C class right now, can I get the full file so I can force the grading TAs to wash their eyes out with acid?
Admin
Don't you mean
#define (x) PLUS (y) (x) + (y)
#define (x) TIMES (y) (x) * (y)
#define (x) MINUS (y) (x) - (y)
#define (x) DIVIDEDBY (y) (x) / (y)
I especially appreciate STOP.
Admin
I believe those are called C# and VB.NET.
[dons flame suit]
Admin
I meant
#macro . ; REM every statement should finish with .
Admin
I believe those are called C# and VB.NET.
Admin
No, but I can say VB++
Admin
The real WTF is that there are people still programing in C