Re: AfxGetApp() returns NULL




"Tom Serface" <tom.nospam@xxxxxxxxxxxxx> wrote in message
news:B6163C57-D14D-426B-B862-EC4A3138A67A@xxxxxxxxxxxxxxxx
Hi David,

I think that the style of formatting code is as subjective as anything can
get in our business. I've worked with people that absolutely believe that
God intended us to use the format:

if (...)
{
}
else
{
}

And I go to the church of more real estate and use:

if (...) {
}
else {
}

I also do this a lot:

if (...)
// One line of code
else
// One other line of code

I would put the else on the same line as the closing brace for the
previous if, but that is *too* difficult to read. The thing I like the
least is when people use this format:

if (...)
{
}
else
{
}

But, like I said, everyone has their preferences. Kind of makes you with
K&R had imposed a format from the beginning. I've found that a good way
to get to know code that I inherit is to reformat it. It makes me go
through each line and think about all the blocks.


Hi Tom, sure these are all common indentation themes that are readily
supported by programmer's editors, and it is no big deal to go from one to
another one of these. The IDE lets you do that. But when Joe knocks it for
not out-of-the-box supporting his entirely non-standard indentation style
(have you ever heard of indenting one space past the brace?) and then calls
the IDE a third rate editor because of things like this, I want to get the
point across that it is his expectations that are more out of line with
reality than the IDE's shortcomings. While I would grudgingly tolerate code
to be checked in that followed any one of the formats you illustrate,
because they are at least standard, I would insist Joe's code be reformatted
prior to checking it into the codebase since it is too much to ask other
team members to get used to this entirely non standard code style.

I agree that reformatting the code is a good way to learn it, and after
reformatting it, stepping through in the debugger is even more helpful.

Cheers,
David


.



Relevant Pages

  • Re: Corrupted OS
    ... Is it possible to rebuild an OS without reformatting the hard drive? ... First of all, strictly speaking, when installing FreeBSD you never ... FreeBSD and all other OSen use the factory format ... somewhere safe and do the complete reinstall from scratch and then ...
    (freebsd-questions)
  • Re: Web custum control
    ... text within a textbox and moves the insertion point along. ... I recommend letting users enter text in your format and reformatting as they ... Creator of "Professional Validation And More" at ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: hardware problem or virus?
    ... keep performance up with out having to format. ... can install windows and get to anything. ... on the spare drive while i was reformatting the other. ... So i reformatted again, except now it wont install windows either, i tried ...
    (microsoft.public.windowsxp.hardware)
  • Re: Corrupted OS
    ... Is it possible to rebuild an OS without reformatting the hard drive? ... First of all, strictly speaking, when installing FreeBSD you never ... FreeBSD and all other OSen use the factory format ... somewhere safe and do the complete reinstall from scratch and then ...
    (freebsd-questions)
  • Re: How do I reformat a hard drive when running XP?
    ... How do I go about formatting the drive with a recovery disk? ... Instead of reformatting when you use the boot disk you can use FDISK ... and delete the non-DOS partition on the hard drive. ... format the empty partition, ...
    (microsoft.public.windowsxp.help_and_support)