Codingdomain.com

Creating KDE Applications: Introduction

Introduction

A short introduction to programming could never hurt. That's what this article is all about.

New to programming?

This is how software is created:

1. Writing code
The first step is to create the code. This is somewhat english-like text, but it has some specific notations you must follow (just like Math). KDE Applications are written in a programming-language called C++. To instructions you write will be followed step by step, line by line.
2. Compiling
Compiling is the process that translates your source-text into machine code. Each file with C++ code is translated in an object-file. Those files contain the instructions for the processor. Note that the machine code is usually specific to the processor architecture.
3. Linking
Once all source text is compiled into object files, those object files need to be clued together. This is called linking. The linker also checks whether it can find all the "symbols" it needs. The result is the final executable you can run.
4. Loading
Once the user starts the executable, your operating system loads the instructions in the memory. External libraries are also loaded and the instructions are linked together.
5. Executing
Finally, the processor (CPU) runs the instructions. This is very straightforward. It's like reading your book with a pointer; you just follow the letters (instructions) one by one. Certain instructions tell the CPU to move it's pointer to another page, and the CPU will continue to run the instructions from that point. This process continues until there is some instruction that tells the CPU it's done.

If you write or participate in large software projects, some other aspects are also important:

- Version constrol
The source tree (the folders containing the source code) need to be managed at a central place. This enables each developer to commit their code to a central repostry, but also restore to a previous version is something went wrong.
- Build system
Having a lot of object files and external dependencies makes the compiling and linking process extremently difficult. A build system solves this. Usually developers just need to type make to re-build their modified source files.
- Documentation
Documentation is very important. Not only documentation for the end-user, but also for fellow developers. This kind of documentation is called the API (Application Programming Interface) Documentation.
- Package and deployment
Something needs to assist the developers in packaging their software and deploying it to their users.

But first, let's start with the aspect of compiling. This is explained in the next tutorial.

Related articles

blog comments powered by Disqus