Research Paper on Concepts of Programming Languages

Only available on StudyMode
  • Download(s) : 52
  • Published : January 30, 2012
Open Document
Text Preview


Submitted by

Bustamante, Andrew
Lorenzo, Erika
Manarang, Paolo Marco
Young, Jennifer

Ms. Charibeth Cheng

December 3, 2010

I. Introduction
II. Scope and Limitation of the Research
III. Macros
a. Definition
b. Usage
c. Advantages and Disadvantages
IV. Conclusion and Recommendation
V. References

I. Introduction
Macros are scripts that provide a way to automate a task performed repeatedly or on a regular basis. It involves a series of commands and actions that can be triggered by performing specific commands through the keyboard, mouse, program compilation, etc. Tasks performed by macros are commonly repetitive in nature. In effect, macros decrease the time it would take for users to do these repetitive actions in an application. These tasks can be as simple as inserting names and addresses into a word processor or as complex as launching a program, copying data from it, activating another program, pasting the data into it and repeating this several times. II. Scope and Limitation

The research will discuss the usage of macros in different programming platforms; its advantages and disadvantages. At the end of this research paper, a constructive comparison of the disadvantages and advantages will be provided. Recommendation for the use of macros derived from the given advantages and disadvantages would be part of the research scope.

The programming languages that will be used for this research will include languages under the following categories: 1. Object Oriented
2. Procedural/Imperative
3. Applications with macro programming
One language will be chosen from each programming language category and 2 applications will be used for the application macros. These languages or applications were chosen because of the following reasons: 1. The researchers’ knowledge of the languages or applications 2. The current programming language trend in the society 3. The impact of the programming language to the current programming languages The following applications and languages were chosen for each category: 1. Object Oriented – C#

2. Procedural/Imperative - C
3. Applications with macro programming - MS Excel and Access through VB Programming

III. Macros
a. Definition

One definition of a macro is “a special kind of translation that may occur as the first step in the translation of a program”[1] or instructions that “generate a word or sequence of words”[2]. However, in a more generic way, a macro can simply be defined as “a series of commands and instructions that you group together as a single command to accomplish a task automatically”[9] These can be done by pressing a button, performing a series of keyboard commands (i.e. ctrl + a + b) , etc.

In programming language, a macro may be used as a way of extending the syntax of the language in a controlled way. The main purpose of macros in programming languages is to provide a way for the programmers to define a new syntax and be able to convert it to the language’s own syntax.[5] This provides flexibility in any programming language and the ease of writing programs in that language also increases.

However, note that although writability in that language increases, the readability of the source code does not necessarily increase with it. Since macros provide a way for programmers to extend the language, there is no strict rule to prevent a programmer from defining a macro which does not describe the procedure it is performing. Consider the code segment below: #define Sum (2 * 4)

void main()
int i = Sum;

Reading the code segment, the expected result will be the result of adding 2 to 4 since the macro name is Sum. However, as can be seen in the macro definition, the macro Sum is not defined as adding two numbers rather it multiplies...
tracking img