Dear Monks
I read sometime that creating algorithm for given problem is much harder than finding the uses of algorithm. If the steps between answer code and problem are described in detail. then that would be helpful to solve many more problems.

Sometimes I am looking for approaches towards solution rather than just the program code beacuse it may be possible and easy to write the code myself based upon the approach. I believe that we all can benefit with it and it can also provide the ability to think clearly in general towards problems and possible solutions. While I appreciate the code-solutions, it will also save the time for fellow monks to write the code everytime and use the helping hands in providing approaches.

This would provide a good exercise of improving 'systematic problem solving ability' and 'looking at the domain' where you can think of more than one thing and choose from the options rather than hands down coding from the beginning.

It will also solve one more problem in the long run: Documentation. If approaches are described and exchanged and discussed, documentation would be the easy part even after completion of the project

What you gain besides material values from the project is not the 'code' but the insight that you have used to complete the project which can be helpful in building your experience and that should be discussed more.

If this is/is not the forum to discuss this, I would appreciate any pointer which discusses similar issues.

Hope to build useful art,
Artist

Replies are listed 'Best First'.
Re: Solution Approach
by gjb (Vicar) on Dec 23, 2002 at 18:22 UTC

    In general I'd agree with you, except that it takes more time to write down the approach to the solution clearly than to provide the code. This may seem at odds with intuition, but I guess more experienced programmers/problem solvers than myself will agree.

    There's another point to consider: often a solution to a problem comes as a "flash of inspiration" rather than a consicious process. In such cases I don't know how to explain the path to the solution, it just appears before the mind's eye.

    But yes, you certainly have a very valid point and maybe we should make the effort to emphasize problem solving approaches rather than provide just a piece of code that works (or should work ;-)
    I'll try...

    Just my 2 cents, -gjb-

Re: Solution Approach
by Ryszard (Priest) on Dec 23, 2002 at 18:26 UTC
    I read sometime that creating algorithm for given problem is much harder than finding the uses of algorithm. If the steps between answer code and problem are described in detail. then that would be helpful to solve many more problems.

    I'm not sure i necessarily agree with this statement. It would seem to me to imply that you're going off creating algorithms without a clear idea of what you want.

    Documentation should be a part of your solution design anyways. From a design perspective the method i use to describe an algorithm is a UML / use case based approach. This gives me enough room to break down the problem then describe its components to a very detailed level including exceptions.

    It will also solve one more problem in the long run: Documentation.

    Anyone who is serious about their projects and the long term viability of their code should have their algorithms and application design documented anyways. It eliminates (or reduces) the bus factor associated with many shops. In a broader sense, on one hand no documentation may equal job security, but on the other hand, it also means you cant get promoted.

    Its not really clear to me what you're attempting to demonstrate here.. colaborative design effort? code reuse, best practice?

    Lots and lots of code ends up being one offs, and quite often taylored for a specific purpose - meaning the algorithm is really only useful in that situation. Looking at a wider picture there are lots and lots of permy solutions/algorithms that are designed as reusable solutions. Check out CPAN, a perfect example.

    One of the things I love about perl is it is easy to go both ways. A dirty hackup that will do the job just that once for you can be written quickly, as can a more robust library that can fit into your growing toolbox...

      Ryszard,
      Thanks for the comments.

      I read sometime that creating algorithm for given problem is much harder than finding the uses of algorithm. If the steps between answer code and problem are described in detail. then that would be helpful to solve many more problems.

      ---I'm not sure i necessarily agree with this statement. It would seem to me to imply that you're going off creating algorithms without a clear idea of what you want.

      Well, this step comes only after defining the problem. It's about practicing building algorithms to solve the problem --Documentation should be a part of your solution design anyways. From a design perspective the method i use to describe an algorithm is a UML / use case based approach. This gives me enough room to break down the problem then describe its components to a very detailed level including exceptions.

      It will also solve one more problem in the long run: Documentation.

      --Anyone who is serious about their projects and the long term viability of their code should have their algorithms and application design documented anyways. It eliminates (or reduces) the bus factor associated with many shops. In a broader sense, on one hand no documentation may equal job security, but on the other hand, it also means you cant get promoted.

      While UML is definitely helpful, Not all projects requires UML, or not everyone here has access or familiar with URL or VISIO to use it. Also so the projects sometimes grows in organic fashion as per requirement, starting very small. 'Necessasity of being serious about the project from the beginning' can be embeded subconsciosly atleast partially in the thinking of approaches towards solution

      What I am trying to promote is faster and matured insights towards the problem, will help ultimately to build better solutions and apporach reuse.

      I agree 100% with your point about CPAN and Snippets like items. We need something similar for 'approaches' which can actually be archive of algorithm behind CPAN modules or Snippets and then alternative approaches/algorithms can be discussed to make it more robust.

      Artist