The Symbian OS is famous for its design, concepts, and coding conventions. The maemo platform gives the developer more freedom, but it also requires the developer to take more responsibility. The maemo platform does not enforce any specific design patterns, so the developer is responsible for preventing memory leaks, buffer overflows, and other security problems.
Software for Symbian OS is mostly written in C++, whereas software for the maemo platform is mostly written in C. There are, however, several C++ bindings available for different libraries in the maemo platform, enabling an object-oriented approach. Despite of these bindings, C library calls must be made in code written for the maemo platform sooner or later.
GLib is a cross-platform software utility and object management library. It enables object-oriented programming in C, without C++.
GLib defines many data structures and related operations. Developers may write such structures and operations.
GLib is mentioned here because some of its features are accessible only through C APIs.
Some differences between Symbian C++ and C++ used in maemo are listed below. These differences are more about the conventions, concepts, and software design than about differences in the C++ syntax, language, or compiler features. Some replacements for missing Symbian OS-specific concepts are also introduced.
The Symbian OS documentation states that if a class has to allocate memory, it should be derived from CBase. In maemo, there is no such base class*. This design difference causes the following:
Descriptors are specific to Symbian OS and they do not exist as such in the maemo platform.
When working with strings, instead of descriptors you can use:
The NULL-terminated character arrays and GStrings are manipulated using C-functions, whereas the STL string is a C++ class.
If you are working with binary data, you can use:
Symbian OS discourages the usage of threads because context switching is considered an expensive operation which degrades battery life. Basically this is true in the maemo platform too, but avoiding threads at all cost is not required.
Using the main event loop of GLib it is possible to run several asynchronous operations in a single thread, without blocking. This is fairly similar to using Active Objects.
You can use the following threads:
While the Symbian OS does not support static data in DLLs, the maemo platform does not have this limitation. You can use, for example, global variables in your shared libraries. Note, however, that the static data is not shared between the processes.
Platform security does not exist in the maemo platform. When installing software with the 'Application manager', it only warns if the software is NOT being downloaded from the official maemo repositories. Maemo is a multi-user environment, where different users and user groups have different permissions to access files and platform services. However, when installing a software package, the package developer can freely decide the permissions under which the software runs.
Whereas Symbian OS extensively uses a client/server approach with asynchronous method calls, the maemo platform uses direct, synchronous API calls. Usually this means that called functions block until they finish, with some exceptions.
Using sockets is a good example of the differences between the Symbian OS and maemo platforms, regarding the client/server model vs. direct API calls. See Networking example.