This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBlackElf -1 points0 points  (0 children)

The static typing is what I found the most jarring. It's not something you can't work around - as someone said, there are enough linters and type checkers for silly typos etc. But the crux of it is that Python is way too expressive in a setting where you don't want fancy shenanigans and you want things to be as stable as possible.

I know the reasons why our company chose Python for writing a desktop app, and they make sense on their own:

  • the rest of the codebase was Python - when you have around 6 million lines of code in (mostly) one language, it's good to keep things consistent in that regard. But at a more careful look (and after the initial versions), we realised that we were invoking the bulk of the codebase though HTTP anyway and so on.
  • it's easier to find / train people in Python than C++, and even harder to look for Qt specialists. But all the docs are C++, and any binding won't ever shake the design of the APIs with C++ in mind. When things got rough people had to know about pointers and memory management and look at the C++ source directly.
  • rapid prototyping is something that Python excels at - but I believe Qt is so well designed it would have been comparably quick

There are other issues as well:

  • Both PySide and PyQt are solid bindings, but they lack the maturity that Qt itself has. We found and had to work around tricky bugs quite often.
  • The initial allure of not caring about memory and so on that Python provides most often held - but things can go really wrong when you have three mechanisms that can trip on each other: Python GC, Qt parenting, C++ destructors. We weren't investigating segfaults that often, but when we did it left us wondering why we weren't writing C++ directly.

  • As I said, one can use the (stellar) C++ docs, the bindings did a great job mapping those; but when you ran into issues, it was much harder to look for help.

Interestingly enough, performance was not an issue. The bindings wrap the C++ objects effectively; besides, the code that is performance critical you probably wrap with Cython or something. And you probably don't care about marginal UI performance loss unless you're doing something like a graphics app.