jpcamara Profile picture
Aug 2 5 tweets 2 min read Read on X
I took a journey into the heart of Ruby to learn the secrets of the /o regex modifier, and I emerged wiser, but also so deeply tired. Image
When you look at this class - does anything stick out to you? Any red flags? Image
If you run these lines - is it what you expected? It definitely was _not_ what I expected! Image
It turns out the tiny /o modifier has an outside influence on how your program runs. It creates a permanent, immutable version of your regex after the _first_ time it runs. My advice now is to never use this modifier. Ever. I dig alot deeper in the article, give it a read! Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with jpcamara

jpcamara Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @jpcamara

Oct 31, 2024
Over on the blue place, @tenderlove brought up some really valid points about Fibers in Ruby. I wrote up some of my thoughts over there, and figured i'd share them here too. This is pretty long, sorry 😂
Here's the original post for reference: bsky.app/profile/tender…Image
Very fair! They don’t! And I think it’s valuable to make that clear to people. However, unlike threads, fibers have clear, deterministic seams of where race conditions could happen. They swap in well defined ways (blocking operations), and never at the instruction level. Image
Read 22 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(