0

I dropped out pf programming quite some time back and I want to get back in there. My first project is going to be a quiz game with a board indicating the progress of two teams. I have an artistic flair, and the board is going to look quite good - but interacation with it will be simplistic.

Which language would you recommend, please? Python or C++? Writing this game is going to be part and parcel of my learning the language. The game will be written for Windows based systems. I hope to continue to writing this type of software. The program must run as a standalone '.exe', which I know both C++ and Python are capable of.

Thanks for any advice. :)

Edited by pritaeas: Removed code tags.

8
Contributors
19
Replies
26
Views
5 Years
Discussion Span
Last Post by BigPaw
Featured Replies
  • At the risk of offending pyTony, I'd say avoid Python simply because of the problems building the GUI. I find Python to be an excellent (even elegant) language, but I found that building a GUI was excrutiatingly painful. For someone who is already familiar with Python I'd say go ahead … Read More

  • I'm not a C++ programmer (although I have done a fair bit of development in C), but I think you will have an easier time developing the code in Python. Because your GUI is fairly simple perhaps I will recant my earlier warning and suggest you develop the GUI first … Read More

  • 2

    If you want to try Python, be aware that Python has switched versions from 2 to 3. A fair number of the old version 2 code samples will not work with version 3. The latest version of Python is 3.3.0 and you can get it as a Windows msi (use … Read More

  • And as far as I know, there is still not a version of wxPython available for Python 3.x Read More

  • Being a big C++ advocate, it would be hard for me not to recommend it. I would certainly say that using Qt (with QtCreator) in C++, doing that project that you envision will be a walk in the park, if you are at least somewhat comfortable already in C++. The … Read More

1

At the risk of offending pyTony, I'd say avoid Python simply because of the problems building the GUI. I find Python to be an excellent (even elegant) language, but I found that building a GUI was excrutiatingly painful. For someone who is already familiar with Python I'd say go ahead but not for someone who is a newbie to it. I can't speak for C++ but if you are using an IDE such as Visual Studio I'd say go ahead with C++ or Visual Basic.

By the way, if you indent a line (tab or four spaces) the editor treats it as code (which is automatically numbered). If you don't indent the line then it is treated as straight text. You can click on formatting help at the top right of the edit window for help.

Edited by Reverend Jim

0

That's a very helpful explanation, thank you.

I was hoping to avoid using the "Visual" packages. So should I assume that it's going to be a complicated exercise with the GUI using C++ too? Or, just less painful?

My background in programming 27 years ago was Assembly Language and was used with Robotics. I also ventured into an Art package, which had some novel features for its time, but I ran out of time. I'm sure many of us have had to make involuntary career changes.This said, a lot of time has passed since then, but I'm really excited at the prospect of getting into it again.

Please don't think I'm looking for a C++ vs Python debate. I've already read enough of that via Google and it got me nowhere.

Basically, I'm looking at a database of questions and a push-button GUI as part of the players interaction, and indication of progress. Python, as you've said, would involve a struggle with the GUI. Where would C++ have a weakness, or strength, in this scenario, please?

1

I'm not a C++ programmer (although I have done a fair bit of development in C), but I think you will have an easier time developing the code in Python. Because your GUI is fairly simple perhaps I will recant my earlier warning and suggest you develop the GUI first with stubs for the rest. You can always post questions in the Python forum if you are having problems with the GUI. To be fair, my experiences with Python GUIs were with the wxPython package and my main problem was with the resizers which you may not need. As an assembler programmer you are obviously not afraid to get your hands dirty.

Votes + Comments
Jim read Though and around my problem, and then followed up with well considered suggestions. I reached a positive solution with Jims help.
0

I was going to suggest flash and create an air file but if you're only using free software then it won't be a good idea and it's not exactly a stand alone .exe by definition.

I think either python and c++ with a image library might be a good choice... I always liked the way you could compile a python file to an .exe using py2exe? (if I recall).

Votes + Comments
Good, practical advice
0

This is great advice, thanks Jim & iamthwee.

These forums are my new home, and I discovered them with my powers of numptiness. I made a complete numpty of myself in a tweet. I was trying to subscribe to the programmingforums.org and there was a problem with the system not allowing me to post. So, I tried emailing admin, but my emails bounced. I could see there was some reference to Daniweb and found a twitter address. Now that I saw a little light at the end of the tunnel, I sent a tweet to what I thought was someone in admin.

A lady kindly replied and explained that the process is quite straightforward, and I replied with a friendly, "Yup, done that". Soon after, with amazing intuition and lateral thinking the lady replied again with the killer question, "Are you referring to programmingforums.org or Daniweb?" Suddenly my heart sank with the weight of my stupidity. I apologised for wasting her time.

There was no apparent way of contacting the programmingforums.org, and so I checked out the Daniweb site this kind lady spoke of. It was at this point that it dawned on me what a huge numpty I had been, it was simply a case of my cross-wired communication.... and then learned that I had been talking to Dani herself... Dani of Daniweb! This is the first time I had ever met up with a celebrity, even online. She is such a friendly and kind person, and I see these qualities mirrored on these forums. With such great people here, I will follow through on your suggestion as to getting help for my game via the Python forums.

You've been really helpful, thankyou again :)

2

If you want to try Python, be aware that Python has switched versions from 2 to 3. A fair number of the old version 2 code samples will not work with version 3.

The latest version of Python is 3.3.0 and you can get it as a Windows msi (use the 32bit installer). It comes with a small and nimble GUI toolkit called tkinter (also has expansion modules ttk and tix). There is also a small IDE included (called IDLE) based on tkinter. A good way to write your programs and run them.

A good number of free third party modules for the various versions of Python are available from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/

These include:
PIL (Python Image Library)
numpy (high speed number crunchers)
PySide (mucho GUI toolkit based on QT)
PyGame (game development based on SDL)
cx_Freeze (makes exe files for Windows)
mpmath (math with high precision)
...

Ask any questions at our DaniWeb Python Forum.
Start with:
http://www.daniweb.com/software-development/python/threads/20774/starting-python#post104834

Edited by vegaseat

1

"wxPython" for Python3 may never appear. IMHO it is better to use PySide anyway, which is the official LGPL-licensed version of PyQT. It is available for all versions of Python.

0

The following three are either dead links, or are not listed there. But, because you have recommended them, I'll Google them.

PIL (Python Image Library)
numpy (high speed number crunchers)
mpmath (math with high precision)

Ah, just read that PIL isn't available for Python 3.3, or any Python 3.x at the moment. PIL Download Page

Numpy is only available for Python 3.2 presently. Numpy download page

I downloaded MPmath from here. MPmath

Like you suggest, maybe I should take this over to the Python Forums now. :)

