From Where to Start

5 years ago by in Articles, Eclipse, How To, Introduction, Tips

One of the most common questions asked by individuals who are starting programming is “from where do I start?“. Unfortunately, just mastering the language is not enough. A developer also needs to know other things such as:

  1. The tools he/she are using, such as Integrated Development Environment (IDE)
  2. How to use code developed by others

We will briefly discuss each part. We will use the car engine (Wiki) and the car engine engineer (Wiki) as an analogy to help you understand better. Engines are fixed by a mechanics. Not everyone is a mechanic and not every mechanic can fix any type of engine. The mechanic needs to be trained to fix a specific type (or brand) of engine. For example a car mechanic may not know how to fix a marine engine even though these are very similar. Secondly a mechanic needs tools to fix an engine. These tools are integral part of the mechanic job and cannot work without these tools. Furthermore, the mechanic needs to know how to use these tools well in order to makes the best use of their investment. Finally a mechanic needs to buy replacement parts from a distributor or an agent. These parts are then used when fixing the engine or performing other work. Now let us see how this fits in the programming world.

Every developer needs to know the language they are programming with. The developer needs to know the language syntax together with what should be done and what should be avoided when programing with that language. One needs to know the strengths and weaknesses of the language being used. Two languages that are said to be object oriented may be very different in their mechanics and what applies to one may not necessarily apply to another. Java (Homepage) and C++ (Wiki) are two good examples of this. Both languages are said to be object oriented, but these two languages are very different. Java is managed language (Wiki) while C++ is not and this plays a big role when working with these languages.

The code needs to be written by a developer, or a programmer. The code is written in a text file which is then compiled by the Java compiler in case of Java. In the old days we used Notepad++ (Homepage) or other light text editors and then compiled the code manually. Nowadays we have IDEs, such as SpringSource Tool Suite (Download page), which provides many useful features. The IDE plays an important role as it can help us be more productive when used well.

Finally the developer will use existing code, or libraries as sometimes these are referred to, when developing. The Apache Commons Lang library (Homepage) is a good example of this. This is a popular library that provides many useful functions used by many developers around the world.

What to do next?

The first thing to do is to setup the environment as described in the page titled: Getting Started. In this page you see what needs to be installed and how to use the code found in this website. Then you can try out the examples available in this website as described next.

Most of the articles found in this website also have examples, which you can download and try on your computer. We will use the Simple Gson Example project as an example.

  1. Download the example from the SVN repository
    Open STS if not already opened, and go to the SVN Repository Exploring perspective. Please refer to the Getting Started page for more information about how to do this.

    Right click on the Simple Gson Example (arrow [1]) and select Checkout… (arrow [2]) as shown in the following image.

    Step 1 - Checkout Project

    Step 1 – Checkout Project

    This will open the new project dialog as shown next.

    Step 2 - Configure Project

    Step 2 – Configure Project

    Just click Finish to download the project. Once ready, switch perspective to Spring (or Java).

  2. Explore the Project
    Expand the project nodes as shown in the following figure.

    Step 3 - Expand Project

    Step 3 – Expand Project

    Here you will see all code that the article discusses. In each project there may be other code which the article does not refer to such as other examples or tests cases.

  3. Run an Example
    You can run the examples like any other Java class. Open the class you want to run and click the run button. Note that not all classes will have a main() method and thus these classes cannot be executed. You will need to find a class that has the main() method.

    Open the (arrow [1]) by double clicking on it as shown in the following figure.

    Step 4 - Run an Example

    Step 4 – Run an Example

    Note that this class has a main() method, therefore we can execute it (arrow [2]). Press the run button (arro3 [3]) to execute this class. This program simply writes some text to the command output as shown below.

    Step 5 - Program Output

    Step 5 – Program Output

As you saw, checking out an existing project is very straight forward and running the examples is not a difficult task. You can modify the examples as you like and experiment with them as much as you want. Note that your changes will not affect the repository as you can only read files from it.

Albert Attard

Albert Attard is a Java passionate and technical lead at a research group. You can find him on . Over the past years Albert worked on various Java projects including traditional server/client applications, modular applications, large data handling applications and concurrent data manipulation applications to name a few. He has a BSc degree from the University of London (Homepage) and an MSc Information Security with the same university. His MSc thesis (Book) received the 2012 award (Website).

Leave a Comment

Time limit is exhausted. Please reload the CAPTCHA.