masterspace, (edited )

The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===

I mean technically == was deliberately designed to be a more convenient version of other languages’ == operator… Just specifically more convenient for light UI stuff since that was all JavaScript was supposed to be used for at the time (or all they thought it would be used for).

But give programmers a way to write and execute a small script and someone will eventually use that to try and write an emulator that emulates the computer it’s running on, so the web evolved into more complicated applications, and then that convenience turned out to be wildly inconvenient, not to mention horribly unexpected for programmers coming from other languages, so then they added the triple equality to match other languages.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • 200 @ entry_comment_voters
    HTTP status 200 OK
    Route name entry_comment_voters
    Has session yes
    Stateless Check no
    Time 405 ms
    Total time 405 ms
    Initialization time 92 ms
    Memory 14.0 MiB
    Peak memory usage 14.0 MiB
    PHP memory limit 128 MiB
    Logger 86
    Errors 0
    Warnings 0
    Deprecations 86
    Cache 23 in 79.22 ms
    Cache Calls 23
    Total time 79.22 ms
    Cache hits 31 / 36 (86.11%)
    Cache writes 1
    3
    Default locale en
    Missing messages 3
    Fallback messages 0
    Defined messages 118
    Security n/a
    Authenticated No
    Firewall name main
    Twig 216 ms
    Render Time 216 ms
    Template Calls 65
    Block Calls 16
    Macro Calls 6
    41 in 114 ms
    settings_row_switch 15
    user_settings_row_switch 4
    date 3
    user_inline 2
    settings_row_enum 2
    entry_comment 1
    date_edited 1
    user_avatar 1
    vote 1
    boost 1
    user_actions 1
    magazine_box 1
    magazine_sub 1
    related_magazines 1
    active_users 1
    related_categories 1
    related_posts 1
    related_entries 1
    support_us_block 1
    featured_magazines 1
    8 in 20.42 ms
    Database Queries 8
    Different statements 8
    Query time 20.42 ms
    Invalid entities 0
    Cache hits 23
    Cache misses 1
    Cache puts 1
    6.4.0
    Profiler token 5d79bf
    Environment dev
    Debug enabled
    PHP version 8.2.26   View phpinfo()
    PHP Extensions Xdebug ✗ APCu ✓ OPcache ✓
    PHP SAPI apache2handler