• (cs)
    Alex Papadimoulis:

    <font face="Courier New">%REM
    This agent has the "On Error" swithced on. If the agent does not run the first thing to do is comment this out.
    This will help find the error and save you lots of time.
    %END REM</font>




    I'm guessing this code has really good error handling in it, yeah?
  • (cs)

    That second one has the smell of LotusScript about it, and I'm pretty sure I've maintained that guy's code once or twice myself. For those of you who aren't familiar with the environment, the error logging available for LotusScript is incredibly rich, which allows debugging of code errors under conditions which a developer could not hope to simulate on his own machine(s) or with his own test ids. That, however, requires that On Error statements remain active....

  • (unregistered)

    But "i" is never given a value. This code won't even run.

    What would we do without VB programmers to give us all this great material?

  • (cs) in reply to

    "i" not getting a value is only a problem if uerr(Integer) or verr(Integer) actually use their argument... which we can't assume...

  • (cs)

    I don't know if the first section is that much of a WTF. The programmer probably put the comments in before writing in the function guts, and didn't bother (or forgot) to take them out after finishing.

    I think a true WTF features an obvious intent to bypass all accepted ways of doing things and re-invent as many things as possible.

    They tell you to comment code only if it needs to be explained in detail (uber h4x0r tricks, sectioning off involved chunks of code, etc.). 

    I guess, the reverse suggestion (from me) would be to ignore comments for code that is painfully obvious. It's kinda like mulitple semicolons in C-based languages. Unnecessary, but harmless.


  • (cs) in reply to DJDanny
    DJDanny:
    [image] Alex Papadimoulis wrote:

    <font face="Courier New">%REM
    This agent has the "On Error" swithced on. If the agent does not run the first thing to do is comment this out.
    This will help find the error and save you lots of time.
    %END REM</font>




    I'm guessing this code has really good error handling in it, yeah?


    You bet it does, it's got *the best* error handling: 'On Error'. Absolutely no errors occur! - It's like magic.[;)]
  • (cs) in reply to
    :
    But "i" is never given a value. This code won't even run.

    What would we do without VB programmers to give us all this great material?



    Yes, without VB programmers all code would be perfect and this website would not exist.[8-)]
  • (cs) in reply to
    :
    But "i" is never given a value. This code won't even run.

    What would we do without VB programmers to give us all this great material?



    That's not true. The variable i is declared, and then gets its default value, being 0. Visual Basic doesn't have a concept of an "uninitialized" variable, just like C#. I'm quite sure this would trigger a compiler warning, though.

    It's interesting though, that only the first items of the array would be saved :).
  • (cs)

    Gotta love the comments about the language, instead of comments about the implementation. Maybe he needed them to remind himself. Maybe he also has:

    %REM
    See, this is what we call a FUNCTION. It takes a value, performs some action, then returns an answer. Please don't forget to send a value. Although you sometimes don't need to return an answer. Or maybe its take an answer, even if the function gives you one. I'm so confused.
    %END REM

    and maybe further down...

    %REM
    Right here I'm declaring the variables. We use variables to hold information that we can use later in the program. Let me explain what I mean by "program" ...
    %END REM

    and my all-time favorite

    %REM
    This section performs different actions depending on where the user clicks. With a mouse. You know, that eraser-shaped thing on the right-side of the keyboard? With the buttons on it? Yeah, that. Anyway, when the user clicks on different buttons. And by buttons I mean those pushy things that go up and down...
    %END REM

  • (cs)

    Let's change the comments to...

    ' This is the section that I did comment

    and

    ' This is the section that I did not comment

    (Or, if you prefer)

    ' These comments intentionally left blank


    "It is a far, far better thing I do than I have ever done before."

  • (unregistered) in reply to fcarlier

    This site mostly covers VB, ASP, C#. What happened to major languages like C++, Java, PHP, Perl...?

    VB, ASP, C# are for idiots, programmers know better.


    Or is this site sponsored by Microsoft? [*-)]

  • (cs) in reply to

    Yes, I'm sure Microsoft wants a site dedicated to how poorly code can be written in their proprietary languages. The WTFs depend on submissions. If you know of any foul-smelling Python, Perl, C or, for that matter, COBOL, Lisp or APL, send it along (along with a downloadable font if you actually DO submit any APL). Especially desired: Java WTFs to make the "Java is everything" crowd feel a bit more at home. C'mon, folks, there's a lot of overaged cheese on other platforms too. (Most of what I do concerns itself with an object model that most of you wouldn't be interested in seeing, so there's not much point in me submitting the crud I come across.)

  • (cs) in reply to Stan Rogers

    Oh, come on, Stan Rogers. Do tell. You got me all interested in what you work with now, I want to hear (or see?). Could be fun... never know.


    This is a let-down-WTF, but it's still pretty funny. Useless commenting. I inherited code once that said...

    // TODO: Comment code

  • (cs) in reply to Jacob K

    To those who are incapable of clicking on my name to go to my profile, I work mostly with Lotus Notes and Domino. In LS, VB.NET, C#, Java, with more than a little dabbling in DHTML. Oh, and an incredibly powerful array-oriented macro language that looks at first blush like a toy of sorts.

    I can hear it now. Notes? WTF? Well, folks, there's a lot of "there" there, and the platform is something you either get or you don't. (And no, it isn't the first or only programming I've done.) One day I was fighting the whale, wondering what the hell was on the end of the line, then I had a moment of Zen and became one with the Lotus. It IS a baffling platform to most people, though, and our WTFs tend to come from a complete misunderstanding of the structure of the platform rather than merely from poor procedural programming or language abuse. It's funny, but it's usually an "in" joke.

  • (cs)

    Comments :P

    How about regions?

    I find classes with a common set of regions, so when you use "collapse to definitions", you see that the class has :S
    Fields
    Constructors
    Properties
    Methods
    Implementation
    Overrides

  • (unregistered) in reply to
    :
    This site mostly covers VB, ASP, C#. What happened to major languages like C++, Java, PHP, Perl...?

    VB, ASP, C# are for idiots, programmers know better.


    Or is this site sponsored by Microsoft? [*-)]
  • (cs) in reply to

    hmm.. somehow this crazy asp forum isn't entirely firefox compatible it seems... at least when i try to quote someone my comments get lost...
    what i was trying to say:
      if you want i can show you some realy wtf-like php code from a project i'm working on...

  • (unregistered) in reply to

    <font face="Arial" size="2">I suppose you think you're smarter than </font><font size="-1"><font face="Arial" size="2">Anders Hejlsberg</font>?</font>

  • (unregistered) in reply to
    :
    This site mostly covers VB, ASP, C#. What happened to major languages like C++, Java, PHP, Perl...?

    VB, ASP, C# are for idiots, programmers know better.


    Or is this site sponsored by Microsoft? [*-)]
  • (cs) in reply to

    Wow, this has got to be THE most ignorant post I've ever read on this site.

    I'm surprised that the 's' Microsoft wasn't a '$'.

    Go away troll.

  • (cs) in reply to
    :
    This site mostly covers VB, ASP, C#. What happened to major languages like C++, Java, PHP, Perl...?

    VB, ASP, C# are for idiots, programmers know better.


    Or is this site sponsored by Microsoft?


    *Sorry about previous post, the quote option didn't work for me.

    Wow, this has got to be THE most ignorant post I've ever read on this site.

    I'm surprised that the 's' Microsoft wasn't a '$'.

    Go away troll.
  • (cs) in reply to skicow

    <font style="BACKGROUND-COLOR: #efefef">

    <font size="2">Wow, this has got to be THE most ignorant post I've ever read on this site.

    I'm surprised that the 's' Microsoft wasn't a '$'.

    Go away troll. </font>
    As i have mentioned a few times, if Alex would do away with Anonymous posts, these timid idiots would not bother posting this way. If we are going to comment and judge other code snippets, we should be accountable, this only seems fair. I have seen many poor examples of code (and have done some myself) that when taken in the proper context, are completely understandable. These poodle posters are not worth our time.. drew..</font>

  • (unregistered) in reply to Free

    what's wrong with it? (Except implementation region) [*-)]

  • (unregistered) in reply to

    Sry this belong to Free's post about regions [:$]

  • Sebastian Ramadan (unregistered)

    http://www.d-e-f-i-n-i-t-e-l-y.com/

    Also, "usefull" and "immagine"...

    This site mostly covers VB, ASP, C#. What happened to major languages like C++, Java, PHP, Perl...?

    VB, ASP, C# are for idiots, programmers know better.

    Or is this site sponsored by Microsoft? [*-)]

    "C# is for idiots", yet you list Java which is mostly a subset of C# with a slightly different syntax. In fact, some of the features C# has that Java doesn't are extremely useful, such as anonymous functions... But you wouldn't know about those, right, because you're not an idiot?

    PHP was designed by someone who, in his own words, doesn't like programming, for people who don't like programming.

    Don't list C++ and PHP in the same sentence like that; C++ has a concept of undefined behaviour due to standardisation. PHP hasn't yet been standardised, even ten years after your ignorance. Worse yet, it relies upon undefined and implementation-defined behaviour, without even documenting where these behaviours occur! If you program in PHP, expect your programs to break... and you'll be at the whim of a corporation (PHP.net) to provide a bug fix, at your expense.

    Fucking retard!

  • Sebastian Ramadan (unregistered)

    Ohh, I should also add: C# has been standardised by a non-Microsoft organisation as ECMA-334 (google it). Java doesn't have such independent standardisation; Java is exclusively owned by Oracle, the same way that C# was once (but is no longer) exclusively owned by Microsoft...

    ... and Oracle is, at the time of speaking, quite the evil little shit itself. Might even be more evil than Microsoft, not that Microsoft is exclusively attached to C# anyway. See for yourself: Google "list of C# implementations" and you'll find more than one.

Leave a comment on “A Tale of Two Comments”

Log In or post as a guest

Replying to comment #:

« Return to Article