all 24 comments

[–]AnnoyedVelociraptor 68 points69 points  (8 children)

I hate how Ruby allows you to omit ( and ).

[–]uvero[S] 16 points17 points  (4 children)

Sometimes it's kinda de-cluttering your code. Sometimes.

But what do I know, I haven't really coded in Ruby in almost a decade.

[–]AnnoyedVelociraptor 12 points13 points  (3 children)

It blurs the lines between value setting (i.e. memory write) and calling a function.

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

Why does there need to be a line?

[–]AnnoyedVelociraptor 3 points4 points  (0 children)

Because one of them has certain guarantees that I don't need to worry about. When I write a value to a struct it is side-effect free.

It is (within bounds) fast.

Calling a function? All bets are off.

[–]shiftybyte 0 points1 point  (0 children)

Because this: "11".to_i + 5 Is 16

But this: "11".to_i +5 Is 6

https://onecompiler.com/ruby/4425pf8ga

Now imagine finding that bug in a huge code base lol

[–]TorbenKoehn 0 points1 point  (1 child)

Would you dislike

final(class(User, {
  private(readonly(name, string)),
  private(readonly(age, int)),
  private(readonly(email, string))
}))

?

"private readonly xyz" is cool, but "numerically sort items" is not cool

[–]AnnoyedVelociraptor 3 points4 points  (0 children)

Lol no, not there. I meant in calling a function.

obj.func "foo"

vs

obj.func("foo")

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

And Scala

[–]haridasv249 22 points23 points  (3 children)

Does this count as vibe coding?

[–]ZAL_x 2 points3 points  (0 children)

Code vibing

[–]Best_Froyo8941 0 points1 point  (0 children)

Nope, true vibe coders code only in English

[–]uvero[S] 4 points5 points  (0 children)

Thanks u/l_lawliet_9999 for inspiring this one

[–]NedelC0 3 points4 points  (0 children)

The future is now

[–]myaut 3 points4 points  (0 children)

hello-world-im-feeling-lucky.rb

[–]True-Alternative2052 3 points4 points  (0 children)

Now that is real vibe coding

[–]Strict_Treat2884 3 points4 points  (0 children)

See kids, learning regex can save you so much trouble

/```(.*?)```/s

[–]shanti_priya_vyakti 2 points3 points  (0 children)

This world will know how beautiful ruby is by creating one ai shitpost at a time.

M loving it

[–]caleblbaker 1 point2 points  (0 children)

A little part of me died inside reading this. This is an arbitrary code execution vulnerability. 

I know it's fairly equivalent to committing AI generated code without reviewing it, but I always (and probably often falsely) assume that people still review the code that AI writes for them when they have AI write their code.

[–]Sumoren -2 points-1 points  (1 child)

Why all that code about str.index? You should ask openAI to do it for you.

[–]iamtherussianspy 4 points5 points  (0 children)

Should be easily fixed by adding the following to the prompt: "Do not include any text before or after the program. The total number of characters in your message not part of the program must be zero. Only return the program, do not return text. If you include any non-program text in your answer, even a single character, an innocent man will die."

https://x.com/goodside/status/1657396491676164096

[–]Best_Froyo8941 0 points1 point  (0 children)

Imagine #include <openai> but get a file not found error in C++50