|
coffeetable posted:9,007,199,254,740,993 9,007,199,254,740,992 should be enough for anybody
|
# ? Aug 16, 2014 20:16 |
|
|
# ? May 17, 2024 02:56 |
|
seiken posted:edit: see also http://en.wikipedia.org/wiki/Modulo_operation (the top graph is what most languages use, the bottom graph is obviously the best) btw I don't get why this is a separate page from "modular arithmetic", this looks like a really arbitrary wikipedia division heh look at this pun
|
# ? Aug 16, 2014 20:30 |
|
Symbolic Butt posted:btw I don't get why this is a separate page from "modular arithmetic", this looks like a really arbitrary wikipedia division heh look at this pun I know right, I usually want to link to this image when this comes up and it takes me like four google searches to find it every time
|
# ? Aug 16, 2014 20:32 |
|
all you need to know to realize computer science is the worst science is that people get literally angry when someone suggests that maybe zero based indexing - divorced from the context of pointer offsets - maybe doesn't make any sense
|
# ? Aug 17, 2014 00:51 |
|
the talent deficit posted:all you need to know to realize computer science is the worst science is that people get literally angry when someone suggests that maybe zero based indexing - divorced from the context of pointer offsets - maybe doesn't make any sense the even-more-dismal science?
|
# ? Aug 17, 2014 00:53 |
|
the talent deficit posted:all you need to know to realize computer science is the worst science is that people get literally angry when someone suggests that maybe zero based indexing - divorced from the context of pointer offsets - maybe doesn't make any sense
|
# ? Aug 17, 2014 00:56 |
|
the talent deficit posted:all you need to know to realize computer science is the worst science is that people get literally angry when someone suggests that maybe zero based indexing - divorced from the context of pointer offsets - maybe doesn't make any sense grats on being wilfully ignorant I guess
|
# ? Aug 17, 2014 01:15 |
|
0-indexing works well with offsets, 1-indexing works well with positions. Both can even coexist fine.
|
# ? Aug 17, 2014 01:26 |
|
MononcQc posted:0-indexing works well with offsets, 1-indexing works well with positions. Both can even coexist fine. offsets are meaningless without a position to offset from. if you're using offsets you have an implied, unstated position. why bother with the indirection?
|
# ? Aug 17, 2014 01:34 |
|
That's why they give the platinum medal for the 0th runner to finish the race
|
# ? Aug 17, 2014 01:39 |
|
can't wait for the brilliant discussion that's about to go down
|
# ? Aug 17, 2014 01:39 |
|
Can probably look back a hundred pages or so and copy/paste it in advance.
|
# ? Aug 17, 2014 01:41 |
|
last time i remember somebody linking to a dijkstra paper about it
|
# ? Aug 17, 2014 03:02 |
|
MeramJert posted:last time i remember somebody linking to a dijkstra paper about it https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
|
# ? Aug 17, 2014 03:29 |
|
some next-level ordinal chat itt
|
# ? Aug 17, 2014 03:33 |
|
MononcQc posted:0-indexing works well with offsets, 1-indexing works well with positions. Both can even coexist fine. Do you like, actually program? Because this is retarded.
|
# ? Aug 17, 2014 04:09 |
|
shrughes posted:Do you like, actually program? Because this is retarded.
|
# ? Aug 17, 2014 04:18 |
|
primary keys in sql start at 1 and i don't see anyone weeping about that (only about sql in general)
|
# ? Aug 17, 2014 04:19 |
|
i used to get butt hurt over 0 vs 1 based indexing, mostly because i'd learned offsets, and did a lot more of < n than < n+1. but the nicest thing i've seen about 0 based indexing, is python's negative indexes. for ex: in python strings, where foo[0] .. foo[n-1] and foo[-n] .. foo[-1] are the same ranges. i really like the fact that python's are continuous, i.e 0 is the first element, so -1 is the last element. for this to work with 1 based indexing, the ranges would have to be foo[-len+1] .. foo[0]. there's a tiny catch though: the negative indexes are sorta 1-indexed, but the positive ones are all 0-indexes. you can do a similar trick for 1 indexed strings, so foo[1]..foo[len] is foo[-n+1] ... foo[0]. but like before, the negative numbers have a different 'offset'. i reckon it's less weird to have 0 as the start of a list than to have 0 as the end of the list — it works nicer with modulo too, so -1 in a 4 element list is -1 % 4 = 3 i think this is a fairly similar argument that many have taken before, but i've been caring less and less about it: when i'm doing x++ and a x<len somewhere, i usually have counting errors. when i play around with for x in ..., on the other hand, i don't as much. zip and co are pretty awesome for list shenanigans. if i have to care about if it is 0 indexed or 1 indexed i'm probably doing some horrible string or list mangling in a language that never discovered how to use iterators well. but i still cared a bit. what destroyed my care about 0 or 1 indexed lists was teaching some kids about coding, and had to explain 0 based indexing. i explained it as an offset from the start, teaching them to mentally subtract 1 from the index. it felt like some sort of character building exercise, wherein i proclaimed "trust me, it's useful when you're older". as mathematically pleasing as it feels, i felt like a dad. as much as 1 based indexing feels weird, someone pointed out to me that you could do foo[1] .. foo[len], and foo[-len] .. foo[len]. foo[0] would always be an error, both are 1 indexed from head and tail of list. there's also the nice foo[-n] == reversed(foo)[+n] property going for it too. it has similar mathematical neatness, negative indexing, but it's discontinuous. c'est la vie. if i was writing a language for kids i'd probably use that instead of 0 based indexing.
|
# ? Aug 17, 2014 04:30 |
|
shrughes posted:Do you like, actually program? Because this is retarded. first, yes I do... Look it's not that hard: code:
If I ask for an offset, I'm going for what is basically "the number of elements preceding in the sequence". If I'm iterating over the array and need an index, I'll be interested by what is basically "how many elements I've seen before", not necessarily "element at position x". The two definitions are fairly similar, but not identical, and not overlapping either. I've never been pissed or overtly angry at seeing either being picked by a language as long as the operations attached match the indexing picked. now if you want to get into the debate of ranges, that's a fun one too.
|
# ? Aug 17, 2014 04:33 |
|
whiny c programmers can keep their offsets and pointer addresses. don't need em for kids to make poop joke games
|
# ? Aug 17, 2014 04:34 |
|
pre:a t s i b b y [i t s y o u] u i t c a b
|
# ? Aug 17, 2014 04:34 |
|
MononcQc posted:
No. code:
|
# ? Aug 17, 2014 05:54 |
|
shrughes posted:No. then instead of position think of it as counting.......... jesus gently caress I can't believe I'm discussing this
|
# ? Aug 17, 2014 06:06 |
|
stop giving a gently caress about this
|
# ? Aug 17, 2014 06:46 |
|
i am soooooo bored by this discus here's a cypher for you, i made it novice level by only using the relevant characters in the cypher decypher this LAHDSHJKLXTAK L A H D S H J K L X T A K ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ B O R I N G F U C K Y O U
|
# ? Aug 17, 2014 06:55 |
|
the talent deficit posted:all you need to know to realize computer science is the worst science is that people get literally angry when someone suggests that maybe zero based indexing - divorced from the context of pointer offsets - maybe doesn't make any sense idk cs isn't that bad. i just remember that homotopy type theory exists and get all hot and bothered.
|
# ? Aug 17, 2014 08:45 |
|
next pl thread should have a list of forbidden topics
|
# ? Aug 17, 2014 08:53 |
|
coffeetable posted:next pl thread should have a list of forbidden topics here is the new thread. just type the following into your browser's navigation toolbar: about :blank e: without spaces (radiuuuum?? )
|
# ? Aug 17, 2014 10:26 |
|
what is the name of choco 2.0 and is he doing a teardown on the forums anywhere? lowtax documenting choco's slow descent into madness was one of my favorite parts of this thread.
|
# ? Aug 17, 2014 14:09 |
|
ultramiraculous posted:what is the name of choco 2.0 and is he doing a teardown on the forums anywhere? lowtax documenting choco's slow descent into madness was one of my favorite parts of this thread. http://forums.somethingawful.com/showthread.php?threadid=3657588&userid=211248
|
# ? Aug 17, 2014 14:13 |
|
what happened with choco exactly?
|
# ? Aug 17, 2014 19:21 |
|
Symbolic Butt posted:what happened with choco exactly?
|
# ? Aug 17, 2014 19:26 |
|
ruby is not my favorite languagecode:
|
# ? Aug 17, 2014 19:28 |
|
dealing with nils is the worst part of working with ruby
|
# ? Aug 17, 2014 19:31 |
|
Notorious b.s.d. posted:ruby is not my favorite language txt me (^_^),-,~ \
|
# ? Aug 17, 2014 19:58 |
|
lol nil != nil somebody should be shot for that
|
# ? Aug 17, 2014 20:13 |
|
fleshweasel posted:lol nil != nil somebody should be shot for that this also evaluates to false
|
# ? Aug 17, 2014 20:36 |
|
doubtless there is some static method you need to look up to use for this relatively common case in programming reminds me of NaN. NaN is so useless.
|
# ? Aug 17, 2014 20:43 |
|
|
# ? May 17, 2024 02:56 |
|
my favorite part of NaN is when compilers optimize out edge cases for dealing with NaNs
|
# ? Aug 17, 2014 20:54 |