Re: How to do this?

Tech-Archive recommends: Fix windows errors by optimizing your registry



If I might make another observation about Jon's excellent discussion: This
process of refactoring is an excellent way to solve a problem. Quite often,
it is difficult to write the most elegant, or the most optimal code in the
beginning. A good developer will often begin by writing out a long solution,
what I like to call "bludgeoning your way through" the problem, ignoring the
optimizations in the beginning. Once the first draft of the code is done,
one can look it over for sections that can be refactored, repeated code that
can be made into loops or functions, and other optimizations. As Jon
illustrated, the re-analysis and refactoring process can be repeated, as
each new configuration of the code tends to suggest its own optimizations.
This process generally ends up taking less time than attempting to write the
leanest code on the first run.

And of course, for someone who is learning (as we all are, I would hope),
the most important goal is realized first, which is writing code that does
the job. As you progress with your skill and practice, you will be able to
spot more and more ways of making it leaner, more reusable (writing methods
and classes that perform common tasks), and more extensible.

--
HTH,

Kevin Spencer
Microsoft MVP
Computer Control Freak
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.

"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1f936999489b799998d528@xxxxxxxxxxxxxxxxxxxxxxx
Amanda <amanda772008@xxxxxxxxx> wrote:
<snip>
Do let us know how you get on with the above - and if any of it doesn't
make sense, please say and I'll go back and explain in more detail.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


.



Relevant Pages

  • Re: How to do this?
    ... Kevin Spencer wrote: ... process of refactoring is an excellent way to solve a problem. ... A good developer will often begin by writing out a long solution, ... can be made into loops or functions, and other optimizations. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: unit tests == ugly code?
    ... On of the TDD pitches is that the tests present a constant design pressure ... My test to check if my list articles works shows some strange semantics, ... If you are writing tests and not refactoring, I think you are missing a main ...
    (comp.lang.ruby)
  • Re: Language Features Id Like To See
    ... > The refactoring and other features in D2005 are a good ... but we need more automation to ... Refactoring, of course, doesn't help the writing but the rewriting. ...
    (borland.public.delphi.non-technical)
  • Re: Code Coverage and QC
    ... >Jason Nocks wrote: ... Writing new code to replace old code is ... >many other people use refactoring to mean what you ... Object Mentor Inc. ...
    (comp.object)
  • Re: Without a flame please! Extreme Programming!
    ... Jon Skeet wrote: ... So does that mean you think automated testing and refactoring are bad ... Stede ...
    (microsoft.public.dotnet.languages.csharp)