[#66126] Creation/Conversion methods/functions table for Ruby types — SASADA Koichi <ko1@...>
Hi,
5 messages
2014/11/07
[#66248] [ruby-trunk - Feature #10423] [PATCH] opt_str_lit*: avoid literal string allocations — normalperson@...
Issue #10423 has been updated by Eric Wong.
3 messages
2014/11/13
[#66595] [ruby-trunk - Bug #10557] [Open] Block not given when the argument is a string — bartosz@...
Issue #10557 has been reported by Bartosz Kopinski.
3 messages
2014/11/30
[ruby-core:66193] [ruby-trunk - Feature #10042] Deprecate postfix rescue syntax for removal in 3.0
From:
headius@...
Date:
2014-11-11 02:13:41 UTC
List:
ruby-core #66193
Issue #10042 has been updated by Charles Nutter.
The problem is that postfix rescue is almost always used incorrectly, ending up swallowing 99% of errors that Ruby programs raise. It also masks the very high cost of creating an exception and backtrace (high on MRI, higher on Rubinius, and very high on JRuby/JVM). Finding these bugs (or performance hits) can be very difficult.
I believe the potential for serious bugs outweighs the convenience of this syntax.
----------------------------------------
Feature #10042: Deprecate postfix rescue syntax for removal in 3.0
https://bugs.ruby-lang.org/issues/10042#change-49891
* Author: Charles Nutter
* Status: Open
* Priority: Normal
* Assignee:
* Category: core
* Target version: next minor
----------------------------------------
The postfix rescue notation is convenient...but almost always is a really bad antipattern.
An example of the notation:
Integer(f) rescue f # returns f if it is not parseable as an Integer
It silently ignores all StandardError raised by a piece of code...which often covers *many* more exceptions than the user *wants* to be ignoring.
It also hides the cost of constructing and throwing away all those ignored exceptions.
I believe Matz has even said in the past that he regrets adding the feature.
In any case, I propose that "rescue nil" should be deprecated with a warning (either always on or only when verbose) and we should plan to remove it in 3.0.
Who's with me?!
--
https://bugs.ruby-lang.org/