Dreaming of new generation IDE

Francis Carr coldtortuga at gmail.com
Thu Feb 11 12:30:04 EST 2010


> I can't believe the code editing situation today is in a such sorry
> state.
I can't believe an old coder is feeling so sorry for himself.


> Today, I tried to understand the twisted.web.client code and I found 3
> methods I couldn't find by who were called.
>
> I asked on the mailing list and they suggested me where they were
> called and that the tool for such thing is "grep".
>
> So, you grep, you get a list of files, you open each one of them and
> keep scrolling and switching from one file to another... endlessly.
> Maybe I'm getting old, but I tend to get lost in the process.

Maybe the relevant lesson to be taken from Smalltalk is *not*
  "put it all in one image"
but instead
  "write code to solve problems, e.g., reading code"


I suggest defining a few shell functions to *automate* the search, for
example in zsh

function allf () {
  # Recursively find files with suffix matching comma-separated list
in $1.
  # For example, "allf cpp,hpp" finds all "*.cpp" and "*.hpp".
  find . -type f | grep -E "\.(${1//,/|})$"
}

function src () {
  # Similar to "allf", then search for a regex among the results.
  find . -type f -print0 | grep -zE "\.(${1//,/|})$" | xargs -0 grep -
lE $2
}

function srcl () {
  # Similar to "src" (see above),
  # then search for a pattern among the results,
  # and pass matching files to "less".
  src $1 $2 | xargs less -p $2
}


Smalltalk's images are cool.  But they are such a huge hammer, and
they impose so many additional requirements!  The costs outweigh the
cool.

 -- FC



More information about the Python-list mailing list