Wednesday, March 30, 2011

Source Code vs. Executable Code

Source code and executable code are two terms for different levels of computer code.  They could both mean different things depending on the context they are spoken in.  Source code is generally the code given to a compiler or interpreter to create object code or target code.  In short it is the input code, while object or target code is the output.  Source code is generally a high-level language.  Computer code can go through several transformations before it is turned into machine code that is directly readable by the computer’s processor.  Therefore, the object code or target code of one device could be the source code of another.

Executable code is code that is directly executable by a computer’s processor.  Usually, it is machine code, an array of 1’s and 0’s that a computer can understand depending on the organization of these 1’s and 0’s.  However, in a general sense, executable code can also be a file containing instructions for an interpreter, such as bytecode or scripting language.

An Interpreter is an application that translates a higher-level computer language to a lower one and executes it at the moment the program is run.  Relating this to say a music program, it’s like hitting the space bar on a song you’ve recorded.  You instantly get to hear every track you’ve recorded, along with all the effects, automation, etc.  You can use this to listen to your work in progress and make tweaks to your song (program) in order to make it better and fix any flaws (bugs).

A Complier on the other hand does basically the same thing.  It translates your program from the high level language that you’ve written it into a lower one but it doesn’t do it in real time.  Instead it takes time to interpret your code and outputs object or target code.  Once completed you have your program but transferred to a different computer programming language.  In my mind this relates to a music program as an offline bounce to disk.  This is when you believe you have recorded everything you need to record, made all the edits you need, added all the effects you want, and completed all automation on every track.  When you are done with everything you can do to your song (program), you bounce it to a two track.  You choose the file format you would like your song to be converted into, the program then runs through the song and turns your multi-track project into a two-track stereo version, which can be played by any music player or burnt to a Compact Disc.

Assemblers take assembly language and convert it into machine code a computer’s processor can understand.  Assembly language is unique to each processor in language, but most use the same instruction statements that are used to define program operations.  Assembly language is the closest language to machine code.  Assemblers are used to squeeze the last bit of performance out of a processor by working near machine code level.  Because of this I relate it to the mastering process in music.  Once you have mixed all tracks of your multi-track recording and performed an offline bounce, creating a stereo two-track.  Mastering is the next step in which you make small tweaks to the equalization and compress the two-track to bring out every bit of feeling in your music.  This is similar because it squeezes every last bit of performance out of your two-track.  Also your mixed two-track before mastering is the closest representation of your song before it is finished, just as assembly code is one step away from machine code.

Wednesday, March 23, 2011

NetBeans with BlueJ or Visual Basic


When choosing an IDE (Integrated Development Environment) and GUI (Graphic User Interface) language for developing a small game, there are many different options.  Two of the most prominent Integrated Development Environments for GUI development are the NetBeans IDE BlueJ Plugin and the Visual Basic IDE.

Visual Basic is an object based and event driven programming language.  The Visual Basic language was derived from BASIC and allows programmers to create simple GUI applications and more complex applications.  Programming can be done by visually arranging components and controls. Components and controls are organized on forms using a drag and drop technique.  These components and controls contain default attributes and actions making a simple application easy to produce without writing many lines of code.  To create more complex applications these default attributes and actions can be modified by rewriting the code associated with them.  Visual Basic can create executable files, AxtiveX controls, and DLL files.  There are many small games available for free online written with Visual Basic, from poker games, RPG’s, tetris, minesweeper, etc.

NetBeans is an IDE used for developing with Java, JavaScript, Python, Ruby, C, C++, and other languages.  NetBeans is written in Java and can be used on any operating system with a Java Virtual Machine installed including Windows, Mac OSX, and Linux.  The GUI design tool is a drag and drop based GUI builder.  BlueJ is an IDE for Java and is primarily used for educational purposes but is also suitable for small application development.  BlueJ is now available as a plug-in inside the NetBeans IDE.  It assists BlueJ users in the transition to using NeatBeans, a more versatile and professional IDE.

Both Integrated Development Environments would be good for developing a Graphic User Interface for a small game.  Yet, each has some advantages depending on the circumstances of your project.  If you are proficient in Visual Basic I would stick with that.  Many simple games are written in Visual Basic. They can be easily created, edited, and compiled into an executable file.  The Visual Basic IDE’s user interface allows a developer to create a GUI with little to no actual code writing.

The NetBeans IDE’s BlueJ Plug-in also has its advantages.  NetBeans can be ran on any operating system because it is a Java based application.  Like Visual Basic, NetBeans has a very simple user interface.  The implementation of its drag and drop capabilities make it easy to use with little code writing necessary.  BlueJ allows a developer to see a clear layout of the application being written and its GUI.  Also with NetBeans you can utilize many different programming languages.

As an owner of a MacBook, I would choose to use the NetBeans IDE with the BlueJ plug-in.  My choice is mainly because it works with the OSX operating system, but I also like its ease of use and that it can help me transition to using the rest of the NetBeans IDE for more professional software development.  Visual Basic seems like it would be great for the job at hand (developing a GUI for a small game), but I like that NetBeans is able to create more advanced and professional software as well.