• (nodebb)

    This is the first comment by position. Please do not use if blocks depending on count of comments.

  • Prime Mover (unregistered)
    //Frist = Comment.QueryString(0);
    //dammit, missed
    Frist = Comment.QueryString(1);
    
  • Flips (unregistered)

    nguid = Request.QueryString[Request.QueryString.Count-1]

  • X (unregistered)

    TRWTF is the MMDDYY date format.

  • (nodebb)

    TRWTF is the NameValueCollection and its use to represent query parameters. I can think of only one possible reason behind that: to emulate how PHP works.

  • Steve (unregistered) in reply to Flips

    nguid = Request.QueryString[Request.QueryString.Count-1]

    But that's just reiterating the original WTF - what if the parameter you want isn't at the last position?

    Just pick the thing up by name and all the WTF-ery goes away

  • Scott (unregistered)

    This reminds me of idiot consultants I used to work with. Always left huge chunks of code in, but commented out, because "what if we need that again?" and "looking at changes in source control is too hard"

    a) What if you idiots understood the problem, and developed software to solve it? b) Learned to use the tools given you to see deltas over time.

    Needless to say, it was orders of magnitude harder trying to figure out their shitty code with all this commented-out code laying around, so I always removed it.

  • (nodebb) in reply to Scott

    , so I always removed it.

    and generated huge deltas for the rest of the team to look through. :-)

  • WTFGuy (unregistered)

    @Kamil Podlesak Ref:

    TRWTF is the NameValueCollection and its use to represent query parameters. I can think of only one possible reason behind that: to emulate how PHP works.

    So what would you propose should have been the way the Request object surfaces the querystring in a safe and easy to use manner?

  • NoLand (unregistered)

    The real problem is providing access to query parameters by index at all. These are named parameters by definition.

    (What's you name? – The second one. – So it's "Secundus"? – No, it may be well the first one. – "Primus"? – No, really, you just have to get the first one, that is, most of the time.)

  • (nodebb) in reply to Scott

    Our code is so full of #ifdef DEBUG_CONDITION that I've written an Emacs mode for hiding those blocks. Comments are the second bad thing; Old code parts in particular are more comment than code thanks to dated guidelines. Sadly, the comments describing the call interface of the functions are typically quite short, often only repeating what the function name already told me.

  • ZZartin (unregistered)

    The real problem is providing access to query parameters by index at all. These are named parameters by definition.

    I'm guessing the parameters are coming back as a hash table and whatever this is coded in allows array indexing to be used on it.

  • NoLand (unregistered) in reply to ZZartin

    I'm guessing the parameters are coming back as a hash table and whatever this is coded in allows array indexing to be used on it.

    As far as I remember, nothing in the CGI protocol guarantees that parameters will be in order in the query string (while they will be in practice). Even worse, empty parameters may be missing, as is the case for empty checkboxes. So the effective order varies, depending on the options chosen by the user. Access by index doesn't make sense at all. (If you subclass a general collection class, please, overwrite the default access by index, if there's any, as this raises unjustified expectations and provokes errors.)

  • ma (unregistered)

    How bout putting dem code changelogs in dem source repository commits?

  • (nodebb)

    "#ifdef DEBUG_CONDITION" may be quite valid if there are testing (with recompiles) on an ongoing basis.

  • giammin (unregistered) in reply to Flips

    are you the original developer?

Leave a comment on “Leave Some Comments Behind”

Log In or post as a guest

Replying to comment #524176:

« Return to Article