When 1024x768 is too much (bringing back the fullscreen thread)



  • @joe.edwards said:

    @morbiuswilters said:
    @joe.edwards said:
    I end up writing in over a dozen different languages in the course of my day-to-day activities and the fewer core concepts that change between them, the more of my sanity I get to retain.

    But there are so many other differences between languages to remember. I mean, if you can't remember how to do indexes, how do you work with different OO models or memory management or scope or anything like that?

    Actually those are easier to switch modalities because they're inherently dissimilar. The array indexing one is a tripping stone because it looks just the same but isn't.

    I still think it will be pretty easy to catch. For example, the first time you write a for (int i = 0 ...) loop, the code is gonna error out since there's no index 0. And this isn't C, so out-of-bounds conditions will raise errors instead of overwriting arbitrary memory.



  • @morbiuswilters said:

    @joe.edwards said:
    @morbiuswilters said:
    @joe.edwards said:
    I end up writing in over a dozen different languages in the course of my day-to-day activities and the fewer core concepts that change between them, the more of my sanity I get to retain.

    But there are so many other differences between languages to remember. I mean, if you can't remember how to do indexes, how do you work with different OO models or memory management or scope or anything like that?

    Actually those are easier to switch modalities because they're inherently dissimilar. The array indexing one is a tripping stone because it looks just the same but isn't.

    I still think it will be pretty easy to catch. For example, the first time you write a for (int i = 0 ...) loop, the code is gonna error out since there's no index 0. And this isn't C, so out-of-bounds conditions will raise errors instead of overwriting arbitrary memory.

    Let's say you have an array. What would you write to get the element four after the start?



  • @morbiuswilters said:

    I still think it will be pretty easy to catch. For example, the first time you write a for (int i = 0 ...) loop, the code is gonna error out since there's no index 0. And this isn't C, so out-of-bounds conditions will raise errors instead of overwriting arbitrary memory.

    Although a language that modern should have a foreach for looping over an array.

    Alternate topic: Negative indexes. Why aren't they a thing?



  • @MiffTheFox said:

    @morbiuswilters said:
    I still think it will be pretty easy to catch. For example, the first time you write a for (int i = 0 ...) loop, the code is gonna error out since there's no index 0. And this isn't C, so out-of-bounds conditions will raise errors instead of overwriting arbitrary memory.

    Although a language that modern should have a foreach for looping over an array.

    Alternate topic: Negative indexes. Why aren't they a thing?

    Why not make a float-indexed array so we can have array indexes that don't equal themselves?



  • @Ben L. said:

    Why not make a float-indexed array so we can have array indexes that don't equal themselves?

    Because IEEE floating point is evil.



  • @Ben L. said:

    Let's say you have an array. What would you write to get the element four after the start?
    Poe's Law applies. I can't tell if that was sarcasm or not. You mean the 'fifth' element?



  • @Ben L. said:

    Let's say you have an array. What would you write to get the element four after the start?

    In what language? And does "the element four after the start" mean? The fourth element?



  • @MiffTheFox said:

    Although a language that modern should have a foreach for looping over an array.

    Yes, but simple iteration isn't the only case here. I'm just saying if you did a for (int i..) loop, you'd catch an underflow error a lot sooner than an overflow one (since your first array access would throw an error). There are plenty of other places this zero-indexing stupidity persists, too, like strings: how come those start at zero?

    What's really annoying are Java's PreparedStatements where parameters start at index 1. This is a language where January == 0. WTF.



  • @morbiuswilters said:

    @MiffTheFox said:
    Although a language that modern should have a foreach for looping over an array.

    Yes, but simple iteration isn't the only case here. I'm just saying if you did a for (int i..) loop, you'd catch an underflow error a lot sooner than an overflow one (since your first array access would throw an error). There are plenty of other places this zero-indexing stupidity persists, too, like strings: how come those start at zero?

    What's really annoying are Java's PreparedStatements where parameters start at index 1. This is a language where January == 0. WTF.

    Strings are a good case for 1-based indexes, since string manipulation prefers to refer to the spaces between the characters rather then the characters themselves, but only if the runtime supports negative indexes, like so:

    [Diagram showing strings indexes]

    To use negative indexing with 0-based indexes, you either have to use 1-based for negative indexes, or use a -0 value, which makes people cry.



  • @Everyone said:

    indexes

    Never mind 1s and 0s. It's "Indices", not "indexes", you bastards.



  • @morbiuswilters said:

    @Ben L. said:
    Let's say you have an array. What would you write to get the element four after the start?

    In what language? And does "the element four after the start" mean? The fourth element?

    For example, in C/C++/C£/Go/Java/JavaScript/Python/Perl/PHP, the syntax is myArray[4].

    In MIPS assembly, it's lw $a0 4($a0)



  • @MiffTheFox said:

    @morbiuswilters said:
    @MiffTheFox said:
    Bullshit
    Ben L. will ignore our posts and just post something unrelated, so why bother?
    I agree, toasters make lovely dildos.

    String indexes, if negatives are allowed, are defined as Index = Distance from first character (mod Length).

    FUCKCS
    012345
    -6-5-4-3-2-1
    Length = 6


  • @nosliwmas said:

    It's "Indices", not "indexes", you bastards.

    The Romans called, they want their--oh wait no they didn't because they've all been dead for a long-ass time.



  • @Ben L. said:

    For example, in C/C++/C£/Go/Java/JavaScript/Python/Perl/PHP, the syntax is myArray[4].

    So you're talking about the fifth element, then. (Although, to be completely accurate, it should be the fourth element since indexing starts with the zeroth element.. This is a convention I'm going to insist defenders of 0-based indexing follow.)

    @Ben L. said:

    In MIPS assembly, it's lw $a0 4($a0)

    Pfft.. MACRO-11 had three separate instructions just to specifically access the fourth offset from an address.

    (Also, you're assuming the array is made up of words. This was an unspecified technical requirement when you first issued the specification, so I'm sending it back for correction.)



  • @morbiuswilters said:

    @Ben L. said:
    For example, in C/C++/C£/Go/Java/JavaScript/Python/Perl/PHP, the syntax is myArray[4].

    So you're talking about the fifth element, then. (Although, to be completely accurate, it should be the fourth element since indexing starts with the zeroth element.. This is a convention I'm going to insist defenders of 0-based indexing follow.)

    @Ben L. said:

    In MIPS assembly, it's lw $a0 4($a0)*

    Pfft.. MACRO-11 had three separate instructions just to specifically access the fourth offset from an address.

    (Also, you're assuming the array is made up of words. This was an unspecified technical requirement when you first issued the specification, so I'm sending it back for correction.)

    • note that this only works when a word is one byte long and each record is simultaneously a single word and a single byte in length.


  • @Ben L. said:

    * note that this only works when a word is one byte long and each record is simultaneously a single word and a single byte in length.

    I thought MIPS used 4-byte words.

    I think the real lesson here is that trying to get clever with array addressing just might make you look like a jackass. Hence, 1-based arrays are superior.



  • @morbiuswilters said:

    @Ben L. said:
    * note that this only works when a word is one byte long and each record is simultaneously a single word and a single byte in length.

    I thought MIPS used 4-byte words.

    I think the real lesson here is that trying to get clever with array addressing just might make you look like a jackass. Hence, 1-based arrays are superior.

    I think the real lesson here is that trying to get sensible with array addressing just might make you look like someone incapable of communicating efficiently with a computer. Hence, -based indexing.



  • @Ben L. said:

    I think the real lesson here is that trying to get sensible with array addressing just might make you look like someone incapable of communicating efficiently with a computer.

    I don't think you're making sense here. For one, who the hell is talking about assembly? For two, weren't you the guy who just tried to show off addressing an array in assembly and generated a CPU error? I'll take correct code that uses a few more instructions over fast code that does the wrong thing. Isn't that what the last 50 years of language development have been?

    For a high-level language, address offsets are a irrelevant. Even for C, it's not like you couldn't just have the compiler hide the sausage-making of 1-based arrays from you, but I already said there was no point trying to fix C--there are a dozen worse things in C than 0-based indexing.





  • @Ben L. said:

    @MiffTheFox said:
    @morbiuswilters said:
    @MiffTheFox said:
    Bullshit
    Ben L. will ignore our posts and just post something unrelated, so why bother?
    I agree, toasters make lovely dildos.

    String indexes, if negatives are allowed, are defined as Index = Distance from first character (mod Length).
    Length = 6

    FUCKCS
    012345
    -6-5-4-3-2-1

    First off, that's a mix of 1 and 0-based, like I talked about.

    Second off, those aren't positions between characters, those are characters. If I said "insert a '*' at position 3", would the result be "FUCK*CS" or "FUC*KS"?

    Third off, modulo?! So character 6 is another "F"?! If I inserted a '*' at position 6, the result would be "*FUCKCS" and not "FUCKCS*"?! Do you think all arrays should work this way, not just strings?

    The way I described strings should work, there are five cases.

    • If n < -(length + 1), raise an error.
    • If -(length + 1) <= n < 0, return the item (-n - 1) places from the end of the string.
    • If n = 0, raise an error.
    • If 0 < n <= (length + 1), return the item (n - 1) places from the beginning of the string.
    • If (length + 1) < n, raise an error.

    I think any sane non-troll would agree that regardless of indexing, trying to find the 12th element of a 5-character string should be an error.



  • @flabdablet said:

    1-based indexing considered harmful

    Thank you for re-posting that shit so I can once again say there's nothing at all relevant to modern, high-level language design in there.

    Seriously, do you people read or do you just hobble over to Google and type "why morbs wrong about 1-based arrays cuz i jealous of his massive wang" and post the first link that comes up?



  • @MiffTheFox said:

    I think any sane non-troll would agree that regardless of indexing, trying to find the 12th element of a 5-character string should be an error.

    This is TDWTF. If it's arcane, senseless and only exists to make people feel clever then it's obviously superior to something sensible, intuitive and resistant to mistakes.



  • @morbiuswilters said:

    Seriously, do you people read or do you just hobble over to Google and type "why morbs wrong about 1-based arrays cuz i jealous of his massive wang" and post the first link that comes up?

    Well not anymore! You fucked it up by making this thread the top search result for that string!



  • @blakeyrat said:

    @morbiuswilters said:
    Seriously, do you people read or do you just hobble over to Google and type "why morbs wrong about 1-based arrays cuz i jealous of his massive wang" and post the first link that comes up?

    Well not anymore! You fucked it up by making this thread the top search result for that string!

    That's okay, I don't think they're going to notice if they post a link to this same thread.



  • @morbiuswilters said:

    @flabdablet said:
    1-based indexing considered harmful

    Thank you for re-posting that shit so I can once again say there's nothing at all relevant to modern, high-level language design in there.

    Hey, by the way, what modern high level buzzword compliant language are you refering to? Because the only language I know of that uses 1-indexing is VB.



  • @Ben L. said:

    Hey, by the way, what modern high level buzzword compliant language are you refering to? Because the only language I know of that uses 1-indexing is VB.

    Who said anything about buzzword-compliant? And clearly we're talking about design concepts and not a specific language I'm advocating; look, not all of us are here to spam crap about the pet language we're obsessed with.

    Lua's the only modern language I know off-hand that uses 1-indexing. COBOL and FORTRAN did, too, although they're not exactly high-level by modern definitions.



  • @MiffTheFox said:

    @morbiuswilters said:
    I still think it will be pretty easy to catch. For example, the first time you write a for (int i = 0 ...) loop, the code is gonna error out since there's no index 0. And this isn't C, so out-of-bounds conditions will raise errors instead of overwriting arbitrary memory.

    Although a language that modern should have a foreach for looping over an array.

    Alternate topic: Negative indexes. Why aren't they a thing?

    Where'd you get the idea that negative indexes are not a thing?

    C has supported them forever!



    Also: this thread is still going? Bloody hell.



  • @nosliwmas said:

    @Everyone said:

    indexes

    Never mind 1s and 0s. It's "Indices", not "indexes", you bastards.

    Yes. A hundred times yes.

    Indices, Vertices, Matrices. Abuse ye not



  • Indices, vertices, matrices, bacteria, colloquia, cacti, octopuses.



  • I much prefer 'octopodes'. But to be fair, octopuses and octopi are technically acceptable.


  • Considered Harmful

    @flabdablet said:

    bacteria, colloquia, cacti, octopuses

    Latin, Latin, Latin, Greek



  • @joe.edwards said:

    bacteria, colloquia, cacti, χταπόδια

    κ.ό.γ.σ



  • @eViLegion said:

    I much prefer 'octopodes'. But to be fair, octopuses and octopi are technically acceptable.

    So is "indexes". Are you one of those morons who says "virii"?



  • @flabdablet said:

    Indices, vertices, matrices, bacteria, colloquia, cacti, octopuses.

    Dominatrices..



  • I don't see why octopi can't be an English word. Island only became the correct spelling because people confused the Middle English word iland with the Old French word isle.



  • @eViLegion said:

    @nosliwmas said:

    @Everyone said:

    indexes

    Never mind 1s and 0s. It's "Indices", not "indexes", you bastards.

    Yes. A hundred times yes.

    Indices, Vertices, Matrices. Abuse ye not

     

    No, a hundred times no. I'm a fan of using the plural form of the language you're actually using.

     



  • @flabdablet said:

    1-based indexing considered harmful
     

    @prof.dr. Dijkstra said:

    Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤  i < N.

    Translation:

    "I don't like the way this alternative statement using inequalities looks, so I want another one."

    Good argument there!



  • @dhromed said:

    @flabdablet said:

    1-based indexing considered harmful
     

    @prof.dr. Dijkstra said:

    Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤  i < N.

    Translation:

    "I don't like the way this alternative statement using inequalities looks, so I want another one."

    Good argument there!

    Especially considering that if we're working only with integer values, you can write 1 ≤ i ≤ N.


  • Considered Harmful

    @MiffTheFox said:

    @dhromed said:

    @flabdablet said:

    1-based indexing considered harmful
     

    @prof.dr. Dijkstra said:

    Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤  i < N.

    Translation:

    "I don't like the way this alternative statement using inequalities looks, so I want another one."

    Good argument there!

    Especially considering that if we're working only with integer values, you can write 1 ≤ i ≤ N.

    You nitwit, if you write it that way then it looks like you're conceding that 1-based indices are better!



  • @dhromed said:

    No, a hundred times no. I'm a fan of using the plural form of the language you're actually using.

    Poseur. I adhere to centuries-old conventions for long-dead tongues, just to show how clever I am. I still refuse to recognize the Great Vowel Shift; people may have trouble understanding what I'm saying, but that's their fault for not knowing their own language.


Log in to reply