Editor's Note:
A good number of free third party modules for the various versions of Python are available from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
That includes the Windows Python33 versions of PIL and numpy

Edited by vegaseat: update

0

Just to tie up the loose ends here, is the need for wxpython significant? Should I go for an older version of Python until things are available for 3.3?

0

Yes, I marked it solved, as Python seemed to have been the favourite over C++ for this task. Or, do you have a view that is different? (I'm always open to opinions.)

Presently I'm just playing around with small Python projects.

Edited by BigPaw

2

Being a big C++ advocate, it would be hard for me not to recommend it. I would certainly say that using Qt (with QtCreator) in C++, doing that project that you envision will be a walk in the park, if you are at least somewhat comfortable already in C++. The learning curve is really the only obstacle to C++, once you are passed the steepest part of it, almost everything is very easy. But if you are familiar with things like assembly programming, that hurdle shouldn't be too hard to overcome.

And also, generally, most assembly programmers I've met are happiest when they are in control of the low-level details and are in a predictable run-time environment (i.e., they are generally OK to work in C, and a little uncomfortable in C++, but can't stand anything "higher" than that). That could be a problem with Python. I know that is a little bit of a problem for me, I love the style and ease of use of Python, but I also know how important certain optimizations are, like streamlined memory traversal patterns and locality of reference issues, that I have a hard time in an environment that gives me little to no control over that. But, of course, the application you have in mind is not anywhere near being performance critical or heavily algorithmic (which is the kind of thing I do), so all these issues don't matter, but be aware that it might be an unpleasant feeling, if coming from assembly programming.

Other than that, Python is certainly a great choice. I have seen countless projects that do most GUI stuff in Python (Qt), very often with nearly all of the actual algorithmic code in C/C++ (wrapped with Boost.Python). And if you have a hard time choosing, why not do the same in your project, mix it up. C++ is great for writing huge libraries with very powerful algorithmic code, while Python is great at plugging a lot of stuff together quickly and easily, and that's why they make such a great duo.

0

HTML5 for cross platform! But otherwise, Vb is very robust and I've always fell back to it in the 11 years I've programmed.

0

once you are passed the steepest part of it

What would you say is the steepest part? Generally speaking, that is.

1

What would you say is the steepest part? Generally speaking, that is.

For the complete beginner, the first major hurdle is just understanding how programming works, i.e., basic procedural programming concepts like variables, arithmetic, pointers, arrays, loops, algorithms, and functions. But that's not a problem for someone with some experience in any other language. Then, the second hurdle is dealing with the construction of a software architecture, which includes object-oriented programming, polymorphism, and resource management strategies. Some languages like Java or Python kind of skip that hurdle by making OOP a requirement by design of the language, broad-brushing everything as polymorphic, and handling memory management automatically. In C++, you have to learn to use these concepts at the right places (mix different paradigms) and be able to implement them correctly, and while you are still learning to do those things, there can be a lot of suffering in the form of memory corruption bugs and other nasty things. But once you have a handle on that, and you are somewhat familiar with basic uses of templates, and you are good at employing the C++ standard libraries (especially the STL), which all go hand-in-hand pretty much, then everything is as easy, if not more, than in any other language, including doing GUI programming.

Those who can't get past the first hurdle are not made to be programmers. And those who can't get past the second hurdle will probably never become expert programmers, but might be proficient programmers (good enough to have a programming job), usually in a "managed" language like Java, C#, Python, etc. (and, by that, I don't mean that all C++ programmers are experts and the others aren't, there are great experts in any and all languages, but that those who struggle too much with the "lower-level" aspects of software engineering and the mixing of paradigms probably won't settle for C++ at the end, and learning these aspects of soft-eng is necessary in developing an expertise in programming, regardless of the language (although some languages hide it well)).

Edited by mike_2000_17: small addition

1

Those who can't get past the first hurdle are not made to be programmers. And those who can't get past the second hurdle will probably never become expert programmers, but might be proficient programmers

Well, if that isn't bait, I dunno what is... :D

Votes + Comments
lol, guilty as charged!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.