HackerTrans
TopNewTrendsCommentsPastAskShowJobs

asheldon

no profile record

comments

asheldon
·7 ay önce·discuss
When exists? was removed, it was roughly an order of magnitude more popular in Ruby code on Github than exist?. I don't think you can argue from the position of improved readability when, given the choice, it was what the majority of people expected, wrote, and had to change. This change in Ruby is pretty difficult to defend. It didn't really do much but break people without giving them anything in return. It didn't improve maintainability of Ruby itself, it didn't make maintaining Ruby code easier, it didn't advance any secondary goals to improve Ruby.

10 years is not an especially long time period for a software project to be maintained. There's a reason the Linux project is so emphatic that it never breaks user space.
asheldon
·5 yıl önce·discuss
I agree. It would be simpler to shuffle the list of people, then split the list in half.

Here's a proof this algorithm doesn't work by counter-example (N=6)

Consider a list of 6 elements. Elements 5 and 6 must be in the same bucket 50% of the time and different buckets 50% of the time. For this to be true, after we place the first 4 elements into their buckets according to this algorithm, there must be space left in both buckets 50% of the time and in only one bucket 50% of the time.

Sequences of the first 4 coin flips where neither bucket is filled, followed by possible ending sequences, and the odds of the prefix.

AABB(AB, BA) = 1/16th

ABAB(AB, BA) = 1/16th

ABBA(AB, BA) = 1/16th

BBAA(AB, BA) = 1/16th

BABA(AB, BA) = 1/16th

BAAB(AB, BA) = 1/16th

Total: 3/8ths

Sequences of the first 3-4 coin flips where one bucket is filled, followed by possible ending sequences, and the odds of the prefix:

AAA(BBB) = 1/8th

BBB(AAA) = 1/8th

AABA(BB) = 1/16th

ABAA(AA) = 1/16th

ABBB(AA) = 1/16th

BBAB(AA) = 1/16th

BABB(AA) = 1/16th

BAAA(BB) = 1/16th

Total: 5/8ths

Since one bucket is filled 5/8ths of the time after 4 elements are processed according to this algorithm, the final two elements will be in the same bucket 5/8ths of the time, not the expected 4/8ths of the time.
asheldon
·5 yıl önce·discuss
What games do you play these days?

I have the opposite experience - I feel buried in 60+ hour games I want to play and feel like games could be shorter.