Re: AfxGetApp() returns NULL
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 18 Dec 2007 12:16:11 -0500
See below...
On Tue, 18 Dec 2007 13:15:22 GMT, "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote:
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message****
news:oa0fm3dkr93fgol5b3np32unlm8dqnqtig@xxxxxxxxxx
Yes, the wizard code indentation sucks, and K&R style sucks. I wouldn't
use either of
them; first thing I do with wizard code is reindent it so it looks
reasonable. One
advantage of my text editor is that it does precisely the right
indentation that I want,
and I don't have to fiddle twenty interacting parameters to get it to do
the right thing.
I've been using the same indentation style for about 30 years, and it is
highly adapted to
human readability. I developed it after studying how human beings process
information,
rather than how computers process information. K&R style is actually
actively hostile to
human perception. Key to this is undertanding that human beings do not
handle nesting
well, and have very poor spatial recognition required for proper
indentation recognition.
Combine this with limited visual context and most conventional approaches
simply fail the
basic tests of human perception limitations.
Note that the "indent braces" option still gets the indentation wrong;
what it gets wrong
is that the program text inside the braces is vertically aligned with the
braces instead
of being indented one more space. There are many other problems with how
brace
indentation is done, not the least of which is that typing a space in
front of a brace
causes the brace to realign; this makes no sense. Overall, I do not want
to spend my life
fighting a third-rate editor when I have a first-rate editor already.
Since I have to look up most of the parameters to functions, since
Intellisense doesn't
actually give me anything useful most of the time, I don't see that it is
providing me any
real advantage. Having a dual-monitor environment with the MSDN
permanently on display on
the second monitor is far more an advantage than intellisense. So I find
very little to
recommend the VS editor. I use it for fixing trivial syntax errors but I
don't do real
work in it. It just gets in the way.
Well, at least you found the checkbox and are no longer under the illusion
that it is not there.
I have always known it is there. I set it when I first install VS. I thought you were
referring to some new option that would do something intelligent, instead of the current
poor model.
****
****
Now I looked at your serial port code a few months ago (a real gem, I have a
note to send you my results since you don't provide code in a resuable form)
and now remember that it indeed does not follow any standardized indentation
style at all, e.g.
if(err != ERROR_IO_PENDING)
{ /* serious error */
parms->notifyee->PostMessage(UWM_WRITER_SHUTTING_DOWN,
(WPARAM)::GetLastError());
... handle failure notification here
PostQuitMessage(0); // this responds by shutting down the thread
// Your Mileage May Vary
delete s;
return;
} /* serious error */
In order to understand it, the first thing I had to do was reformat it. No
offense, but any traits made to accomodate human perception limitations are
overcome by another human trait: habit. ;) Kind of like why people don't
use Dvorak typing layouts even though it is superior to qwerty. And the
fact you use non-standard spacing means tabs don't work and any editing of
your code at all results in a real mess. So even if your formatting
promoted better understanding (which it doesn't for me), to even work with
it requires reformatting. I don't see how your code is usable by anyone
else as is.
What is unreadable? And I disable the use of tabs; I always replace tabs with spaces,
since that is universal. I don't see a problem with indentation, because even when I use
VS to edit my code, it gets the identation right, following my indentation style.
****
****
I think your idea of proper indentation is along the lines of your opinions
of ActiveX and Win64: interesting, but not applicable to the rest of us.
You should not call the IDE a third rate editor when your demands are such
as these.
I expect an editor to HELP me create code. This means that it has to be fully usable from
the keyboard without requiring function keys, arrow keys, or the mouse. This is one of
the most critical criteria. VS editor is not really usable in this fashion. It has to
get indentation right. It has to automate all the same things that my current editor
automates for me, which are considerable. Automatic flow and justification of comment
text, automated change log handling, ability to insert multiple characters quickly (if I
want to put 77 asterisks in, it is Ctrl+U 77 *), automating the block comments I use.
The capabilities of automating the VS editor are so poor that I can't even do the simplest
of my automation; worse still, the creators of VS think that there is no reason to allow
me to add automation to every possible keystroke, including printable characters; the key
bindings are limited to control keys, alt keys, and function keys, making it relatively
useless to me.
The failure is that MS thinks that editors are technologies. Editors are not
technologies, they are religions.
joe
****
Joseph M. Newcomer [MVP]
-- 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: bool or BOOL in MFC projects
- Next by Date: Re: AfxGetApp() returns NULL
- Previous by thread: Re: AfxGetApp() returns NULL
- Next by thread: Re: AfxGetApp() returns NULL
- Index(es):
Relevant Pages
|
Loading