Re: AfxGetApp() returns NULL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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.

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.

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.

-- David


.



Relevant Pages

  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... so you don't need to rely on your editor counting for you. ... screen reader that understands indentation. ... And sometimes you mess up and delete braces you shouldn't have. ... Start/end markers plus indentation carry ...
    (comp.lang.python)
  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... > Braces are very convenient to match block start and end. ... and press % in command mode on some brace.. ... because you can *see* where the indentation ... so you don't need to rely on your editor counting for you. ...
    (comp.lang.python)
  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... >> Braces are very convenient to match block start and end. ... > You don't need to, because you can *see* where the indentation ... so you don't need to rely on your editor counting for you. ... But you can't alway easily discern by how much. ...
    (comp.lang.python)
  • Re: ANN: Dao Language v.0.9.6-beta is release!
    ... If your editor is smart enough, ... > if I delete ifI get a syntax error about unmatched braces. ... you've deleted the line and you get a syntax error. ... plus indentation than I am thinking about just indentation. ...
    (comp.lang.python)
  • Re: Coding [style] standards
    ... It also reduces the maintenance of braces; ... and other programmers to read, ... Use indentation to emphasize scope. ... But I indent curly brackets to the scope of the function body: ...
    (comp.lang.c)