To code - I guess it is a pretty awkward thing to do , to make or implement an algorithm is a sane thing to do. Coding in itself is not language oriented , yet it influences the thinking pattern . I have used FORTRAN , MATLAB , Ruby and Python intensely . Only thing i was about to make out was before you look into code look at the mathematics, develop algorithms and chart out a flowchart.
The great codes are well structured in nature and have room to grow. The language itself presents the ease of implementing the algorithms with ease or without ease. A normal software professional approach is pragmatic and patched one . An engineer's approach is planned , mathematical and detailed. Precision needs a detail. It is always possible to improve upon code with the power of the programming language but it is not possible to improve algorithm as such.
A few of the points i gained over the years are presented below:
1. Limiting oneself is a key to create a better mathematical representation of the problem .
2. Lots of languages have a lot of modules built , to learn each of them is a mess - Before you actually code present the flowchart and psuedo code . Then eliminate the parts of it by intense search over the web.
3. A great code is implementation oriented , not logic oriented . People have written better logic , but gets used by someone with better implementation.
4. The mathematics is very tricky thing to do. The way to convert maths into an algorithm that could be understood by computers is more important. The recommended steps to do that are :
- Do not understand the method before solving the problem . Solve the example by looking at the methodology used. Why? - Because when you look at something incomprehensible to you means it is incomprehensible to do for computer too.
- Once a problem is solved , see what parts of the solution follow logic without assumptions . Now understand the method and solve the problem .*( I am hoping the concepts are clear before even starting all this excercise.)
- Solve the same problem again . See the mathematical flow of things , when you get that clear . You can jump to writing the flowchart.
- Now write the psuedo code and each step is analysed with respect to language .
- Now jump start your coding !
5. Now when code , remember it is an iterative process . The same things are to be implemented . It is very well established that while finding the newer procedures or tricks you may try to change the algorithm and this is bad.
No comments:
Post a Comment