Re: AfxGetApp() returns NULL
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 17 Dec 2007 00:56:21 -0500
As to Find In Files, it is my choice, and my choice alone, to decide if the contents of a
search are no longer useful; the fact that it chooses to delete the contents of the
previous find, or give me some clumsy method that requires I keep choosing different
windows, seems pointless. I typically will do a "delete lines that match" if the find was
a little too generous.
The chances I will have a method with the same name as a variable is really vanishingly
small.
Also, the scale of my projects usually obviates the need for incredibly sophisticated
tools; there's not a lot of sophistication required to deal with source sets in the range
of 100K-200K lines, but if I had a megaline of code, it would be a different issue.
Finding definitions is generally a couple keystrokes. The number of times I need to find
all uses is so infreguent that a two-step process imposes no serious effort; most times
when I need to find all uses, a simple search string in the one-and-only module that uses
the class is sufficient. Again, working on small scales like 200K source lines means that
using clumsy tools doesn't buy much, and find in files is certainly badly done.
One serious failure, which Microsoft is merely the latest perpetrator of, is the notion
that output windows are read-only. There is no justifiable reason that I cannot edit
EVERY window (in particular, delete lines based on pattern matches); I end up having to
copy the lines to a real editor so I can process them. This should not be necessary. I
find the VS editor gets in my way more than it helps me. I have very high expectations of
a text editor, and it isn't even close. I have high expectations of file find, and
replace-in-files, and VS isn't even close to the tools I use continuously. I see it as a
compiler/debugger world, but it doesn't make it as a source editing environment.
joe
On Sun, 16 Dec 2007 23:05:18 GMT, "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote:
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in messageJoseph M. Newcomer [MVP]
news:226bm31cgl0oj38k5amk6vsjkamvd2cltq@xxxxxxxxxx
But I rarely need to find "all calls" to public methods, because the
public methods are
used in very few places. For example, the public methods of a CDocument
class are
typically only used by the CView, and a simple search will find those; no
sophisticated
browsing information is required. There might be classes that are shared
between a CView
and a CDocument derivation, but in that case, I still can find them all
quickly. By not
tossing tons of public methods in to generic classes like my
CWinApp-derived class, there
is no question of needing to find all of them; they exist only in the
modules that can
name the class, and there are very few of those.
It certainly helps to limit the files that could possibly access a public
method, but still your search process is 2 steps: find the .cpp files which
#include the header for the class in question; and grep those files for the
method, which still could be called i() in which case the chances of false
positives is rather high. Still, I can see how you could limp along with
this method if there were nothing better, but the fact is there are tools an
order of magnitude better than this.
When I get programs that have been badly written, then a browser is
useful. But I don't
need one for my own code, because I don't write things that require fully
general browsers
to find them. By limiting scope and visibility, I usually can quickly
find what I need.
Having a decent "grep" instead of the abomination of Find In Files that VS
supplies is
also a great help! (There are so many things wrong with Find In Files
that I deem it a
useless misfeature. The simplest ones, that it replaces the contents of
the find window,
and that you cannot delete lines from the find window individually,
already makes it so
unusable that the rest of the superficial flaws become irrelevant)
Well, these things don't bother me at all. Find in files works great. What
exactly do you want to preserve in the Find window that you are so upset
about it replacing? And why would you want to delete lines from the search
results? I just press F4 to step through them and that's it.
-- David
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- References:
- Re: AfxGetApp() returns NULL
- From: Joseph M . Newcomer
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- From: Joseph M . Newcomer
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- From: Joseph M . Newcomer
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- From: Joseph M . Newcomer
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- From: Joseph M . Newcomer
- Re: AfxGetApp() returns NULL
- From: David Ching
- Re: AfxGetApp() returns NULL
- Prev by Date: Re: naming convention for PNG resources?
- Next by Date: Re: Assembling Visual Studio generated listing files
- Previous by thread: Re: AfxGetApp() returns NULL
- Next by thread: Re: AfxGetApp() returns NULL
- Index(es):
Loading