This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: Re: Cross-platform programming: C++/Qt vs. Python/Qt  (Read 7996 times)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« on: September 23, 2012, 10:48:09 am »
Learning rates differ. Scripting languages tend to be easier, having more library features. Also, a simple packet managing and a lot of people using it. C++ is hard to master and easy to write shitty code in. Scripting language programmers don't seem to care about shitty code.

In the end, you can accomplish the same. WIth less code in non-C++, but meh. Every language has design fuckups and ugly parts. With ruby and objc as base, you should be able to learn both.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #1 on: September 23, 2012, 01:02:44 pm »
Pick any project that interests you. Read source code.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #2 on: September 23, 2012, 01:10:23 pm »
Actually, I started looking into the C++ code with modding Trinity Core. If you look at different codes, interpret them and see what they do in the whole (if you know what the whole does), it's actually forming a picture. It is a base to work from, so to speak. The more you go into it and, for example, look things up to understand them, the more clear it gets.


Then again, Trinity Core is using self-defined functions for the post part. But it helps to understanding the basics imo. Not to mention that I doubt that Trinity is always using "good code" :p
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #3 on: September 24, 2012, 12:43:17 pm »
The problem with c++ is that c is a full subpart of the ewn language and you can do your learnd before 10 years coding tricks inside an shoulkd be oop app. Sometimes this can realy give you speed but most times it just lead to shit code :)

If you accept some rules you can write the same good loking code as in any other oop language.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Gamh

  • Contributors
  • Loreweaver
  • *****
  • Posts: 81
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #4 on: July 27, 2013, 09:37:14 pm »
I couldn't replied to this earlier because I had no experience in Python, but these days I'm learning it so...

Python seems to be quite excellent : intelligent and classy syntax, easy OOP features if needed, high-level abstraction awesomely done, and from what I've seen the implementation seems to be very clean and efficient (I clearly do not have enough C knowledge to judge it though).

I would still recommend to learn C or C++ first before one plans to write and share cross-platform software, for this exact reason :
Quote from: "Schlumpf"
Scripting language programmers don't seem to care about shitty code.
If you want to be an efficient dev, my advice would be to learn a language that takes you to a trip through most aspects of middle-low levels programming, so when you start Python or anything clearly high-level, you actually know or have a precise idea of what happens under the hood. Think the many languages have their interpreter/compiler written in C, at least in the first time. Starting with a scripting language because it's easier to learn and write sounds like a counter-argument *in the long term*.

Moreover, in this topic, Qt is written exclusively for C++ and the Python/Qt interface is only a wrapper iirc. It may not be a problem, but that could help understanding the implementation.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

iindigo

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 198
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #5 on: August 06, 2013, 06:59:49 am »
Thanks for the input, Gamh. (I'm the original poster but all my old posts got removed in a mishap).

I see what you and schlumpf are saying in regards to shitty code, but Python is so tempting simply because its learning curve and average time to usability is so much lower. Having written Ruby and Objective-C, I could jump in on intermediate difficulty problems with Python in a few weeks where doing the same with C++ would likely take months. But then again, I may just be grossly overestimating.

How do you guys feel about libraries like Boost? Opinions seem to vary wildly.

On a sidenote, is C++ always lacking in terms of being self-explanatory? Most I've looked at takes much more than a quick glance to figure out exactly what a function is supposed to be doing.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #6 on: August 06, 2013, 10:24:54 am »
I think that beside pointers and the point that c++ don´t force you to do oop it is same easy as all other languages.
If you only use latest introduced functions and strict OOP style its also an easy coding language.

And yes Boost is totaly ok and very helpfull. Bettern the inventing wheel again and again. And most time more efficient then own implementation.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Gamh

  • Contributors
  • Loreweaver
  • *****
  • Posts: 81
    • View Profile
Re: Cross-platform programming: C++/Qt vs. Python/Qt
« Reply #7 on: August 06, 2013, 03:27:20 pm »
Quote from: "iindigo"
I see what you and schlumpf are saying in regards to shitty code, but Python is so tempting simply because its learning curve and average time to usability is so much lower. Having written Ruby and Objective-C, I could jump in on intermediate difficulty problems with Python in a few weeks where doing the same with C++ would likely take months. But then again, I may just be grossly overestimating.
An exemple that just occured with a friend learning Python with almost no C/C++ background :
he had to parse an enourmous binary file, knowing its size, his container was a list and at each loop, he was using append() on the list. If he knew that, under the hood, a Python list is a C array, he should have know that it would cause multiple useless reallocations, and would have tried to specify the list length at first. But he didn't so his program was less effective. Just an exemple ;) but I feel like these kind of things are important knowledge in the long run. If you think you can avoid these kind of mistakes, go with Python.

Quote from: "iindigo"
How do you guys feel about libraries like Boost? Opinions seem to vary wildly.
I've almost no experience with this. Seems like a nice extension of the standard library. Many people have bad opinion of Boost because of some specific bugs and the sometimes harsh process of installing/linking.

Quote from: "iindigo"
On a sidenote, is C++ always lacking in terms of being self-explanatory? Most I've looked at takes much more than a quick glance to figure out exactly what a function is supposed to be doing.
Uh yeah that's one of the thing I may reproach C++ with. That's a part of why the learning curve is longer than most languages. Although references like cplusplus.com help understanding most of it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »