Tips to develop C code from scratch.....
I have been blessed to get a chance to really write a from scratch code (before that deciding directory structure and creating blank file also ;)) but simultaneously punished for proceeding directionlessly with the team (even when there was a team leader leader :P).
Out of hard things I have learnt following lessons while going for a from scratch development.
1. Decide return codes first.
I think all the robust codes are formed due to proper handling of return codes of functions calls. If an enumeration comprising of all the required return codes is finalized before hand then the module writers can effectively use them so that alongwith robustness there is a consistency among the modules. Also to finalize on error codes one has to fully know what he wants to do - the big big key for success.
2. Decide upon coding style
Yes, this has to be taken next. If you don't take it now you will never take it later when your code is functional. Even if you take it with lot of resolve (an of course great pain) you are bound to get an overhead of rework.
3. Next course of action is deciding function prototypes and structures. I am not yet sure of the order in which these should be taken. But probably these have to be taken recursively in a circular manner. Nontheless we know what should be decided before landing here.
Happy coding :)
P.S. I may most likely update this post as my experience with code design matures. Between if somebody knows other sources on same matter then please inform me about then in comments.
Out of hard things I have learnt following lessons while going for a from scratch development.
1. Decide return codes first.
I think all the robust codes are formed due to proper handling of return codes of functions calls. If an enumeration comprising of all the required return codes is finalized before hand then the module writers can effectively use them so that alongwith robustness there is a consistency among the modules. Also to finalize on error codes one has to fully know what he wants to do - the big big key for success.
2. Decide upon coding style
Yes, this has to be taken next. If you don't take it now you will never take it later when your code is functional. Even if you take it with lot of resolve (an of course great pain) you are bound to get an overhead of rework.
3. Next course of action is deciding function prototypes and structures. I am not yet sure of the order in which these should be taken. But probably these have to be taken recursively in a circular manner. Nontheless we know what should be decided before landing here.
Happy coding :)
P.S. I may most likely update this post as my experience with code design matures. Between if somebody knows other sources on same matter then please inform me about then in comments.
Comments