Re: AfxGetApp() returns NULL



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

On Tue, 18 Dec 2007 05:24:28 GMT, "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote:

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:8ncem356k8d7qhhmjfp9g1vl7pdj01t6ca@xxxxxxxxxx
I have no idea what "standard MFC style" is, but out of the box, the
indentation sucks,
and there is, through VS2003, no setting that makes indentation work even
vaguely like I
require.

I will evaluate VS2008 when I receive it. This has not yet happened.

Standard MFC style is what the wizard generates and what is shown in source
code listing in MSDN Magazine and MSDN itself. It's K&R style.

VS2003 also has the checkbox

[ ] Indent braces


Tools | Options

Select Text Editor | C/C++ | Formatting


It sounds like an afternoon in the IDE Options dialog may make you
appreciate the IDE yet.

-- David


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: AfxGetApp() returns NULL
    ... I've been using the same indentation style for about 30 years, ... basic tests of human perception limitations. ... Note that the "indent braces" option still gets the indentation wrong; ... fighting a third-rate editor when I have a first-rate editor already. ...
    (microsoft.public.vc.mfc)
  • 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)
  • 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)

Loading