• (nodebb)

    What is "WITH UR" even supposed to do? What SQL dialect is this? I'm genuinely curious.

  • Strongarm (unregistered) in reply to Mr. TA

    DB2 Uncommitted Read Allows it to read without locking the table.

  • (nodebb)

    Maybe it produces output in Assyrian?

  • (nodebb)

    Ironically using SQL COUNT itself is often a code smell. Yes, in the past it was required for pagination previews (which always was an unreliable estimate anyway) but UX has evolved since then and endless scrollers eliminated the need for it. Sure, there are use cases where you have to aggregate data in a certain way, but those are highly limited. So seeing this method I wonder if there are bigger architectural issues at play in general.

  • (nodebb) in reply to Mr. TA

    Isolation level, uncommitted read. I think it's an IBM thing, I vaguely remember it seeing it working for a client using DB2 but that was ages ago, don't take my word for it.

  • Pabz (unregistered)

    Which is worse - programming by Google, Stack Overflow or ChatGPT?

  • Foo AKA Fooo (unregistered) in reply to Pabz

    Either ChatGPT or TDWTF, it's close.

  • Foo AKA Fooo (unregistered) in reply to MaxiTB

    Highly limited? I think you severely misunderestimate the diversity of programming jobs. My code base has a quite a few SELECT COUNT instances, and only a few of them are for pagination (which, BTW, I as a user still prefer to endless scrolling, mostly, well, because you don't have to scroll endlessly ...)

  • (nodebb) in reply to Pabz

    Stack Overflow often has great answers (at least for .net) but it's often not the most upvoted one; always check out the second answer as well. Obviously .net evolves greatly so a 5 year old answer might be completely wrong, so it's important to consider the date as well.

    However that should be a starting point, the answers are the now where the research starts if they hold up ground. A web search engine is useful in that regard but be prepared to encounter a lot of garbage.

    Finally ChatGPT is completely useless if you are not already an expert in the topic anyway. It confidently recommends anti-patterns, not thread-safe code (race conditions) and outdated solutions with known security vulnerabilities. So for experts it's pointless to use beyond having fun with a silly toy and for non-experts it can be outright dangerous.

  • Darren (unregistered) in reply to Pabz

    A truly 'gifted' programmer will use all three!

  • (nodebb) in reply to thosrtanner

    Babylonian laughs at your Assyrian syntax! The code of Hammurabi is clearly superior.

  • (nodebb) in reply to MaxiTB

    endless scrollers eliminated the need for it

    Get thee behind me endless scrolling.

    Endless scrolling is horrible for anything except smallish result sets. I suggest we all move to pagination to eliminate the need for endless scrolling.

  • (nodebb) in reply to Darren

    A truly 'gifted' programmer will use all three!

    you forgot the rest of the sentence: "... to know definitively what NOT to do."

  • Zatapatique (unregistered) in reply to MaxiTB

    Oracle also has a WITH clause for subquery's: https://oracle-base.com/articles/misc/with-clause.

  • (nodebb)

    For anyone interested in the UX considerations around endless scrolling, check out this summary from the Nielsen Norman Group: https://www.nngroup.com/articles/infinite-scrolling-tips/

  • Richard Brantley (unregistered) in reply to MaxiTB

    "However that should be a starting point, the answers are the now where the research starts if they hold up ground."

    I am reminded of my English teachers who said, "write it in your own words." I wish more people took things like Stack Overflow as a learning opportunity and not a coding familiar.

  • know (unregistered)

    By the way, what is count?? It is incremenred at each reply row nut I do not see it declared or initialized. Perhaps, it is a global variable counting all reply rows received throughout the run?

  • Conradus (unregistered) in reply to Mr. TA

    "What is "WITH UR" even supposed to do? What SQL dialect is this? I'm genuinely curious."

    It's short for "WITH UR MOM".

  • Industrial Automation Engineer (unregistered) in reply to Pabz
    Comment held for moderation.
  • Argle (unregistered)

    Me reading stack overflow: "Didn't anyone bother to read this person's question? Spew based on keywords isn't an answer."

    Me with ChatGPT:

    ChatGPT: Here is a totally bogus solution to your question that looks like it might work.

    Me: That's wrong and will throw an exception.

    ChatGPT: I'm sorry about that. Here's an alleged correction.

    Me: You're pretty worthless.

    ChatGPT: I humbly apologize and offer yet another bad solution as penance.

  • (nodebb) in reply to Argle

    Yeah, well the problems with any LLM trained using code that's freely available on the Internet are encapsulated neatly in Sturgeon's Revelation: "ninety-percent of everything is crud".

    And in context, the particular slice of "everything" that's interesting is "software". Not just "code that's freely available on the Internet", but all of it. So we train the LLM on code that's 90% crud, and we expect the LLM to somehow generate actual good code...

  • JJ (unregistered) in reply to MaxiTB
    Comment held for moderation.
  • Fizzlecist (unregistered)

    "The query contains a WITH clause, but it's in the wrong spot". If it's DB2 SQL (which it looks like) then it's in the right spot

  • xtal256 (unregistered)

    "Easy Reader Version: If you don't understand the code, don't commit it"

    I initially read that as "... don't vomit it", which somehow seems even more appropriate.

  • xtal256 (unregistered)
    Comment held for moderation.
  • (nodebb) in reply to Foo AKA Fooo

    I'm with you, can't stand this endless scrolling nonsense.

    Give me good ol' pagination any day of the week.

Leave a comment on “A Matter of Understanding”

Log In or post as a guest

Replying to comment #:

« Return to Article