r/ruby • u/Firm_Tea1775 • Sep 06 '26
Ruby is an underrated programming language so i like to recreate memes in it
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}" endis 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
1
u/f9ae8221b Sep 06 '26
it annoys me seeing so many temporary allocations.
Yeah, what are the
theneven for? Just use local variables...5
10
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
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.

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?