• gormless (unregistered)

    frist! we take over the world

  • (cs)

    Oh... we've returned to the era of sheeple with extremely limited intelligence braying the word "frist" as early as they can, like they'll somehow win the approval of their peers, rather then the universal contempt that it actually earns them. Ho hum.

    So, the real WTF is a programming teacher rolling into class with some example programs which he hasn't even tried compiling yet? Indeed, from the story, he only gets round to actually looking at the code after the class has started.

  • (cs)

    The three universal laws of blog replies: (1) Somebody will say "first" or "frist" (2) Somebody will complain about somebody saying "first" or "frist" (3) Somebody will write an inane comment like this one about somebody complaining about somebody saying "first" or "frist"

  • gormless (unregistered)

    I also like eating and manual labor.

  • Russell (unregistered) in reply to Severity One

    (4) Someone will write a comment saying how witty the previous insane comment about somebody complaining, such as this one.

  • shadowphiar (unregistered)

    I've never heard of "Edu-C", but is the real WTF the use of c++ comments in a c program?

  • (cs)
    Maybe Edu-C doesn’t know how to read those comments correctly.
    Yes it does.

    So does GCC.

  • herpderp (unregistered) in reply to shadowphiar

    I don't want to sound like the smart ass, but those aren't "C++ comments". They are normal C comments as introduced in the C99 standard (https://en.wikipedia.org/wiki/C99).

  • imgx64 (unregistered)

    I don't see the WTF here.

    Is it the ASCII art in comments? Meaningful ASCII art in comments can be pretty useful to understand the code, they're even used in Linux kernel code where appropriate.

    Is it trying to use an unsupported compiler? That's a rookie mistake, especially since GCC wasn't even installed on the computers.

    Is it the fact that Edu-C, probably a dumbed-down C for "education", doesn't understand C++ style comments (//) as opposed to C style comments (/* */)? Many earlier compilers didn't understand them either, they were added to the C standard in C99. Still not a WTF.

    I really don't see the WTF here.

  • (cs)

    I assume that the compiler merged the line after the comment into the commented line because of the backslash, so it was interpreted as a comment and not compiled.

    What does the standard say about this? Are backslashes in comments used for string concatenation?

  • shadowphiar (unregistered)

    I had assumed that the problem was something like the backslash at the end of the comment line was being interpreted as continuing the comment onto the next line. That would explain the code's behaviour but doesn't explain the described symptom of the comment itself not being coloured out. Oh well.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    TRWTF is being able to continue comment lines with backslash-newline. Holy crap.

    And then there's the fun you can have with trigraphs. Because we still need to write C code on a terminal WITH UPPERCASE ONLY AND NO CURLY BRACES.

  • psmears (unregistered) in reply to imgx64
    imgx64:
    I don't see the WTF here.

    Is it the ASCII art in comments? Meaningful ASCII art in comments can be pretty useful to understand the code, they're even used in Linux kernel code where appropriate.

    Is it trying to use an unsupported compiler? That's a rookie mistake, especially since GCC wasn't even installed on the computers.

    Is it the fact that Edu-C, probably a dumbed-down C for "education", doesn't understand C++ style comments (//) as opposed to C style comments (/* */)? Many earlier compilers didn't understand them either, they were added to the C standard in C99. Still not a WTF.

    I really don't see the WTF here.

    Perhaps you're not looking hard enough...

    Presumably the problem here is related to the backslashes at the end of the lines - this is a continuation character, so the comment continues on to the next line:

    // This is a comment \
    This is a comment too, though it may not look like it
    

    Different compilers may not follow the C standards correctly in a number of ways, such as whether they obey the backslash even when it occurs in a comment; whether it must be at the end of the line (or can have whitespace after it) and so on.

    Presumably one of the compilers that they tried differed in its interpretation from the other. I find this strange, because my version of gcc interprets the \ in all cases that I tried (even with whitespace etc) - so I'd expect gcc to ignore the assignment in question. But maybe they were using a different version of gcc or something...

  • (cs)

    TRWTF is teaching C to a middle-school student.

    Don't get me wrong, I think C is one of the best things to happen to humanity, but using it as a teaching tool for kids doesn't seem appropriate to me when you have other tools/languages which might prove more educational and spark their interest instead of burying it below 6 feet of compiler errors.

  • (cs) in reply to imgx64
    imgx64:
    I don't see the WTF here.

    Is it the ASCII art in comments? Meaningful ASCII art in comments can be pretty useful to understand the code, they're even used in Linux kernel code where appropriate.

    Is it trying to use an unsupported compiler? That's a rookie mistake, especially since GCC wasn't even installed on the computers.

    Is it the fact that Edu-C, probably a dumbed-down C for "education", doesn't understand C++ style comments (//) as opposed to C style comments (/* */)? Many earlier compilers didn't understand them either, they were added to the C standard in C99. Still not a WTF.

    I really don't see the WTF here.

    The comment's last line ends with a backslash, meaning the next line is commented out as well.

    Edit: Wow, I'm late.

  • Adrian (unregistered)

    She can have a job. I have vacancies.

  • (cs) in reply to psmears
    psmears:
    // This is a comment \
    This is a comment too, though it may not look like it
    

    Different compilers may not follow the C standards correctly in a number of ways, such as whether they obey the backslash even when it occurs in a comment; whether it must be at the end of the line (or can have whitespace after it) and so on.

    It cannot have any other character after it, except the newline, by definition. Any compiler that treats backslash-space-newline as a valid continuation indicator is by definition not a C/C++ compiler.

    And of course...

     // this is a comment ??/
    and so is this.

    Ha ha, fun you can have with trigraphs. (For C++, there is a digraph for this as well, but the digraphs are less well known, and frequently resemble smileys.)

    Addendum (2013-06-10 08:19): Bah, no there isn't a digraph for , but the rest remains valid.

  • Klistel (unregistered)

    Couldn't they just have removed the fluffy story this time? A compiler that extends a comment via a backslash seems like a funny WTF, but the story around it make me not even realize what the hell was the point of it (was it middle-school children, was it the code itself etc?).

    Can we please cut down on all the fancy story-telling when it just obfuscates the WTF?

  • AnonCoward23 (unregistered) in reply to Klistel
    Klistel:
    A compiler that extends a comment via a backslash seems like a funny WTF
    That's not even a compiler WTF, this is actually correct according to the C standard (C89 too).

    The real WTF is how this article doesn't mention this at all. And how few of the commenters understand this. Idiots, the lot of you.

  • AnonCoward23 (unregistered)

    Also, gcc will of course also do this, so the article is even more WTFy.

  • Welcome to TDWTF!! (unregistered) in reply to Klistel
    Klistel:
    Couldn't they just have removed the fluffy story this time? A compiler that extends a comment via a backslash seems like a funny WTF, but the story around it make me not even realize what the hell was the point of it (was it middle-school children, was it the code itself etc?).

    Can we please cut down on all the fancy story-telling when it just obfuscates the WTF?

    You're new here, aren't you?

  • EvilSnack (unregistered)

    To me, TRWTF will always be computer languages designed for educational purposes. The best first lesson for computer programming is that when programming, you follow the computer's rules, and not rules you make up as you go along.

    Captcha laoreet: "The speaker's comments has the press corps LAOREET."

  • (cs) in reply to shadowphiar
    shadowphiar:
    I've never heard of "Edu-C", but is the real WTF the use of c++ comments in a c program?
    No, the real WTF is how hard it is to search goggle for Edu-C. The big G matches "Edu-C" (quotes included) on pages that contain "edu.com", citing the "c" of "com" as the "C" of "Edu-C". FOR FUCK'S SAKE! How hard is it to write a search algorithm that just searches for the exact text I entered, when I entered it in (censored) quotes that are supposed to (censored) give me a (censored) exact (censored) match.

    (censored) so I don't sound as much like blakeyrat as I would if I didn't censor what I wrote.

  • (cs) in reply to ubersoldat

    I was in an actual robotics class with VEX robots (awesome, but getting pricey). Teacher forced the class to use LabVIEW. I fought and used RobotC for Vex.

    I was the only one to actually complete assignments (including his 'challenge course' that nobody got as far as I would) and he would bitch because I wasn't using LabVIEW.

    ... hey, it's easier to subroutine everything in C!

    I haven't heard of any sort of edu-C type product. I know in actual robotics (which this probably isn't) you have EasyC... which is basically C, but drag-and-drop C.

  • (cs) in reply to Klistel
    Klistel:
    Couldn't they just have removed the fluffy story this time?

    The fluffy story is what differentiates TDWTF from FreeVBCode.com ;)

  • CA (unregistered)

    I have never complained about the quality of the articles here until now. I think it is written somewhere that TDWTF does not post stories of students or amateurs, but instead tends to post stories of our so beloved "elite programmers". So wtf is this? Next thing you know we will be seing stories where nerdy parents complain that their 5 year old son does not know how to debug PHP.

  • Joe (unregistered) in reply to Russell

    (6) Profit!!!

  • QJo (unregistered)

    The real WTF is C and all its illegitimate and doubtless consequentially criminal offspring, amirite?

    No, my immediate thought on puzzling out WTF the WTF here is the agreement with the frighteningly precocious child not to do something nefarious with the knowledge she had gleaned.

    See that brier-bush over there? Oh please, Brer Fox, please don't throw me into it!

  • Bring Back TopCod3r (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    No, the real WTF is how hard it is to search goggle for Edu-C. The big G matches "Edu-C" (quotes included) on pages that contain "edu.com", citing the "c" of "com" as the "C" of "Edu-C".

    And when I 'google' killer robot, all I can find are news stories. Sign of the times I suppose.

  • (cs) in reply to Klistel
    Klistel:
    Couldn't they just have removed the fluffy story this time? A compiler that extends a comment via a backslash seems like a funny WTF, but the story around it make me not even realize what the hell was the point of it (was it middle-school children, was it the code itself etc?).

    Can we please cut down on all the fancy story-telling when it just obfuscates the WTF?

    The Daily WTF has been going downhill since Alexander the Great stepped back.

  • (cs) in reply to Severity One
    Severity One:
    The three universal laws of blog replies: (1) Somebody will say "first" or "frist" (2) Somebody will complain about somebody saying "first" or "frist" (3) Somebody will write an inane comment like this one about somebody complaining about somebody saying "first" or "frist"
    Yep... If I was Alex I'd just start including those three comments in the article template.
  • Xarthaneon the Unclear (unregistered) in reply to gormless

    There's not just one TRWTF in this!

    1. This story takes place in middle school. Nothing good comes out of middle school, except Chuck Norris facts and 'That's What She Said' invocations at awkward times.

    2. The teacher nicely asked a middle school student not to write a program to take over the school. This means, that the minute he walked away, that was her first priority in life. She may or may not succeed, but still.

    3. The compiler fail. But, it makes for a distant third compared to the other two.

  • (cs)
    // ^X 
    // | 
    // | 
    // *----->Y 
    // 
    // Z down
    To me this is TRWTF. Using a right-handed coordinate system is laudable, but pointing X up and Y right is just... weird.
  • Saribro (unregistered)

    So, isn't this just an error in de text-editor's syntax highlighting?

  • Me (unregistered) in reply to ubersoldat
    ubersoldat:
    TRWTF is teaching C to a middle-school student.

    Don't get me wrong, I think C is one of the best things to happen to humanity, but using it as a teaching tool for kids doesn't seem appropriate to me when you have other tools/languages which might prove more educational and spark their interest instead of burying it below 6 feet of compiler errors.

    Hear, Hear!

  • AnonCoward23 (unregistered) in reply to Xarthaneon the Unclear
    Xarthaneon the Unclear:
    3) The compiler fail.
    No, this is *not* a compiler fail!
  • foo (unregistered) in reply to CA
    CA:
    I have never complained about the quality of the articles here until now. I think it is written somewhere that TDWTF does not post stories of students or amateurs, but instead tends to post stories of our so beloved "elite programmers". So wtf is this? Next thing you know we will be seing stories where nerdy parents complain that their 5 year old son does not know how to debug PHP.
    1. This! 2. The irrelevant story-telling that distracts from the WTF. 3. Not even pointing out the actual WTF. At best some innuendo like we all must just see what the WTF is. This has happened too often recently (anyone say "President's daughter"?) It doesn't work (a) because not all readers have the same level of expertise and (b) because ... 4. ... it's just plain wrong. Either the editor confused himself during his creative writing, or he didn't get the WTF in the first place. Just to be clear: - The backslash at the end of the line continues the comment, so the acos_1 line is commented out. That's according to the standard, and that's how GCC does it (I just verified), so it's implausible how the code should work under GCC. - “And why do those comments look funny? Everything after that backslash is colored in, like it’s not commented out.” What??? You're talking about comments which are after "that" backslash. So "that" backslash can't be the last one because there's no comment after it. So you're talking about one of the former backslashes, and it supposedly makes the following comments not be comments!? That's absurd. Any compiler, standard or not, should consider the latter "//" lines as comments, either (standard-confirming) as continuation of the previous comment due to the backslash, or (wrongly) as new comments due to the new "//". Furthermore, if they were actually not commented out, they would be syntax errors: "// | ^" is not a valid token sequence, even in C. (Also, if by "that" backslash you actually mean the last one, is still makes no sense, because if everything after the last backslash is not commented out, then the program would work as it was supposed to.) - "so the backslashes-- [...] --Are being compiled too", what does this even mean? What is the compilation of a backslash?

    TL;DR: There's actually a WTF in the code, a nice trap in ASCII art where a trailing backslash inadvertently hides the following line. Just pointing this one apparently isn't fancy enough to you, so you messed it up with (fictional) storytelling and (fictional) compiler dependencies.

    Alex, please, if your new editors can't do a better job, fire them! The only TRWTF recently has been this site itself with its butchered stories.

    Inb4: Yes, I can have all my money back I paid for reading this site, blah blah. Yet, at least I'm hoping that someone still has an interest in the quality of the articles.

  • wrojr (unregistered)

    The same code was posted in http://orbiter-forum.com/showthread.php?p=410945 by Artlav almost 3 months ago. He asks if someone can see his mistake. He produces add-ons for Orbiter, as you can see here: http://www.orbithangar.com/searchauth.php?search=artlav

    The real WTF is inventing a class, with young students, with a fictional edu-C compiler, instead of making fun of those funny comments and the importance of commenting evrything in code.

  • justsomedudette (unregistered)

    "An middle-school student" - ugh! There's nothing worse than using an instead of a; I'll assume that was a typo.

  • AC (unregistered) in reply to Steve The Cynic

    I'd give you +1 on this if this wasn't the (censored) google thing also-

  • MacFrog (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    And then there's the fun you can have with trigraphs. Because we still need to write C code on a terminal WITH UPPERCASE ONLY AND NO CURLY BRACES.
    Well, actually I once needed trigraphs (??= to be more specific) to sneak a # by a program that would otherwise not allow it - even if it was just passing on that particular serialized string of C code. But this monstrosity is another WTF entirely.

    (Or, as per captcha: dolor. - Pain. Real pain.)

  • trtrwtf (unregistered) in reply to justsomedudette
    justsomedudette:
    "An middle-school student" - ugh! There's nothing worse than using an instead of a

    Six million Jews might disagree with you on this

  • (cs) in reply to CA
    CA:
    I have never complained about the quality of the articles here until now. I think it is written somewhere that TDWTF does not post stories of students or amateurs, but instead tends to post stories of our so beloved "elite programmers". So wtf is this? Next thing you know we will be seing stories where nerdy parents complain that their 5 year old son does not know how to debug PHP.

    You know when you were about 10 years old you used to have to do Reading Comprehension? I advise you get a bit more practice in.

    The article IS about professionals... the Edu-C people, or maybe the teacher who installed it. The story actually suggests this pupil is quite bright, and crucially doesn't make her out to be the WTF.

    Clearly the WTF is this lax teachers lesson plan, having not even tested out what he was going to teach beforehand.

  • Lone Marauder (unregistered) in reply to AnonCoward23
    AnonCoward23:
    The real WTF is how this article doesn't mention this at all. And how few of the commenters understand this. Idiots, the lot of you.

    Well, to be fair not everyone that visits TDWTF is a coder by profession. I'm a network geek but still like the stories. And I wouldn't have known that you can break comments across lines without installing an IDE and testing it myself.

    But then again I'm an idiot :)

  • (cs) in reply to Zecc

    When you have three perpendicular axes, both left/right handedness AND the names you give to those axes are completely arbitrary.

    Maths doesn't stop working just because you called something X that someone else called Y.

    The real WTF is that you seem to understand coordinate systems, yet it hasn't occured to you that left/right x/y/z doesn't actually matter even in the slightest, so long as it is consistently applied.

  • (cs) in reply to ubersoldat
    ubersoldat:
    TRWTF is teaching C to a middle-school student.

    Yeah, like letting a middle-school student learn to play the pipe organ or take the part of Hamlet in a school play or learn ancient Greek.

    I think you are assuming that this particular middle-school student has never had any exposure to programming and computer science before learning C. I doubt that this is the case. Some parents and schools do allow children who take interest in a field to excel in it at an early age.

  • (cs) in reply to newfweiler
    newfweiler:
    Yeah, like letting a middle-school student learn to play the pipe organ or take the part of Hamlet in a school play or learn ancient Greek.

    Mr Stanthorpe... is that you?. Have you been stalking me all this time?

  • AnonCoward23 (unregistered) in reply to Lone Marauder
    Lone Marauder:
    I'm a network geek but still like the stories.
    Fair enough.
    Lone Marauder:
    And I wouldn't have known that you can break comments across lines
    Not just comments, but all lines.

    For example, when you're doing plain C, you tend to see this used a lot for #define in certain libraries and codebases.

    Ditto in the many UNIX shells, +newline is generally used to "escape" the newline away.

  • trtrwtf (unregistered) in reply to newfweiler
    newfweiler:
    ubersoldat:
    TRWTF is teaching C to a middle-school student.

    Yeah, like letting a middle-school student learn to play the pipe organ or take the part of Hamlet in a school play or learn ancient Greek.

    I think you are assuming that this particular middle-school student has never had any exposure to programming and computer science before learning C. I doubt that this is the case. Some parents and schools do allow children who take interest in a field to excel in it at an early age.

    There might also be a simpler assumption that learning C is a bad way to start learning to program. This is incorrect.

    Other languages are also good ways to start learning to program, but C is a fine first language. The hard part is learning to program, not learning one syntax or another. Any general-purpose language that's actually used to write real programs is probably a good language to start learning with. Mostly it's down to the teacher and the student, not the language.

    (this would exclude toy languages like LOGO and web-specific languages like PHP, as well as hipster affectations like Haskell and other esoterics, but it would include C, Lisp, Java, Ruby, and so forth)

  • (cs) in reply to trtrwtf
    trtrwtf:
    There might also be a simpler assumption that learning C is a bad way to start learning to program. This is incorrect.

    C is clearly an excellent language to start them off on... separate the wheat from the chaff early, and don't lull a bunch of morons into a false sense of capability by using something like Java.

Leave a comment on “A Bad Leg”

Log In or post as a guest

Replying to comment #:

« Return to Article