• Meron35@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      33 minutes ago

      MATLAB, Julia, R, Fortran, Lua.

      Imo the real point of contention is column vs row major ordering in matrices. Actually so cursed trying to move between languages.

    • Echo Dot@feddit.uk
      link
      fedilink
      arrow-up
      3
      ·
      1 hour ago

      It’s useful though. It’s more of a point when it doesn’t work.

      Anyway, there only one thing better than a sensible solution, and that’s a standard.

  • altkey (he\him)@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 hours ago

    The picture in meme made me think like it’s a europenized version of Kazuma Kiryu, who is conviniently a long-time friend with Makoto Date.

      • altkey (he\him)@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        56 minutes ago

        I want to see it no matter how bad it is.

        Btw, the 2007 LAD movie is lit if you haven’t seen it. It has a scene of drinking staminan in the middle of the fight. One of my favorite vg adaptations.

  • lime!@feddit.nu
    link
    fedilink
    arrow-up
    50
    arrow-down
    3
    ·
    7 hours ago

    arrays don’t have indices. lists have indices. arrays have offsets.

    • SorryQuick@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      2 hours ago

      Says who?

      By definition, an index is

      a number or symbol or expression (such as an exponent) associated with another to indicate a mathematical operation to be performed or to indicate use or position in an arrangement

      Since the arrays offsets alao tell us about the items’s position in the array, is it not then an index?

      People take these terms way too seriously. Hell, many languages have their “list” implemented as an array. What then do you call the index/offset?

      • lime!@feddit.nu
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        2 hours ago

        if you want my opinion (<- see now you can’t tell me i’m wrong, it’s an opinion) then the difference is that an array is by definition a memory address that’s designated as the beginning of an array, and it’s got an offset because the first element is at that specific address and further items are offset from that address. so you add the offset to the address to get the nth item. a list, meanwhile, can be basically any implementation under the hood, but it’s commonly a linked list. the way you get the nth index there is you count up from the first position. since the implementation is opaque and may be spread out in memory you can’t arithmetic your way to an index, you need to follow the pointers.

        java’s arraylist is a list backed by an array. java’s vector is a list backed by a linked list.

        • SorryQuick@lemmy.ca
          link
          fedilink
          arrow-up
          1
          ·
          1 hour ago

          That doesn’t really address what you call it. Names only really just exist to get your point across. Inexperienced devs may not know what an offset means (or why we use that), so index does the job. An experience dev knows how it works anyway, so whether you say index or offset won’t matter. By virtue of the common denominator, I simply use index everywhere.

    • turdas@suppo.fi
      link
      fedilink
      arrow-up
      13
      ·
      6 hours ago

      §6.7.9 of the C11 standard says they have elements with indices:

      If an array of unknown size is initialized, its size is determined by the largest indexed element with an explicit initializer. The array type is completed at the end of its initializer list.

      • lime!@feddit.nu
        link
        fedilink
        arrow-up
        7
        arrow-down
        2
        ·
        5 hours ago

        it also states in section 6.7.7 (“type names”) that

        If the pointer operand points to an element of an array object, and the array is large enough, the result points to an element offset from the original element such that the difference of the subscripts of the resulting and original array elements equals the integer expression.

        note also that your example is the only occurrence of the word “index” in the entire document that isn’t just referring to the actual index at the end.

      • lime!@feddit.nu
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        6 hours ago

        javascript doesn’t have arrays. the backing data structure is a doubly-linked list.

        • qprimed@lemmy.ml
          link
          fedilink
          English
          arrow-up
          6
          ·
          5 hours ago

          and the backing for that is linear or page addressed MOS transistors, spinning rust or flippy-round magnets.

          do you have a source that indicates mainstream JS engines internally uses a list structure for arrays? I can’t find one.

          • lime!@feddit.nu
            link
            fedilink
            arrow-up
            5
            arrow-down
            1
            ·
            3 hours ago

            skipped a few steps there i think.

            anyway, good question. led me to some cursed code.

            the ArrayObject in spidermonkey is an interface to either a TypedArrayObject or a SharedArrayObject. those both have an inner ArrayBuffer object, which is a view into ArrayBufferObjectMaybeShared, which contains a refcounted vector of uint8 pointers, regardless of the datatype. soooo all arrays in javascript are… strings?

            • qprimed@lemmy.ml
              link
              fedilink
              English
              arrow-up
              4
              ·
              3 hours ago

              skipped a few steps there i think.

              thanks for the considered reply. didn’t mean to jump all the way down to electrons and sound so flippant.

              my claim is that JavaScript arrays are arrays because the spec defines their behavior as such. the implementation details are absolutely interesting from a performance perspective and I was genuinely curious how an internally linked list implementation would actually work, real-world. regardless… almost every interaction I have ever had with a JS programmer has ended in “its strings all the way down”… so… I mean… yes-ish?

              loved your poking of the hornets nest in this thread :-)

              • lime!@feddit.nu
                link
                fedilink
                arrow-up
                2
                ·
                2 hours ago

                i was thinking between the linked list and the transistors :)

                also, i mean… what you might call an array i might call a vector. js arrays allow elements of different types, so they are by definition not arrays in the traditional sense. them being chars internally does make sense in a gross way.

  • auzy1@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    2 hours ago

    Not in my household. In some cultures the concept of 0 doesn’t even exist

  • dohpaz42@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    6 hours ago

    There is no second date because YYYY-MM-DD'T'HH:ii:ss'Z' is the only acceptable date.

  • [object Object]@lemmy.ca
    link
    fedilink
    arrow-up
    16
    arrow-down
    3
    ·
    6 hours ago

    Djikstra was so fucking wrong with this and people who parrot this are so annoying.

    Sure, an offset starts at zero, but an index can very well start at one. Not all arrays represent a physical offset, please stop pretending your inferior zero only indexing is in any way superior.

    Sometimes math is just simpler from one. When you’re translating math to code, one based indexes are usually better.

  • HalfSalesman@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    2
    ·
    4 hours ago

    If you can’t let your obsessions and natural thoughts all hang out with a person… were they partner mater- wait, well, you can’t do this with allistic people at all as an autistic person and allistics make up like 99% of the population.

    Always have to filter your thoughts at first. Let that stuff out in drips. Then once comfortable you let it all hang out.

    • boonhet@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      Ah then partner material needs to be autistic too.

      Not autistic, but I have ADHD and also feel the need to filter my thoughts with a lot of people, which is a bit difficult given the “blurt my thoughts out” disorder. I’ve begun to understood they’re not partner material for me, through no fault of their own.