octave-maintainers
[Top][All Lists]
Advanced

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

Re: Why do we have to deprecate and remove functions?


From: PhilipNienhuis
Subject: Re: Why do we have to deprecate and remove functions?
Date: Fri, 15 Mar 2019 07:27:24 -0500 (CDT)

Andreas Weber-6 wrote
> Dear all,
> 
> what is the reason to deprecate functions? Is it just to be as MATLAB 
> compatible as possible or to keep the codebase as small as possible?

Reducing maintenance burden, obviously I'd say.
While strmatch etc. may still build and work fine now, perhaps some change
in the future could unintendedly cripple them and at that moment the
question will arise what to do then. It seems better to decide now about
continued support in the future.
But, read on ... 


> I ask because I have to maintain code which has to run on Octave >= 
> 3.8.2 up to current versions which is often hard because functions were 
> removed which have worked without problems for years.
> 
> One example for a deprecated function is "strmatch". Currently I use it 
> this way:
> 
> strmatch ("foo", {"abcd", "foobar", "foox"})
> ans =
> 
>     2   3
> 
> After 5.1.0 I think I have to use:
> 
> find (strncmp ("foo", {"abcd", "foobar", "foox"}, numel("foo")))
> ans =
> 
>     2   3

AFAIK strmatch is still working in 5.1.0, it's in scripts/legacy/ these
days. It's still even in 6.0.0.

Otherwise I do sympathize with you POV.
In my crossbuilds I removed the IMO somewhat obsolete warning about
obsoleteness of strmatch. Matlab until r2019a doesn't warn similarly, in the
Matlab docs it only says that strmatch is not recommended but no sign of
future removal. Furthermore Matlab has introduced functions startsWith() and
validatestring().

I think that once strmatch is finally dropped I'll create a wrapper called
strmatch for myself around strncmp() as above; at work strmatch pervades the
local Matlab function library about everywhere.

Philip




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html



reply via email to

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