How to create a program
You have been fascinated by the world of information technology for some time and you are seriously thinking about taking a decisive step for your knowledge: learning to program. The idea of building an application that works on your own, just to the satisfaction of doing it or to undertake a larger project, now fascinates you: the die is drawn and the decision is made, but you're still a bit hesitant because you don't have the slightest idea of how to create a program.
Maybe you don't believe it, but you happened to be in the right place at a time that could not be better: in fact, in the following I will give you all the information you need to enter the world of programming, understand how a program is born and, why not, create your first application from scratch.
Before going on, however, I want to give you a premise: the world of programming is at best boundless, there are thousands of different scenarios and approaches to it and to face them all would be almost impossible. But you should not be discouraged, because in this guide you will find everything you need to know to take your first steps: once you have finished reading and assimilated the basics, fantasy and experience will accompany you on this adventure!
Index
What is a program?
Program creation steps
Designing
Implementation
Testing
Release/Update
Programming languages
Creating a program
For further information
What is a program?
How to create a program
Before getting to the heart of the matter, I want to give you some theoretical information that will help you to better understand the future steps of this guide: in practical terms, a program is a computer entity capable of processing data and automating operations. For example, there are programs that can process text (such as Word), perform calculations (such as the Windows Calculator), allow Internet browsing (such as browsers), and so on.
A program, depending on the task for which it is designed, can be more or less simple: just to give you an example, even operating systems, designed to allow the user to interact with the "physical part" of a computer through dedicated software, are also programs.
The functioning of a program is almost always based on a very precise mechanism, which is called an algorithm: with this last definition, we mean the necessary steps that must be taken to transform a given or a series of "incoming" data into a given or a series of "outgoing" data.
Within the programming, the above steps are expressed in the form of instructions, or statements, given through a programming language: the complete set of instructions of a program is called execution flow, and it is what is responsible for processing the input data to transform them into what you want to achieve.
Program creation steps
Now that you've got a clear definition of the program, it's time to get to know how it is developed over time. It may seem strange to you, but even a program has a real life cycle, structured into at least four phases: design, implementation, testing, release and updating. Below you can find details of each stage of this life cycle.
Designing
The design of a programme is the first phase of its life cycle and the most important: this is where the programme's objectives, the type of data it has to manage and how it has to do so are defined. If I had to imagine a program as a house, the design phase is the one in which the architect (or team of architects) draws the project on paper, defining its shape, structure and position.
The design phase is usually managed by the engineers of the development team: just to give you some examples, there are those who are responsible for defining the type of data to be processed, those who are responsible for developing the algorithm with which to manage the data, those who are responsible for studying the critical conditions (i.e. events that should not occur, but that could occur) and, why not, also those who are responsible for designing the ideal graphic aspect of the program.
All these "ideas", which are currently purely abstract, are usually reported on diagrams or graphs developed using conventional standards (e.g. using the UML language) and must be approved by the chief engineer. At this stage, the programming language to be used for software development is also chosen. Once approved, all material is passed on to the programmers, who are in charge of the implementation phase.
Implementation
Creating a program - Implementation
The implementation phase is the phase in which, in fact, the actual program comes to life: in it one or more programmers participate (in the latter case, the team is coordinated by a chief programmer), in charge of writing in one or more files the set of instructions that forms the program execution flow.
Instructions are written in one or more plain text files, if necessary enclosed within a specific editor or an entire integrated development environment (in IDE jargon): these elements provide the programmer with useful tools to simplify the work, for example the possibility of automatically completing the instructions, suggesting variables or defining pieces of code to be called up with precise keyboard combinations.
The set of files containing instructions written in programming language is called the source code of the program. During implementation, the "intermediate" parts of the source code are compiled to be "translated" into machine language and executed: in this way, the programmer is able to test the quality of his work and verify that the program behaves correctly.
Once the entire source code is completed, it is compiled to run through the operating system, thus becoming a real program (like those you are used to using on your computer): once the implementation phase is completed, the result may undergo a further testing phase or be released directly to the public.
Testing
How to create a program - Testing
The testing phase, in some aspects, can be considered the most "fun" phase of the life cycle of a program: in fact, in it, the appropriate team figures (the so-called testers) have the task of voluntarily causing malfunctions or critical conditions not managed within the program, so as to be able to reveal bugs (i.e. programming errors) and allow developers to remedy them.
There are a lot of test categories that can be used to test a program, and they can test many things: although it might seem strange to you, the testing phase is extremely important for the quality of a program, because it is in this phase that any errors that may result from previous phases are highlighted. If you are interested in learning more, I would refer you to the exhaustive Wikipedia section that deals with this topic in detail.
In some cases, the software house may decide to ask the end users to whom the program is dedicated for "help", releasing an incomplete version for testing purposes: in this case we speak of an alpha or beta version of the software. The end user is asked to try the program and report any problems to the manufacturer: in jargon, this procedure is called feedback.
At the end of the test phase, two things can happen: if the program has problems, they are reported to the development team, which is responsible for resolving them by modifying and updating the source code. If the program is not a problem, it will get the OK for the release phase.
Release/Update
The release phase of a program is the phase in which the program is distributed to the public, free of charge, or made available for purchase, if the software is designed to operate subject to the purchase of a license.
For market needs, or for the simple evolution of time, the software house can decide to add new features to the program, to modify the graphic aspect or to change the dynamics in whole or in part: in this case, a new version of the program is passed to the screening and crosses the entire life cycle.
When the updated source code passes the testing phase, it is made public or marketed as an update of the original software.
A program ends its life cycle when the company behind it stops updating it definitively, leaving it de facto to itself: once development is stopped, it is said that the program is no longer supported (discontinued in English).
Programming languages
As I mentioned earlier, programming language is the set of syntactical and logical rules used to structure instructions within a program's source code.
The end user of the software, who uses it every day for production, may have no idea what programming language is used to develop the software, but you should know that not all languages are the same: some are better suited to build programs that work as a command line, others are better for managing graphical interfaces, others are dedicated exclusively to processing calculations, designing games and more.
I give you, below, a list (very limited, considering that there are hundreds of them) of the most popular and known programming languages available at present.
Java - is an extremely well-known object programming language, which lends itself to a very large number of uses. Its strength lies in its flexibility: programs in Java can be run, simply by installing additional software (called Java Runtime Environment or JRE), from any desktop operating system. One thing, moreover, might surprise you: much of the Android operating system is written in Java. I have already told you how to program in Java in my dedicated guide.
C - another extremely well known language. C is a programming language that dates back to 1972, is procedural and is applicable in virtually any type of scenario. It is not an object language (although its successor, C++, is) and this makes it slightly more difficult than Java, however this aspect makes it adaptable to an immense number of practical applications. Just know that the Linux kernel, like the Android kernel, is completely written in C.
C# - despite its syntactical similarities with C, it is specific for the Windows graphical interface, its programs and applications based on the .NET framework. Although owned by Microsoft, C# became open source in 2014.
Visual Basic - is another programming language owned by Microsoft, used for the creation of software with graphical interface and dedicated to Windows operating systems. To date, Visual Basic has been incorporated into the .NET framework.
Delphi - successor of Pascal, this programming language is mainly used for the development of management software dedicated to managing large volumes of data, but that does not require complex graphical interfaces.
Objective C/Swift - these are the programming languages used to create apps for Apple's macOS, iOS, watchOS, and TVOS operating systems.
A - is a programming language used to process complex data, mainly for statistical calculation or graphical computation operations.
MATLAB - another programming language dedicated to mathematical calculation, it is widely used in the management of operations based on matrices.
Assembly - is a low-level programming language that approaches the actual machine code (what the processor can "understand"). It is typically used for designing peripheral controllers and drivers.
In the next section, I will teach you how to design a simple C language calculator, which you can use from the Command Prompt or the MacOS/Linux Terminal.
Creating a program
How to create a program
If you've got here, it means that you've learned all the theoretical knowledge about programming and that you're finally ready to get down to work. Clearly, in this section, I will teach you to create a very simple program, not designed for "global" distribution, and therefore does not need to go through all the stages I explained earlier. This will simply build a small source code file and compile it using the most suitable compiler.
In short, you'll learn how to create a simple C calculator at this stage, which you can use as you like via the Windows Command Prompt or the MacOS/Linux Terminal. These operating systems are already set up for managing files in C; for Windows, however, you need to install the Visual Studio Community component.
To proceed, connect to the dedicated website, click on the Free download button located within the Visual Studio Community pane. Next, open the downloaded file (e.g. vs_Community.exe), press the Continue button, check the box next to Desktop application development with C++ in the window that appears, then in the C++ Support/Cli box on the right and finally click the Install button. When you are done, close the setup file window.
Now that you have all the necessary tools, it's time to develop the source code of your program following the instructions that best suit your operating system. For a start, create the file that will contain the source in one of the following ways.
Windows - launches the Notepad by calling it up from the Windows Accessories folder resident in the Start menu (accessible by clicking the flag button in the lower right corner of the screen). Then click on the File menu in the top left corner, select the Save As... item from the latter, choose the All Files item from the Save As drop-down menu, type the file name calc.c in the File Name box and save the file to your Windows desktop, leaving the Notepad open.
macOS - starts the Terminal by calling it from the Launchpad (the Rocket icon located in the Dock), then type the cd ~/Desktop command followed by Enter and the calc.c touch command, followed by Enter. Without closing the Terminal, double-click to open the file thus created on your Desktop.
Linux - boot the Terminal by calling it from the Activity View or from your distribution's main menu, type the cd ~/Scrivania command followed by Enter, and again, the calc.c touch control followed by pressing the Enter key. Without closing the Terminal, double-click the file created on your Desktop to open it.
Once you have opened the text editor that best suits your operating system (e.g. Notepad for Windows, XCode for MacOS or Gedit for Linux), type the following code (exactly as shown below). I decided to include a brief description of each statement in the source: the descriptions will not be read by the compiler, as they are preceded by the symbols // (in jargon, these are comments).
Includes <stdio.h>
Includes <stdlib.h> //communicates to the compiler the libraries to be used
int main(void){ //The main method, the actual calculator
chosen char; int t1,t2; //statement of variables
printf("Insert the first term of the operation: ");
scanf("%d", &t1);
printf("Insert the second term of the operation: ");
scanf("%d", &t2);
printf("What do you want to do? Digita\n + for addizione\n - for sottrazione\n * for prodotto\n : for divisione\nOperazione: ");
scanf("%c",&choice);
choice = getchar(); //request and scan keyboard commands
switch(choice){ //cycle that carries out the actual calculations
houses '+': t1 = t1 + t2;
break;
houses '-': t1 = t1 - t2;
break;
houses '*': t1 = t1 * t2;
break;
houses ':': t1 = t1 / t2;
Break;}
printf("The result of the operation is: %d\n",t1); //The result is shown on the screen
system("PAUSE"); // Waits for a button to be pressed to end the program
return(0); //The program ends without errors
}
Once all the text has been pasted, save the file you created previously, then close the editor safely.
At this point, you can proceed with the compilation of the program using the instructions that best suit your operating system.
Windows - calls up the Prompt for developer commands from the Visual Studio folder located in the Start menu. Inside, type in sequence the commands cd %USERPROFILE%\Desktop and cl calc.c, both followed by the Enter button. When you're done, you can run the program by simply typing in the calc command and pressing Enter, or by double-clicking the calc.exe file generated on your desktop.
macOS/Linux - from the terminal previously opened, type the command gcc calc.c -or calculator followed by Enter, then start your calculator by giving the command ./calculator, always followed by pressing the Enter key.
In this chapter of the tutorial I explained how to create a very simple program without a graphical interface, however the power of the various programming languages is at best boundless and can also be created software complete with graphical interface: everything lies in the skill and imagination of designers and programmers.
For further information
Learn more about how to create a program
As you could notice, creating a program is not an operation that can be done, provided you know at least one programming language: the source code of our calculator was very, very simple, but I am sure it helped you to understand the main lines of how the instructions (statements) of a programming language are structured.
Wait, you're telling me that you're fascinated by it and that you're going to continue your studies to become a programmer? Perfect! I am very happy to help you by suggesting resources available on the Internet that can be very, very useful to you.
How to learn Java - my guide dedicated to the basic steps to take to learn how to program in Java.
HTML.it Guide Section - here you can find a large number of guides dedicated to the most popular programming languages, including C, C++, Objective-C, Java and many others.
Microsoft, Introduction to Visual Basic - an introduction to the Visual Basic .NET language and the Visual Studio framework.
Eclipse - an entire IDE able to manage various programming languages, including Java, C/C++ and others, also used for testing and development of UML charts.
Notepad++ - a minimal but complete editor for writing (and formatting) source code on Windows. Supports numerous programming languages.
Programs for programming - my guide containing a detailed list of software useful for programming in general.
Congratulations @majaclare! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard:
Congratulations @majaclare! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!