Matlab pls

Programmer Meme about Matlab pls

Share This, It Ain't Much, But It's Honest Work:

Related Programmer Memes:

25 Comments on “Matlab pls

  1. https://en.wikibooks.org/wiki/Ada_Programming/Types/array

    Would you like an array that goes from -10 to 351? Ada can do that.

  2. Here’s the key difference: array indices in normal programming languages are offsets, not ordinals. `Array[0]` does not mean the “zeroth” element, but rather that it’s the element with 0 offset from the beginning. It’s still the “first”. This started in very low-level languages for which this abstraction makes sense, and it became the norm for later programming languages simply by convention. It’s what makes sense for *us programmers*.

    Indices in *mathematial* languages, on the other hand, *are* ordinals. Since these languages are targeted toward people outside our field, and don’t really care about memory layout, there’s no reason to stick to the “[0] is first element” convention. It’s much easier to teach someone that index 1 is element 1, 2 is 2, 3 is 3, and so forth.

    tl;dr: for `array[n]`, n is an offset in C, or an ordinal in math languages.

  3. Fortran does that, perhaps this is because is more math oriented ¿?

  4. Don’t diss Fortran! It’s a good language

  5. Math is probably the most natural language ever invented (or discovered?). Going by natural language logic, the first element is usually the 1st, not the 0th. But how boring would life be without layers of indirection. 😉

  6. COBOL looks up from the corner, goes back to eating paste.

  7. Lua does the same thing and it always trips me up.

  8. I like to think of the index like a birthday. The day you are born (technically your first birthday) you are 0. So the first index is 0.

  9. The people who keep upvoting/reposting index memes are programming gods.

  10. My actual reaction using a system or language or whatever where arrays start at 1: “Oh OK, fair enough”.

  11. Matrices and Vectors start at Zero, ahhhhh!

  12. You could use dictionary “container” and start at 0 xD

  13. Tell me if im wrong but cant you make arrays in Pascal start at any number or even character?
    So a for loop would look like this, FOR char i := ‘a’; i < ‘z’; i++DO or something like rhat

  14. As someone going between python and Matlab, can confirm.

  15. Facepalm. Matlab ain’t no programming language fool!

  16. I’m actually in a Matlab class right now for my physics major and, coming from a computer science major, I’ve had to really adjust to it. First day we went over arrays and the prof was typing an array call and used one to call the first index and it blew my mind.

Leave a Reply

Your email address will not be published. Required fields are marked *