home.social

#stringcomparison — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #stringcomparison, aggregated by home.social.

fetched live
  1. Fun with Java. I developed with Java for years and love it. I hate languages providing foot-guns. Java has few, though it has. One is string comparison with '=='

    If you read

    if(itemName == "chocolate") {...}

    it is WRONG!!11!, either factually or because an idiot thinks he knows what he is doing. It has to be "chocolate".equals(itemName).

    But recently I used more Python and TypeScript, so today I wrote '==' already twice in Java code.😩

    #java #python #typescript #stringComparison

  2. CHAR vs VARCHAR Comparison Returns ZERO Rows?!

    STRING COMPARISON IS BROKEN! CHAR pads with spaces, VARCHAR doesn't! 'test' does NOT equal 'test '! Your WHERE clause returns ZERO rows! This breaks string matching! Watch!

    #sql #sqlbug #char #varchar #trailingspaces #comparisonfails #sqlfails #productionbug #sqlshorts #sqlwtf #stringcomparison #padding

    youtube.com/watch?v=aE5TuRmO_PQ

  3. String Collation Changes Comparison?!

    Collation CHANGES string comparison! Case-insensitive collation makes 'A' = 'a'. This hidden setting will break your WHERE clauses!

    #sql #sqltricks #collation #stringcomparison #casesensitivity #sqlweird #sqlquiz #codingchallenge #sqlshorts #sqlwtf #stringfunctions #advancedsql

    youtube.com/watch?v=XH-5hOj56ec

  4. Empty String '' vs NULL Are DIFFERENT?!

    SQL treats empty strings and NULL completely differently! This hidden difference breaks string logic. Your mind will short-circuit! Watch!

    #sql #sqltricks #database #sqltutorial #emptystring #null #sqlquiz #codingchallenge #sqlshorts #sqlbugs #stringcomparison #sqlwtf

    youtube.com/watch?v=MwxAtMuqq3g

  5. 'Hello' = 'HELLO' Is TRUE Or FALSE?!

    SQL string comparison case sensitivity depends on collation! Same strings can be equal or not. This breaks string matching! Watch!

    #sql #sqltricks #database #sqltutorial #stringcomparison #casesensitivity #sqlquiz #codingchallenge #sqlshorts #sqlbugs #collation #sqlwtf

    youtube.com/watch?v=Qd2Qw5nRsAI

Share on Mastodon

Enter the server where you have an account.