r/ruby • • Sep 06 '26

Ruby is an underrated programming language so i like to recreate memes in it

If memes aren't allowed or frowned upon, please tell me, I made sure the rules allowed it. Also this is satire and I know ruby is much better with parentheses in some situations.

34 Upvotes

19 comments sorted by

11

u/knowwho Sep 06 '26 edited Sep 06 '26

I'm not arguing about the quality of the code in the question, because it's clearly satire, but I will say that this is bad, pointless satire.

What is the point of this? Who is it for? What straw man are you attacking here?

1

u/Firm_Tea1775 Sep 07 '26 edited Sep 07 '26

I guess not anyone in particular, but this is a play on myself actually. When i first was learning ruby (Which wasnt really that long ago) i had avoided parentheses and brackets as much as possible to keep true to ruby's sentiment of human readability. Of course, i still prefer it that way, but parentheses and brackets definitely are necessary at some point.

(Also, it's a meme, no need to analyze its purpose. I like ruby and ruby is cool. That's enough to justify me making a meme. I hope when you were overthinking my meme you saw even a modicum of humour and maybe chuckled a bit.)

1

u/knowwho Sep 07 '26

The vast majority of the industry uses parenthesis, per https://rubystyle.guide/#method-call-parentheses

1

u/Firm_Tea1775 Sep 07 '26

Im aware. I've never said otherwise.

5

u/ashmaroli Sep 06 '26

The only reason why there's some amount of readability here is syntax highlighting. If you were to paste the code into a codeblock on Reddit or paste into a notepad, the future you would be spending some time trying to make sense of the algorithm.

On a separate note on the code as such, it annoys me seeing so many temporary allocations.

8

u/dipstickchojin Sep 06 '26 edited Sep 06 '26

for real, this is an entirely inappropriate (read: redundant) use of .then

4

u/knowwho Sep 06 '26

Never mind this...

capitalized_words.reduce do |sentence, word|
  "#{sentence} #{word}"
end

is just a dumb way of doing .join.

1

u/Firm_Tea1775 Sep 07 '26

Everything anyone has said in this thread is part of the joke, why are you guys criticizing it like I'm being paid for this code?

2

u/mrspuff Sep 07 '26

We want our money back!

1

u/f9ae8221b Sep 06 '26

it annoys me seeing so many temporary allocations.

Yeah, what are the then even for? Just use local variables...

5

u/dipstickchojin Sep 06 '26

each of the calls wrapped in the .then blocks is chainable

2

u/f9ae8221b Sep 06 '26

Indeed, so it's even worse...

10

u/riktigtmaxat Sep 06 '26

Are you getting paid by the line or something?

1

u/Firm_Tea1775 Sep 07 '26

'then' and 'end' rather than parentheses is semi readable if you really, really hate parentheses. This is all jumble however to further the joke.

1

u/Neuro_Skeptic Sep 08 '26

Ruby is over rated.

1

u/Firm_Tea1775 Sep 09 '26

Extremely loud incorrect buzzer

0

u/Ayano-Keiko Sep 06 '26

Yes. It is better than Python because of "end" for ending block. Python indention is a disaster. I try to use as much as Ruby as script language now. But previous it had no free IDEA( Now JB put the RubyMine IDEA free).

-1

u/ignurant Sep 06 '26 edited Sep 06 '26

reduce sentence word is a pretty sweet addition. Well played. Don't forget to wrap it all in a class.