• (nodebb)

    Some code just makes me want to cURL up and cry.

  • (nodebb)

    "I need to do something with cookies for this request. Oh hey, that option says COOKIE in it, let me try that! Hmm, that didn't work, how about this other cookie option? Nope, maybe this third one? Perfect!" -- the dev who wrote this and didn't RTFM, probably

  • LegacyWarrior (unregistered)

    I'll be charitable to the original developer and assume that their use of $interval is supposed to mean "should a single request take longer than the intended interval time, we should just timeout the request"

  • (nodebb)

    If all the places where they copy the code don't use the result, it probably means they're just triggering some side effect on the server. You're not supposed to do that with GET requests, but why would people who write code like this worry about a detail like that?

  • Álvaro González (github)

    Curl is the masterpiece of a real genius: robust, reliable and feature-packed, and also a terrible mess for us average people to understand and use.

    I use the command-line tool everyday, because it's the common export format of all my other tools, but in my PHP code I often preferred stream wrappers, and I ditched it entirely when I discovered Symfony HTTP Client.

    Said that, the story has a happy ending: his predecessors could not make the app work!

  • Hmmmm (unregistered)

    Looks like the code falls squarely into refactor 101. The customer will be surprised when the whole thing (as-is) can be replaced with just 1000 lines of code or less.

  • (nodebb)

    Everything Old Is New Again: back when VT100 was the cutting-edge terminal, I helped out a bit in the computer lab. The number of times some kid thought their code was broken because it didn't show the answer.... when they had no PRINT statement..

  • Loren Pechtel (unregistered)

    Got bored? Or got put on something more urgent and that this wasn't finished was forgotten.

  • Chris Hennick (github)

    Is there a better alternative to cURL for Rust code that has a legitimate use for query parameters over 64KiB?

  • Fizzlecist (unregistered)

    cookie, cookie, cookie starts with c... Am I the only one who now can't get the Cookie Monster out of my head?

  • cookieEater (unregistered)

    setTimeout is how you schedule things in Javascript (though it's not the right way to schedule periodic actions, but that's nothing a little trip to callback hell can't fix if you are hammer-minded). Looks like work of someone with surface-level understanding of Javascript and surface-level of understanding of... basically every programming concept

  • OldCoder (unregistered) in reply to Chris Hennick

    If your query parameters are over 64KiB in size then I suggest you have other problems. That's data, not an instruction or a filter.

  • (nodebb) in reply to Chris Hennick

    legitimate use for query parameters over 64KiB

    I liked the subtle "legitimate" nonchalantly dropped in there. Let me guess, someone didn't want to bother with POST data and stuck everything in query params, and now somebody else has to deal with that mess?

  • Willem (unregistered) in reply to Hmmmm

    But we all know we should never be removing lines-of-code from a product? That's negative productivity. Always only ADD code.

Leave a comment on “Never Eating the Cookie”

Log In or post as a guest

Replying to comment #703430:

« Return to Article