[Qgis-developer] WG: Re: WG: Re: WG: Re: cpp-plugin for QGIS 2.0

Nathan Woodrow madmanwoo at gmail.com
Fri Nov 8 17:02:00 PST 2013


On Sat, Nov 9, 2013 at 10:22 AM, maaza mekuria <sailmcm at yahoo.com> wrote:

> I am sorry that people are not encouraging the use of C++ for programming.
> I think this is not helpful at all.
>
There are many reasons to skip Pyhton infavor of C++. In my experience
> Python is very slow for real computationally intensive work.
>

This can be the case however in most cases this is not what people are
doing.  Pythons speed is perfectly fine, or not even noticeable in most
cases.  If you need to do something that requires heavy processing then you
can use external Python libraries that are written in C, things like numpy
or scipy.  Calling those is just as fast as doing it in C (minus the
overhead of the Python parser).   Qt is written in C++ so most of the time
calling it from Python is fast anyway.    This comes down to a case of not
over optimizing before you need, if there is one part of the application
 that needs to be really fast but you can gain improved dev time with
Python then I would use Python and write the extra needed fast bit in C.


> Also QGIS itself is written in C++, why are do some asking it is too hard.
> I think it is the lack of documentation that is making development in C++
> very difficult for many of us who are not in the QGIS development all the
> time. This also means that there will be less and less developers that can
> help with enhancement in expanding QGIS capability. I don't know if some
> are thinking that "We are the ones who can do it in C++ and let others be
> content with Python." But I am assuming trusting that that is is not so.
>

Developing plugins for QGIS in Python is the preferred route because they
are more portable and easy to deploy i.e we don't have to compile anything.
Creating a C++ plugin means you have to build it for each platform that you
want it to run, in Python you just run the code and it works (provided you
are running the same version of Python which we normally are).   Most
plugin writers are not C++ devs (or even developers at all) so Python is a
easy to learn language for them.  I could teach my wife Python in about a
day, C++ not so much.   That is the two main reasons we don't encourage
people to create C++ plugins.  But if that is what you need then we are not
going to stop.


> So please answer questions and provide feedback when you can, but please
> do not discourage others from pursuing C++. In my opinion, it is still the
> most robust programming tool available.  Why is QGIS written in C++ and not
> in Python?
>

QGIS is written in C++ because of a lot of reason. PyQt was not as feature
rich as it is now, Gray was a C++ developer, we do need the speed in some
places in the code, etc.  QGIS could be written in Python if someone ever
wanted to do it.

- Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131109/aa186972/attachment.html>


More information about the Qgis-developer mailing list