I had ever read the compiler books, and I wanted to use its logic to let you know how to compile your idea. Actually, the programming syntax is not the main problem, but the solving procedures. The programming syntax is just the fundamental knowledge, and you should know all of the programming syntax firstly. However, the mathematical ability is possible to become the problem, calculus, geometry … etc, for examples. I am developing a gutter program for my company, and I can show you just a little bit C source code as follow.
In the first subroutine, I want to let my for-loop faster, so that I use the special syntax. If you query about this syntax, you can try to run it on a C compiler. Although the syntax is the fundamental knowledge, you still have to spend time practicing it. In the other subroutine, you can see a slope formula. All of the details are written by the pointer and structure, so that you can feel it is very like an object-oriented writing style. Actually, I write this program in C, not C++. I write the function pointer sometimes, but it's not necessary for each program. If you want to let your program faster or better, you shall study the syntax firstly. Besides, please don't forget to free the memory for your pointer and use the global variables as far as you can in C.
In case you want to write the window applications, you can use GTK+, OpenGL … etc. Most of them are written in C, and you can use C to call these window libraries. Next, you need to study Numerical Analysis and Computational Geometry, or you are going to meet many computing problems. Actually, I also meet the computing problems every often, but I always try to solve the problem step by step. I'll go to the library to find a relative book, and I try to follow its procedures to write my program. And then, I need an example to debug the mistakes. Every language has the runtime errors, and C also has the same problem. I catch the errors, and let the menu subroutine decide how to do. On the other hand, perhaps you want to use the commercial library, and I think you can choose one of the present libraries, IMSL for example.
Before you write the program, you can use your logic to compile your idea in your brain firstly. How do you compile your idea by your brain? You need to find the very small problems for your idea, or you may meet the setback during your research and development. If you think this process is not important, you shall waste much time and change your idea later. All of the bad processes are not necessary, and you can abandon some bad ideas which cannot pass your brain compiler. Of course, you can find some people to help you solve your idea problem. I think the brain compiler is very important for the RD engineers, and I have showed you my approaches. Before you start to write the program, please compile you idea.
References
void Initialize() {
int index_i = 0, _GUTTER_SECTION_QUANTITY = _SECRETa;
double index_width, index_height, _GUTTER_MAX_HEIGHT, _GUTTER_MAX_WIDTH = _SECRETb, _GUTTER_MIN_SIZE = _SECRETc,
HEIGHT_WIDTH_RATIO = _SECRETd, _INTERVAL_SIZE = _SECRETe, _WATER_LEVEL;
/*----------------------------------------------------------------------------------------------- Gutter Section ---*/
_gutter_section = (struct gutter_section *)calloc(_GUTTER_SECTION_QUANTITY, sizeof(struct gutter_section));
for (index_width = _GUTTER_MIN_SIZE; index_width < _GUTTER_MAX_WIDTH; index_width += _INTERVAL_SIZE)
for (_GUTTER_MAX_HEIGHT = (index_height = index_width) * _HEIGHT_WIDTH_RATIO; index_height < _GUTTER_MAX_HEIGHT;
index_height += _INTERVAL_SIZE) {
...
}
...
}
enum Error_Message Hydraulic(char *arg) {
enum Error_Message _ERROR = NORMAL_FUNCTIONING;
...
/*---------------------------------------------------------------------------------------------- Gutter Slope ---*/
_gutter[index_i].slope = (_gutter[index_i].dependent->start->elevation - _gutter[index_i].dependent->end->elevation)
/ _gutter[index_i].length;
...
return _ERROR;
}
int index_i = 0, _GUTTER_SECTION_QUANTITY = _SECRETa;
double index_width, index_height, _GUTTER_MAX_HEIGHT, _GUTTER_MAX_WIDTH = _SECRETb, _GUTTER_MIN_SIZE = _SECRETc,
HEIGHT_WIDTH_RATIO = _SECRETd, _INTERVAL_SIZE = _SECRETe, _WATER_LEVEL;
/*----------------------------------------------------------------------------------------------- Gutter Section ---*/
_gutter_section = (struct gutter_section *)calloc(_GUTTER_SECTION_QUANTITY, sizeof(struct gutter_section));
for (index_width = _GUTTER_MIN_SIZE; index_width < _GUTTER_MAX_WIDTH; index_width += _INTERVAL_SIZE)
for (_GUTTER_MAX_HEIGHT = (index_height = index_width) * _HEIGHT_WIDTH_RATIO; index_height < _GUTTER_MAX_HEIGHT;
index_height += _INTERVAL_SIZE) {
...
}
...
}
enum Error_Message Hydraulic(char *arg) {
enum Error_Message _ERROR = NORMAL_FUNCTIONING;
...
/*---------------------------------------------------------------------------------------------- Gutter Slope ---*/
_gutter[index_i].slope = (_gutter[index_i].dependent->start->elevation - _gutter[index_i].dependent->end->elevation)
/ _gutter[index_i].length;
...
return _ERROR;
}
In the first subroutine, I want to let my for-loop faster, so that I use the special syntax. If you query about this syntax, you can try to run it on a C compiler. Although the syntax is the fundamental knowledge, you still have to spend time practicing it. In the other subroutine, you can see a slope formula. All of the details are written by the pointer and structure, so that you can feel it is very like an object-oriented writing style. Actually, I write this program in C, not C++. I write the function pointer sometimes, but it's not necessary for each program. If you want to let your program faster or better, you shall study the syntax firstly. Besides, please don't forget to free the memory for your pointer and use the global variables as far as you can in C.
In case you want to write the window applications, you can use GTK+, OpenGL … etc. Most of them are written in C, and you can use C to call these window libraries. Next, you need to study Numerical Analysis and Computational Geometry, or you are going to meet many computing problems. Actually, I also meet the computing problems every often, but I always try to solve the problem step by step. I'll go to the library to find a relative book, and I try to follow its procedures to write my program. And then, I need an example to debug the mistakes. Every language has the runtime errors, and C also has the same problem. I catch the errors, and let the menu subroutine decide how to do. On the other hand, perhaps you want to use the commercial library, and I think you can choose one of the present libraries, IMSL for example.
Before you write the program, you can use your logic to compile your idea in your brain firstly. How do you compile your idea by your brain? You need to find the very small problems for your idea, or you may meet the setback during your research and development. If you think this process is not important, you shall waste much time and change your idea later. All of the bad processes are not necessary, and you can abandon some bad ideas which cannot pass your brain compiler. Of course, you can find some people to help you solve your idea problem. I think the brain compiler is very important for the RD engineers, and I have showed you my approaches. Before you start to write the program, please compile you idea.
References
- Wikipedia, GTK+, http://en.wikipedia.org/wiki/Gtk
- Wikipedia, OpenGL, http://en.wikipedia.org/wiki/Opengl
- Wikipedia, IMSL Numerical Libraries, http://en.wikipedia.org/wiki/IMSL_Numerical_Libraries