• Rednax@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    2 days ago

    I remember a javascript library where the was a function that returned, according to the documentation, “a color”. Did it return an object with 3 fields? Were those fields RGB or some other color scheme? Is it a string encoding a color? What format is that string? None of these questions could be answered without just running the code, and analyzing the object you got back.

    • Scrubbles@poptalk.scrubbles.tech
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      { r, g, b}, hex code, rgb encoded in some stupid format, types are just helpful. I don’t know why people don’t like them. 30 seconds of creating a class for your type saves you hours of debugging later