Guidelines for writing optimal C program
The purpose of this thread is to know:
1- What makes one C program more powerful than other C program
2- What is the things that you avoid when writing your C program in order to conclude with robustness and perfect program – the type of variable ..etc
3- What is the optimal format of C program
4- What is your first object –as a good C programmer—when you start writing your program
5- Do you concern of the time required to execute the C program
Optimal is as optimal does...
Here's my 2 cents worth......
You can't boil it all down like that.
If an emergency rises, and I need to crank out something to fill a need and have an hour to do it, the program that I write that fills the need IS the optimal program.
It might not run as quickly or efficiently as one that I would spend days writing, it might not be as extensible as one that is more correctly designed. It could be a total hack. But given those initial requirements, it would be THE optimal program.
Barring that, I tend towards good design, efficient coding, and the ability to be extensible. I can't tell you how many times over the years I've written something and within a year or two, so many more features have been added. Thinking extensibility early on saves me time later.
And even after 25 years in this game, I'm still learning -- that's for damned sure ;)