<pounce>
I thought it was deprecated at one point (but idk if that was just Object#=~)
eddof13 has joined #ruby
peebs has quit [Quit: Konversation terminated!]
eddof13 has quit [Quit: eddof13]
cappy has quit [Quit: Leaving]
Vonter has joined #ruby
peebs has joined #ruby
gastus has joined #ruby
gastus_ has quit [Ping timeout: 255 seconds]
johnjaye has quit [Ping timeout: 272 seconds]
johnjaye has joined #ruby
d0htemsf has joined #ruby
<havenwood>
pounce: It's unreasonable to use. It comes from a previous era. Just still around for backwards compatibility but I'd personally get rid of it.
<havenwood>
Most #=~ usage has been supplanted by #match? to avoid the magic global overhead.
<havenwood>
nil =~ /😬/
peebs has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
grenierm has joined #ruby
d0htemsf has quit [Quit: Connection closed for inactivity]
Rounin has joined #ruby
xlymian` has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Linux_Kerio has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
rvalue has quit [Ping timeout: 248 seconds]
rvalue has joined #ruby
gastus has quit [Ping timeout: 272 seconds]
gastus has joined #ruby
dza has quit [Quit: Ping timeout (120 seconds)]
dza has joined #ruby
<pounce>
havenwood: grumpy
gastus has quit [Ping timeout: 252 seconds]
gastus has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 272 seconds]
rvalue- is now known as rvalue
dviola has quit [Quit: WeeChat 4.3.6]
otisolsen70 has joined #ruby
dviola has joined #ruby
grenierm has quit [Ping timeout: 256 seconds]
Furai has quit [Quit: WeeChat 4.3.5]
Furai has joined #ruby
<gastus>
havenwood: GOt it, but .beginning_of_week I have hard time finding.
user71 has joined #ruby
shiru has joined #ruby
shiru has quit [Remote host closed the connection]
otisolsen70 has quit [Read error: Connection reset by peer]
cappy has joined #ruby
passbe2 has quit [Quit: bye...]
passbe2 has joined #ruby
<havenwood>
pounce: snarky
<pounce>
im not grumpy at you!;
<pounce>
im grumpy at the person who closed my pr fixing a nill check with .match? -> &.match? to =~
<havenwood>
Ah, okay! I was confused what I'd said wrong. Haha.
<pounce>
they fixed themselves with =~ *
<havenwood>
pounce: You're 100% right on that one. `&.match?` is better on multiple fronts.
<havenwood>
Setting all the globals is fairly expensive and a shame when you're not using them.
<havenwood>
An `&.match?` also makes it explicit that a `nil` is anticipated.
<pounce>
yeah
<pounce>
oh well 🤷 not my project
<havenwood>
Better for the reader. Better for the machine.
<havenwood>
¯\_(ツ)_/¯
<havenwood>
It's nice when we can get these thing "soft deprecated" so the docs discourage ill advised usage.
<pounce>
i was reading that it was originally Object#=~ which was deprecated
<pounce>
but the nil one is a special case
<havenwood>
It should have been dropped at the same time. Now it's just around to not be a breaking change.
<havenwood>
I cringe at it being used!
<havenwood>
It'd be nice for us to adopt a more consistent "soft deprecation" notice. We can keep it around for stability while acknowledging we know it's not good.
<havenwood>
Standard language would be nice too. Some docs mention things are "considered deprecated" but others the docs are silent even though it's established as soft deprecated on the bug tracker.
<havenwood>
Language like this is awkward too: "DateTime class is considered deprecated. Use Time class."
<havenwood>
I think it's fine to say it's just plain deprecated even if there's no concrete date for removal. Also a good thing to start with.
<havenwood>
Now I'm seeming grumpy. 😆
<havenwood>
DateTime is deprecated. Use Time instead.
<havenwood>
`nil =~` is deprecated. Use `nil&.match?` instead.
<havenwood>
Class variables need one too.
<havenwood>
Then there're "toy" libraries like Prime that we should document as example code not appropriate for use in production.
<havenwood>
I'd really rather not ship toy code, since it most often is mistaken for a best practice standard library.
Pixi has quit [Quit: Leaving]
<havenwood>
Docs should at the very least mention faster_prime.
<havenwood>
The "look, some Ruby" libs could move to an examples/ or something if we want to keep them around.
<pounce>
well, best practice is probably through the door with what im doing anyway
<pounce>
i think the best solution to my current issue is shelling out to javascript from rails
<pounce>
as horrible as that is
<havenwood>
The humanity... 🙂
<pounce>
ive been putting in a lot of work to use a pure ruby/C solution, but it isn't really working out