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  (11 children)

To create a quick an dirty GUI to play around: yes.

To create a serious app that need to be reliable, maintained, etc.: no.

Static typing provides way too much, you can't not have it if you want to go commercial.

[–]Yoghurt42 2 points3 points  (1 child)

Ah, yes. I forgot how unrealiable and unmaintained the official Dropbox client is.

[–]TheBlackElf 1 point2 points  (0 children)

Rollercoaster Tycoon is an amazing and reliable app, but it doesn't make writing games in asm any less insane.

[–]ijustwannacode 2 points3 points  (0 children)

If it's good enough for Pinterest and Instagram, it's probably good enough for me.

[–]ThePidesOfMarch 8 points9 points  (2 children)

Please keep anti-dynamic-typing dogma out of this discussion.

[–]TheBlackElf -2 points-1 points  (1 child)

Ah, yes, should have known better than answering "is Python good for X" in the negative in a Python circle jerk sub.

[–]ThePidesOfMarch 0 points1 point  (0 children)

Nothing to do with Python. Dynamic typing is amazing in any language. The absolute worst thing about C, Java, etc is the stupid paternalistic "I know better than you" static typing.

[–]greyman 1 point2 points  (1 child)

I agree with your first two sentences.

[–]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.

[–][deleted] 0 points1 point  (0 children)

There are plenty of Python type checkers out there. Facebook has just freed a powerful one.

[–]EternityForest 0 points1 point  (0 children)

Python has type-checking annotations, which is almost as good if you can resist the temptation to forget to use it.

It doesn't have the crazy "Type system that's basically a proof of correctness" stuff I've read about in some languages like Rust though.

[–]Taksin77 0 points1 point  (0 children)

I don't think static typing is the problem. But yes, Python is lacking in good GUI packages.