• AmazingAwesomator@lemmy.world
    link
    fedilink
    arrow-up
    32
    arrow-down
    4
    ·
    10 days ago

    the fact that these are strings instead of an object that is broken up by country code, area code, and number makes me irrationally angry.

    • wizardbeard@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      27
      ·
      edit-2
      10 days ago

      Could be tests for a parser to convert it from string to object.

      Not like your end users are going to type each piece into a separate field.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        10 days ago

        Is there not a “falsehoods programmers think about phone numbers” yet?

        Edit: And once again, I’m still confused about some of these. Do we need to expand unicode for names? It’s supposed to be universal. WTF is up with 40?

        • gandalf_der_12te@discuss.tchncs.de
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          9 days ago

          WTF is up with 40?

          People have names.

          I suppose that a counterexample to this might be Tibetan children, who get named at puberty, IIRC. Before that, they have no names. They are just referred to as “child” or “somebody’s child”.

          People’s names are all mapped in Unicode code points.

          I suppose a counterexample to that might be cultures which do not use script in general. Then, obviously, there’s no Unicode characters for these non-existant glyphs.

          • CanadaPlus@lemmy.sdf.org
            link
            fedilink
            arrow-up
            1
            ·
            9 days ago

            Ah, so it dovetails with the whole “children get a name reasonably fast” thing. I was interpreting that as “ever, in a natural lifespan”. My bad, haha.

            I suppose a counterexample to that might be cultures which do not use script in general. Then, obviously, there’s no Unicode characters for these non-existant glyphs.

            True, but there’s little risk of a name being entered into a form without some kind of transcription.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      11
      ·
      9 days ago

      You absolute buffoon. How do you figure this code isn’t testing how to parse a string into such an object??

    • ddplf@szmer.infoBanned from community
      link
      fedilink
      arrow-up
      5
      arrow-down
      2
      ·
      10 days ago

      You seem to enjoy overengineering your code, don’t you?

    • Clent@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 days ago

      “The number” is itself two parts hence the dash. The first section being the prefix and the last part being the line number.

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          9 days ago

          You can’t unless the tools you’re using to display tabs do it like this. None do, apart from the proof of concept programs on the site.

          But it is a cool idea.

        • MellowSnow@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          9 days ago

          It’s not “solved.” Not trying to dive into yet another tabs vs. spaces argument. But this is just another example of how tabs can be pretty neat when they’re interpreted in a specific way. But it’s up to your editor, plugin, etc. to do so. Take the same text and throw it into an editor that doesn’t use this same interpretation, and it immediately falls apart.