Total Pageviews

Tuesday, March 29, 2011

Source Code vs. Executable Code


In the world of programming, programmers should familiarize themselves with a number of programming terms to become effective programmers. Amongst the terms a programmer should familiarize themselves with are Source Code, Executable Code, Object Code, Assembly Language, Compiler, and Interpreter. Of the aforementioned programming terms, non-programmers often misunderstand and confuse Source Code, Executable Code, and Object Code with one another.  In some cases, non-programmers consider these three terms to mean the same thing. My goal for this commentary is to provide a description of the above-mentioned terms and how they pertain to Source Code verses Executable Code.

Let us start with Source Code. Source Code is the foundation of a program because it is the programmer’s original syntax for a computer program, which the programmer writes in certain programming language (e.g. Visual Basic). Computers do not understand Source Code. Another way to think of Source Code is to imagine a person writing a set of instructions, in their native language, for another person to execute. For this scenario, let us assume the native language is Spanish and the person who must carry out the instructions only knows English.

Next, we need a Compiler. A Compiler is a program that changes Source Code into Object Code. To add to our metaphors above, a Compiler would be like a Spanish/English translator who reads the instructions and then organizes them to an understandable format that the translator can then transform. This understandable format would be what is considered Object Code. Object Code, is the Source Code instructions after they have been collected and organized. Another option a programmer has besides a Compiler is an Interpreter. An Interpreter is program, which executes commands written in a high-level language. An interpreter translates high-level instructions into an intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly into machine language. Utilizing an Interpreter instead of a Compiler would be like having the translator carry out the instructions because the translator can read, interpret, and execute the instructions.

Once the Source Code is compiled into Object Code, the programmer would then need to convert the Object Code to Machine Language or Assembly Language. Machine Language is the lowest-level programming language, which is the only language that computers comprehend. Assembly Language is similar in construction to Machine Language but it allows programmers to utilized names instead of numbers. This conversion would be the translator rewriting the instructions in English so the person responsible for carrying out the instructions comprehends what they need to carry out.

The final step is the Executable Code, which is the code that is carried out by the computer. Executable code is like instructions, after they are translated and written in English, and then read by the person responsible for executing the instructions. Once all these stages are complete, the programmer should be able to successfully their program on the computer for which they wrote the program. In addition, the person who received the instructions from the person who spoke a completely different language should be able to successfully execute the them.

Wednesday, March 9, 2011

GUI Object oriented languages


In programming today, there are several tools available to facilitate many programming endeavors. The tools that will most benefit the programmer will be dependent on the programmer’s objective. Since there are an abundance of potential programming objectives out there today, let us focus on something simple, more specifically, a simple game. In addition, since there are so many programming languages / tools available today, we will limit our selection to one of the following programming languages:

BlueJ
Visual Basic
# Matisse in Netbeans
# JFormDesigner
# BuoyBuilder
# Visual Editor for Eclipse.
# SwiXML
# JAXX

If I were creating a simple game with a GUI (Graphical User Interface), I would have lean towards using an Integrated Development Environments (IDE) because I feel they make object-oriented programming faster, easier, and more efficient. From the IDEs above, I would definitely utilize Visual Basic because the programming language facilitates the creation of simple GUI applications and the more complicated applications. Another important factor is that Visual Basic developers devised the programming language to make programming easier for advanced programmers, but also enables new programmers to easily comprehend and utilize the language. Furthermore, Visual Basic allows the programmer to visually assemble controls on a form and since the attributes and actions for these controls are pre-defined, a programmer can develop an easy application without the programmer needing to write a lot of code. 

Programmers can also utilize Visual Basic to create executable files, ActiveX controls, or DLL files; but in most cases, programmers utilize Visual Basic to develop Windows applications and to interface database systems. Additionally, in Visual basic, programmers can utilize dialog boxes with limited functionality to supply pop-up capabilities and programmers can insert additional logic within the appropriate event handlers, while controls provide the basic functionality of the application. To put this into perspective, imagine a drop-down combination box that will automatically display a list and permit the user to select an item from the list. The event handler would then be called to execute additional code when an item is selected; which would execute an action based on the item that was selected, such as populating a related list. 

Another plus for me is the fact that programming in Visual Basic is the same as programming in Visual Basic for Applications (VBA). This is a plus because I have not written any programs in Visual Basic but I have written some small enhancements in certain office applications utilizing VBA. Based on this alone, I am pretty much sold on Visual Basic. One of the disadvantages of Visual Basic is that “all versions of the Visual Basic development environment from 1.0 to 6.0 have been retired and are now unsupported by Microsoft”. In addition, Microsoft does not support the related runtime environments. As of now, Microsoft only supports the Visual Basic 6 core runtime environment, and will continue to support it for Windows 7. I am happy to say that I am a Windows 7 holder, so I would still choose Visual Basic over the other programming languages.