In VFP, I do exactly what Craig doesn't like but only in general sections, not for each code block:
new code here
...
or general:
etc...
however, it is more functional, not specific to what each code block does, because that should be evident to a programmer who knows VFP
in dotnet, we use xml comments for functional sections as well so the developer who comes along later understands the 'purpose' of the code. We don't add specific comments for every single thing because any developer who understands that language should get that immediately.
>I put a blank line after sections of code - helps me keep them separate in my mind - and after years of typing other peoples' term papers, I can't type a comma without a space. I just can't and you can't make me, so THERE!
>
>But, still being a lazy typist, I'll use the first 4 letters of a command, then either let Intellisense fill it in (if it's there) or run Beautify and let it expand the command.
>
>
>>I'm not saying that one way is right or another is wrong. Just offering a differing opinion. *G*
>>
>>You can pass the property as a parameter, then have the decsion made.
>>
>>And yes, I don't know the entire architecture. But, IMO, there are still other ways. See Bob Martin's book.
>>
>>There is good in the code:
>>- Liberal use of white space. Too many people don't use blank lines, which makes the code hard to read. Using a space after the comma in a parameter list and around the equal sign in the assignment statements are other important ones.
>>- Using the full function/command name rather than the first four letters
>>
>>>Ah, yes... Free code review. I love it. Thanks. As a solo dev, I rarely get feedback on my code. Especially from an expert.
>>>
>>>I certainly subscribe to this (relatively) recent craze about correctly architected code. I've heard MANY podcasts on it in the past couple of years, and honestly, I can't get enough of it. It has caused me to re-write, and then re-write again many sections of my code.
>>>
>>>So, help me get the full idea of what you've presented here. I do see the beauty in it, and I like the idea, but let me explain why I did it the way did (not that I'm trying to justify or convince you, or me, that I am right).
>>>
>>>Your saying move the IF test into the called method, rather than addressing it where I did, at the higher level method, right? Now, the test is against a class property that will dictate wheter the target method should be called. I'm sure you see that. The reason I chose that architecture was so that I could call that target method from various other places,
irrespective of the controlling class property; which I sometimes need to do.
>>>
>>>This let's me call the target low-level method outright and know that it will fire, otherwise, I'd have to (1) store the current value of the class property, (2) set it to true (3) call the target method (4) restore the original value.
>>>
>>>I can see the case for it both ways.
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"