Hobbies And Interests
Home  >> Science & Nature >> Science

The Advantages of Generalized Algorithms

Algorithms are often associated with computer programming, but they're really just a method for problem solving. Think of an algorithm as a very specific recipe to solve a problem. The logic of an algorithm may be written in universal or general terms, or in the same language as its final form, such as a specific programming language. There are a number of advantages to writing your algorithm in a generalized form.
  1. Prescriptive Limitations

    • Imagine a programmer skilled in one specific programming language. He knows the strengths and weaknesses of the programming. In addition, he has his own style and approach to this programming language. If he writes his algorithm in the code, he almost certainly restricts the algorithm to his knowledge of the language's limitations and his own.

    Solution-Centric

    • Rather than the prescribed limitations of writing algorithms in code or pseudo-code, using generalized logic frees you to focus solely on the solution to your problem, not the implementation of the solution. It presupposes that, once you define the best algorithm, you'll figure out how to implement it in the environment you have in mind. It may also presuppose that a solution in the algorithm might prescribe its own implementation.

    Assumption Avoidance

    • Using generalized logic helps you avoid a variety of assumptions. Even if your assumptions have some basis in fact, and may actually serve to streamline your process by preventing dead end solutions, they can also be limiting. For example; if you suspect you're heading toward a viable algorithm you don't have the resources to implement, it may be wise to listen to your intuition, in spite of its basis in assumption. Be aware, though, if you succumb to assumption -- you may leave the best ideas undiscovered.

    Non-specialist Friendly

    • If you're writing an algorithm to solve a problem and you don't have any knowledge of the implementation details, it may actually be helpful. Let necessity guide the process in which you're an expert; hand the algorithm off to an implementation expert. Separating the two steps takes more resources, but it can also produce better results.


https://www.htfbw.com © Hobbies And Interests