Things computer science students should know before attempting a programming assignment are plentiful. Some of these things are common sense, but many others might surprise you. It is not unusual for computer science teachers to be completely unaware of common practices within the computer field. To make matters worse, they don’t always have the resources to learn these things themselves.
A common practice in many programming languages is the use of macros. Macros are used to accomplish some tasks that would normally take an entire manual entry. For example, a parent can use a macro to tell the child how to perform a task. A programmer can write a macro to print out the names and dates of all the files in a program as they are being used. There are many reasons a programmer might want to utilize this type of macro. However, it can sometimes cause a computer science student to be confused.
In order to understand why a computer science student would need to understand macros, it helps to know how they work. A macro is defined as a single-step procedure that is repeated repeatedly. The first time a macro is defined, the computer reads the source code and then executes the macro. Once that is done, any subsequent calls to that macro will just return to the point where the macro began.
An excellent way for a CS student to remember why a macro is defined is by thinking of a standard function such as the functions(I) or not. Inside those functions there is a series of embedded expressions. For example, cout is used to define a string variable. If that string variable is not empty, then it will display “”; thus creating the embedded expression, which is the macro expression. After that, any assignment of an argument, if needed, can be performed on the embedded expression using the arguments given to the macro.
There are many uses for macros in computer science. One way to use a macro is to create a temporary variable to store a formula. The CS student can then use the formula as a single-step procedure that is called an expander. Afterward, all the results are displayed the same way as the original expression, without having to store the original expression.
Another way to use macros in the lab is when a CS student is working on an assignment and needs to test a result. Rather than repeating the entire procedure, he can write a short piece of code that will evaluate the result of the previous step. Then all the other steps can be written as macros that simply access the previous step and run the macro. This saves the computer user considerable time and typing.
The other way to use macros in the lab is when a student is working on a problem that is algebraic in nature. An example of this might be evaluating the value of a definite integral using only the denominator or squared root of a definite integral, which is a simple operation on a computer. When the student uses a macro expression, he can simply type in the exact expression, evaluate it using a mathematical calculator and then save it so that he can refer back to it later.
In summary, macros are useful in many areas of computer science. Students should take the time to learn and use them. They should also be used with a important site macro editor such as the Microsoft Excel. Doing so allows students to be more efficient in their own time and allow them to better understand and work with macro functions.