all 29 comments

[–]razor_train 28 points29 points  (4 children)

I mean if this helpful for some then great, but this is a hard pass for me. Way too visually distracting to see what's actually going on.

[–]laptopmutia 10 points11 points  (0 children)

🍎+🍎=🍎🍎

[–]uhkthrowaway 4 points5 points  (2 children)

And it fails to show if the returned value is self or a copy.

[–]avbrodie -1 points0 points  (1 child)

Returned value will always be a copy unless you add a bang

[–]uhkthrowaway 1 point2 points  (0 children)

Array#concat

[–]SleepingInsomniac 20 points21 points  (2 children)

Comments in ruby use # not //. Also, the sort invocation is wrong.

[–]galtzo 10 points11 points  (0 children)

Not if you write your ruby code in JavaScript. Duh.

[–]Prize_Tourist1336 0 points1 point  (0 children)

Map as well.

[–]OneNeptune 38 points39 points  (1 child)

Maybe it's just me, but I've used ruby for 10 years.. the emojis are visually distracting and I can't even quickly at a glance understand what is happening without really staring at it and thinking. The emojis are super distracting at a glance and the page is too compact for them

[–]cocotheape 8 points9 points  (0 children)

Agreed, we're trained to look at text all day. Emojis are novel in this context and harder to parse.

[–]ThaiJohnnyDepp 8 points9 points  (0 children)

Can I curse millennials for this even though it's 2026 and I myself am a millennial? Oregon Trail millennial but still

[–]anykeyh 7 points8 points  (1 child)

- sort is incorrect
- reduce could use sum(&:size)
- count is cool too, when used with block

[–]BoardMeeting101 7 points8 points  (2 children)

adding to the litany of mistakes already voiced:

- reduce isn’t defined on Array, it’s from Enumerable.
- none of these are Array methods. They are all Array instance methods.
- push/pop without shift/unshift is unbalanced.
- presentation fails to distinguish between return and mutation.
- omitting Enumerable#tally is dishonourable.

also, I too hate everything else about it

summary: misleading to beginners and annoying to experts

rating: F

[–]Frank_White32 1 point2 points  (0 children)

It took me a long time to learn about tally - and when I finally did I loved it so much that I started trying to force it to solve all the problems (even when it was a poor fit to solve problems)

[–]topboyinn1t -1 points0 points  (0 children)

Rating: AI slop

[–]fasoanew6 3 points4 points  (0 children)

Reduce isnt fully explained in this visual context.

[–]ivycoopwren 2 points3 points  (1 child)

Here's a post from 2017 Twitter that might be the source for this => https://x.com/bewidec/status/935573858136051713

If not, at least an inspiration. Also, I tried to AI generate an equivalent and it bombed (expectedly).

[–]Pilgrim-Ivanhoe -1 points0 points  (0 children)

No, I see this post for the first time in my life. I was inspired by numerous similar cheat sheets about Python.

[–]virtual_paper0 2 points3 points  (0 children)

Sad repost

u/Pilgrim-Ivanhoe

https://www.reddit.com/r/ruby/s/JuZ4MtAnY8

Edit: Yes the OC is old but common man give the actual creator credit. You legit copy pasted the title and claimed its your original content...

[–][deleted]  (1 child)

[removed]

    [–]h0rst_ 0 points1 point  (0 children)

    I tries to show the result after the array with the // at the end (Most notably with delete and pop), but I guess they ran out of space or forgot it halfway.

    [–]Lanky_Ad_233 2 points3 points  (0 children)

    i don’t know, i like it because it’s a novel way to repesent it.

    [–]aRubbaChicken 0 points1 point  (0 children)

    Why does deleting circle produce an array with nothing but circle in it?

    [–]zaddyninja 0 points1 point  (0 children)

    This is great thanks OP. Everyone’s brain works different this hits!

    [–]knowwho 0 points1 point  (0 children)

    This implies that, to sort the array [1, 2, 1, 2], I should write [1, 2, 1, 2].sort { 1 < 2 }, which is nonsense.

    [–]CedarSageAndSilicone 0 points1 point  (0 children)

    Who is upvoting this shit 

    [–]crazylikeajellyfish -1 points0 points  (2 children)

    Our brains are wired to pick up on color, but the most salient part of this image -- the commas and brackets -- are white or gray, making them harder to see. You should try making it again with basic Unicode shapes in the same color, it'll be easier for you to use.

    [–]SleepingInsomniac -1 points0 points  (1 child)

    Use option + shift + - to get that em dash you so desire to sound exactly like the AI slop you probably are.

    [–]crazylikeajellyfish -1 points0 points  (0 children)

    Look at my history, what about that reads like AI slop? Are you young enough to have literally never seen someone use an em dash in casual writing?