help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check for redundancy


From: Emanuel Berg
Subject: Re: Check for redundancy
Date: Thu, 25 Jun 2015 01:31:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The term is not specific to programming: expressing
>> things which have been expressed already.
>
> Obviously, Drew knows that. The issue is that if you
> want to check for redundancy in code, it's
> presumably by doing it with another piece of code.
> That other piece of code will have to encode
> formally what you mean by redundancy, so to be able
> to write it, you'll need to describe formally what
> you mean by redundancy. And that's pretty damn hard
> for the usual interesting cases of redundancy.

Yeah, this is extremely difficult to accomplish at any
level and to get it to be actually useful in practice
is close to impossible. And it is not needed.

> Of course, you could also use machine-learning to
> define "redundancy" by way of a set of examples used
> to train your machine-learning code. Not sure how
> well it would work, nor how to make it work well.

I dare say the AI methods will *never* be able to
do this!

The only method that might work is to have a compiler
do relentless super-optimization over and over. Then,
when done, tho having different codes, some functions
will have produced the same sequence of machine
instructions - then, you could delete one of them,
sound and safe.

No - the much better way is:

    1) Write and read code every day. You will learn
       to identify what isn't needed.

    2) Don't be afraid of doing stuff and having stuff
       around. Your computer isn't a garage that can
       fill up with junk. There is no harm in having
       a couple of defuns and shell functions lying
       around, mostly up to no good, some of them
       doing (almost) the same thing as their
       neighbor. This is not a situation to be
       worried about. It is not a bloated system or
       a system that will run slower. Instead of
       thinking you "have" to merge them into one
       thing that does everything "the right way"
       think what other functions you *don't* have and
       that you would like, and focus on those.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]