Honestly, there’s no hard and fast rule when it comes to solving a given problem or solution regarding suitable algorithms. It depends on the nature of the problem.
The WYWIWYG (what you write is what you get) principle holds true for complete software and for any subdivision of an algorithm that has solved any problem. It defines the part of the algorithm that’s being considered. The problem and the solution provided by the software are supplied by the algorithm and must be balanced with the problem of challenges encountered during algorithm design.
Choosing the best solution for any specific problem can only be done with industrial software experience and practice.
Rules for Algorithms
In any complex problem, first take the algorithm around the completed software procedures/problems, and if possible, make sure that the problem is well-defined and that the solution pattern is well-stated. What exactly is the problem? What solution are you expecting? What is the unexpected solution?
Select each algorithm to subdivide the problem into single steps and make a balance over each stage separately.
Select the algorithm around any of the same problem stages to reduce the number of known and unknown streams to as few as possible.
Now, any of your specified algorithms can be subdivided in an arbitrary way to facilitate problems and solutions. The judicious choice of the software algorithm can often be simplified to avoid torturous problems.
Honestly, no hard and fast rule can be given when it comes to solving a given problem or solution regarding suitable algorithms. It is a matter of judgment and depends on the nature of the problem.
Suppose you are to provide an app with a single input text to make an online payment, i.e. to collect the user’s payment details:
- Receiver’s account number.
- Amount to be received.
- Receiver’s bank name.
- Sender’s card number.
- Sender’s CVV number.
The question lies in whether we to have a defined variable to hold each data or a single variable to hold all data.
The answers will definitely vary based on the software algorithm choice. Are you going to go the wet (write everything twice) or dry (don’t respect yourself) route when it comes to your software?
I hope this make your day better