There is a tradeoff. If I want to search the Sage source code, running 
"search_src(...)" in Sage is easy, and it's in our documentation, so people 
might find it. Running '!grep -R -n ... "$SAGE_ROOT"/src/sage' is not quite 
as easy; if you want the line numbers, you need -n, and it also requires 
knowing either that you can use $SAGE_ROOT when running Sage, or requires 
knowing the path to the Sage installation. Remember that some users are 
only accessing Sage via Jupyter notebooks or CoCalc, and maybe Unix paths 
and Unix commands are not at their fingertips.

So before deprecating, consider points of view of users from different 
backgrounds. We hope that mathematicians are using Sage, and we shouldn't 
require them to know about "grep". Don't get me wrong, grep is great and I 
use it all the time, but I bet that many of my colleagues don't know it, 
don't want to learn the syntax, and would view '!grep -R -n ... 
"$SAGE_ROOT"/src/sage' as an essentially magical incantation. I think that 
'search_src(...)' is more accessible.



On Friday, May 1, 2020 at 6:39:54 AM UTC-7, Dima Pasechnik wrote:
>
> I would be in favour of deprecation and eventual removal of search_src()
>
> just as we discard old implementations of maths functions in favour of 
> maintained faster implementations in external libraries, we ought to 
> discard outdated interfaces too.
>
> Dima
>
> On Fri, 1 May 2020, 14:22 Michael Orlitzky, <mic...@orlitzky.com 
> <javascript:>> wrote:
>
>> On 5/1/20 8:45 AM, kcrisman wrote:
>> > 
>> >     I don't know whether python functions can call the ! things but I
>> >     think it would help users to keep search_src(s) as a shorthand for
>> >     !grep -r s $SAGE_ROOT/src and search_def(s) for search_src("def 
>> "+s).
>> > 
>> > 
>> > Thanks for more calmly and concisely making my point for me.
>> > 
>> > As for a relevant xkcd: https://xkcd.com/1168/
>>
>> If you don't start sage from $SAGE_ROOT, then having an alias is nice,
>> but there's also a standard way to do that:
>>
>>   $ alias search_src="cd $SAGE_ROOT/src/sage; grep -r"
>>
>> Now I can run whatever grep variant I want, easily, from anywhere:
>>
>>   $ search_src -il orlitzky graphs
>>   graphs/generic_graph.py
>>
>> (And pipe the result to another command, if I want). Point is, we don't
>> need to reimplement every fifty-year-old standard POSIX feature in
>> python to make it "usable." The people who know how to use grep/alias
>> far outnumber the people who know how to use sage's search_src(). The
>> people who know neither need to learn one, and they're better off
>> learning the reusable skill.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/c7dc3bdc-1334-3ec0-da13-e5c91a8b3510%40orlitzky.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/36384402-95cd-4def-a6b6-ca4fb6ebc9bf%40googlegroups.com.

Reply via email to