On Wed, Sep 14, 2016 at 6:43 AM, Markus Zimmermann <zimm...@gmail.com> wrote:
> On Wednesday, September 14, 2016 at 3:37:10 PM UTC+2, Alan Donovan wrote:
>>
>> On 14 September 2016 at 09:32, Markus Zimmermann <zim...@gmail.com> wrote:
>>>
>>> Do you think this might be worth bringing up in golang-dev?
>>
>>
>> No.  We can't make this change to the language without breaking existing
>> programs.
>
>
> That is unfortunately. I will just write a linter check for that. Thanks for
> the talk!

Personally I feel like an unused variable normally indicates a
problem.  You set the variable to something, but you never used it.
Why not?  There is simply no reason to have an unused variable.

An unused constant does not normally indicate a problem.  Constants
can be documentation.  They can mean "this value means this" even if
the value is never actually used.  I think it's uncommon for an unused
constant to indicate a programming error.

Fortunately, this is a question that can be determined empirically.
Write the code to detect unused constants.  Run it over a diverse code
base, such as a bunch of github repos.  See how many actual bugs it
detects.  Actual data can help decide whether this is worth doing.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to