Pandora The best programming language for the Pandora?


The main disadvantage to Python is performance. Since you can't influence those hidden low-level details, you can't get great control over the processor and memory usage. As your programs become more complex, this will become a problem, but even this can be worked around by rewriting only the performance critical sections of the code in C or Cython, but that's a discussion for later.

So would Python be up to the task of writing some quality RPGs on the Pandora or would it turn out to be too sluggish?
 
Yes pygame runs in the Pandora, its in the angstrom repository


Note: python 3 does run on the Pandora, or at least I compiled it before realising it was the wrong version, at least c doesn't have a new standard every month XD
 
So would Python be up to the task of writing some quality RPGs on the Pandora or would it turn out to be too sluggish?


that's the classic argument againt any high level language...


python is great if you do not want to take care of low level details, it is however bad if you don't want to know the low level details... the difference is tiny, but it's basically what makes someone using a high level language aware if he produce some good code, or a slugish spagetti program...


people with the right knowledge can do some marvel using high level language, devlopped much faster than using C/C++ and running almost as fast... now theses people are understanding all the gory details that high level languages hide.
 
Last edited by a moderator:
There is no such thing as the best programming language for anything. You should pick a language which is suitable for whatever you want to achieve.


Some languages are better suited for learning to program than others. E.g. like C, Pascal is a fairly low level language but it has a slightly higher level of abstraction which is easier to pick up for beginners. You run into pointers much later in Pascal and pointers can be a bit confusing for beginners. For example, in Pascal, pass-by-value, pass-by-reference, strings and arrays all have their own syntax whereas in C this is all handled by pointers which undermines the clarity of the underlying concepts a bit.


High level programming languages, such as python, are very efficient in terms of time spent to develop software but run less efficient than the lower level languages.


As some people have mentioned, learning a low level language gives you insight into what is happening and makes it easier to spot performance bottlenecks in high level languages as well.


If you are just starting out, higher level languages have the benefit that you will get results quicker (i.e. have actual running software) which might be more enjoyable. However, I do recommend to learn a low level, imperative, statically typed language (e.g. Pascal, C, C++) at some point in time to improve your overall programming skills.


Personally, I am a fan of python. It is a joy to write and can easily be extended with C modules. If the program becomes too slow then profile it, determine where the most time is spent and rewrite those parts in C/C++.
 
Install the version of pygame that's best suited for windows. The doc say what is new and when it was introduced. These are normally advanced features and you will not need them as a beginner. Really you need to use pygame and this is the visual/audio side (for games at least) and python is the underlying language that you'll use little bits of. Express line to learning Game Programming is a good book if you can get hold of it.


install ubuntu as a vitrual machine and get over your linux phobia. :p
 
I agree with the conclusion that any language will work, as long as you are a good student and try very hard to understand the basics of the language as you use it. A combination of study and use is very, very much recommended - study what something means, learn how to use it directly with working source, and move on to the next thing. There is a *lot* of work to be done, but the more you clear things up, the faster you will get at understanding the basics. Layers of abstraction will peel away if you take it step by step.


If you want to learn fast and with an interesting approach, pick up a project that already works and has all the basics sorted out for you, and then start reading the code, clearing up all the things you don't understand along the way. A working project already has the questions you will ask, answered. This is really one of the best ways to get a feeling for how to do things - learn from the sources that others have published exactly for this reason. If you start from a working example and pick through it, learning the things that you find interesting, you'll make a lot more progress than if you try to start from scratch.


I'll give you an example, Wakebreaker. Its a C++ project (very well written, imho) that delivers a 3D racing/chase game, utilizes OpenGL ES 1.1, and already works on the Pandora (because I ported it for exactly this purpose). The added advantage to this project is that it was ported to the Pandora, *using* the Pandora - i.e. compiler-onboard, so you don't have to do much before you can compile the sources and run them on your Pandora directly. A lot of times, people get upset with all the work that has to be done to get cross-compiling working - in this case, I used the Pandora itself (which can be used to build software quite successfully) and it went very, very smoothly:


http://w1xer.at/pandora/


Read the documentation carefully, there are details on how to get your Pandora set up to build this project included, and then get stuck into the C++ sources .. it should be very, very easy to understand, start at Game.cpp - and don't forget, with C++, the header files (.h's) should be read first!


If you are competent and honest, after about a week of studying these sources, you should have a pretty good idea of how it works, and while you maybe won't be ready to launch a whole new project from scratch, perhaps you can grok enough of the code to start making modifications. With Wakebreaker, for example, it should be very easy to modify the basic engine to add more models, different play scenario's, gameplay conditions, and so on - these sorts of additions/mods would be a good way for a new (C++) programmer to get their feet wet without getting overwhelmed by all the setup stuff you have to do ..
 
So would Python be up to the task of writing some quality RPGs on the Pandora or would it turn out to be too sluggish?

A badly-written program in any language could be sluggish; a well-written program in any language could be nimble.


It is entirely plausible that one could write a quality RPG in Python for the Pandora and have it not be sluggish.


Write in Python; the worst thing that would happen is, you decide you don't like Python, but along the way you learned how to program.
 
Im in the same boat with you. I switched to Linux three years ago, I heard it was free and knew I was going to learn to program, just didn't know what.


Like you the Pandora was the motivation. I fiddled around with Linux and never had the right tool to get going and really crack down on some code. I got an old laptop and installed slackware. Its awesome because it will start up in a command line (allowing you to do whatever you can do with clicking the mouse all over the place) and also has XFCE4 which is the windows manager Pandora uses. I went to the library and checked out some books on C++ and Linux then wrote my first code directly from the book, compiled it from the command line and it worked. When I kicked around the "which language" battle I decided C++ because C++ is Linux, Also I read that C++ can do more than write programs, it can allow you to write for hardware. Make anything work that you would want to plug in..... From there get a catalogue of industrial electronics and imagine all the things (sensors, motors, switches, ETC...) that you would want to hook up to the pandy, or any computer. Dont know anything else about other languages, but I am trying to encourage to go rent some books and start at page one. Its really not hard, its just kinda slow and boring. I just take a break every once and a wile, go to the open pandora homepage and drewell at the beautiful machine, call myself a dummy for only knowing how to write intro level programs, then write the next example out of the book and watch it work. GO FOR IT. Once you start writing the codes you will think of your own programs using what you have learned, then you'll want to see them displayed graphically and you'll be back on the forums in a couple weeks asking "which graphics language?".
 
Also, my game, if ever written, would also be a RPG, I found a sample C++ RPG game which was only about thirty lines of code. It was simple, it counted hit points and health points and there are two attacks. A sword attack or a magic attack, It is text only and short, but it shows how the concept works. I found a different RPG which will allow you to "Level up" but I haven't worked with it yet. From what I learned, you will not be writhing a glorious looking Baulders Gate game in a couple of weeks. Start somewhere though!!!
 
I'm currently learning C++ to, in the future, code for pandora. I've picked up a book by the creator of C++ himself, the book is 1300 pages long but, it is targetted at 1º year's computer science students, and that means they don't have a freaking clue about anything. ;)


also, it's a good book if you never programmed. And if you have already programmed, its even better:)


anyway... the book is "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup;


I've found it on the web for download, it is top quality, it even has bookmarks all over it :) YAY


if you're interested in learning C++ that's a nice way to go:


[link deleted] (send me a message with your email, and I'll send you the link)


OBS: I'm not sure if i'm violating any rule by sharing this link, if i did, let me know.


EDIT: For the sake of ending an uninitiated discussion, I have deleted the link
 
Last edited by a moderator:
Personally, I am a fan of python. It is a joy to write and can easily be extended with C modules. If the program becomes too slow then profile it, determine where the most time is spent and rewrite those parts in C/C++.

This is a good plan. I'll start off with Python, then when I'm a bit more experienced... try my hand at C++ to better understand what I'm actually doing and to polish up my programming.


(I'm assuming it's preferable to go for C++ yes? - What's the diff between C and C++?)

may88 said:
install ubuntu as a vitrual machine and get over your linux phobia. :p

When I get a bit of free time I'll look into it. It's crazy where I work atm - will probably only get my head above water to breath mid January. I would really like to btw... Sad that I never got onto Linux earlier in my life.

moz said:
http://www.cs.iupui....aharris/pygame/


this looks to be the book may88 mentioned, I have also been interested in programming myself, so I will give this a try also :)

Thanks a bunch! ;)

torpor said:
If you are competent and honest, after about a week of studying these sources, you should have a pretty good idea of how it works, and while you maybe won't be ready to launch a whole new project from scratch, perhaps you can grok enough of the code to start making modifications. With Wakebreaker, for example, it should be very easy to modify the basic engine to add more models, different play scenario's, gameplay conditions, and so on - these sorts of additions/mods would be a good way for a new (C++) programmer to get their feet wet without getting overwhelmed by all the setup stuff you have to do ..

Also, a great Idea. I'll definitely do this when I start learning C++


Thank you!

guax said:
if you're interested in learning C++ that's a nice way to go:


http://rapidshare.co...okmarks.pdf.zip

That's quite a large file to download! I'll check it out when I have some airtime to sacrifice... or I may even buy the book when I start learning C++. :)


So thank you everyone! I feel pretty clear about what I need to do. Start with Python (+Pygame) and then move onto C++ when I feel comfortable with Python and want to refine my programming skills.


Unfortunately I have hardly any time to think about these things till mid January - I run a restaurant/gift shop and it's the silly season. :blink:


I'm sure to have loads more questions when I actually get my feet wet with this. :)
 
What's the diff between C and C++?
C is a pure imperative language, C++ is object-oriented but allows imperative coding as well.


That means C has no classes etc, so the language itself is quite simple. The complex part about it is basically learning the whole set of pointer manipulation magic, e.g. you'll often do string manipulations by calculating with pointers. But once you've got the basic pointer stuff into your head it ain't that hard.


C++ on the other hand is basically an extended C, almost everything you learn with C can be applied to C++. Due to being object-oriented the language itself is way more complex and you can easily get around the whole pointer stuff, you'll rarely do more than simply passing them around.


C and C++ are quite compatible to each other, C code can be used by C++ code and you can directly compile it with a C++ compiler (but the C99 standard added some elements which are not supported by C++, like variable length arrays - but they are rarely used anyway), and by using the extern "C" keyword you can declare functions in C++ that can directly be used by C code.
 
Last edited by a moderator:
you need a combination of a language and libraries to program.


so, i my opinion the best combinations for a first language:


Windows development:


C# / windows forms => you can branch out to C# / XNA for 3D windows games and C# / GTK# for linux (mono) coding


Linux (full computer, *big* hand-held):


C++ / QT4 => excellent combination, forces you to use a *clean* C++ style


Python / GTK => the "hackers" language of choice, in my opinion the best way to use the GTK libs


Cheap hand-held, whatever OS it might run:


C(++) / SDL => If you absolutely need "It should run on everything with a display"


I am coming from C# and other MS languages, used mono for a while, experimented with python. And now I am addicted to QT4,


Where you want to end up:


C++ / boost / gl(es) => serious tools for serious people, infinite ways to shoot yourself in the foot, guaranteed headaches!! best results.
 
So would Python be up to the task of writing some quality RPGs on the Pandora or would it turn out to be too sluggish?

Eve Online is written mainly in Python and that's a pretty extensive game. I think you can learn and code for quite some time before the game gets so big and complicated it needs a faster language. And even then you can use C for specific parts.


I have a nice selection of Python ebooks, PM me if you need some. :)
 
C++ / QT4 => excellent combination, forces you to use a *clean* C++ style
Python / GTK => the "hackers" language of choice, in my opinion the best way to use the GTK libs


...


And now I am addicted to QT4
Then why not QT4 with PyQT4 or PySide? :D


I am still slacking like hell, but also planning to learn some python and play around with QT.


Ofcourse I will end up with a whole bunch of other tools that will fit the job.
 
C is a pure imperative language, C++ is object-oriented but allows imperative coding as well.


That means C has no classes etc, so the language itself is quite simple. The complex part about it is basically learning the whole set of pointer manipulation magic, e.g. you'll often do string manipulations by calculating with pointers. But once you've got the basic pointer stuff into your head it ain't that hard.


C++ on the other hand is basically an extended C, almost everything you learn with C can be applied to C++. Due to being object-oriented the language itself is way more complex and you can easily get around the whole pointer stuff, you'll rarely do more than simply passing them around.


C and C++ are quite compatible to each other, C code can be used by C++ code and you can directly compile it with a C++ compiler (but the C99 standard added some elements which are not supported by C++, like variable length arrays - but they are rarely used anyway), and by using the extern "C" keyword you can declare functions in C++ that can directly be used by C code.

Uuuhm... So C++ would be more difficult to wrap my head around than C? :blink:

Yannick said:
Linux (full computer, *big* hand-held):


C++ / QT4 => excellent combination, forces you to use a *clean* C++ style


Python / GTK => the "hackers" language of choice, in my opinion the best way to use the GTK libs

So what exactly *is* a library? (see just how little I know)


And where do I find these libraries you're referring to and what do i do with them?

Timstertoo said:
Eve Online is written mainly in Python and that's a pretty extensive game. I think you can learn and code for quite some time before the game gets so big and complicated it needs a faster language. And even then you can use C for specific parts.


I have a nice selection of Python ebooks, PM me if you need some. :)

This is very encouraging! I'm sure Python will be all that I need for quite some time. :)


And thank you very much! I certainly would be interested in those ebooks - though I probably wont get a chance to work with them till about mid January.


Now let me just figure out how to PM someone on these forums... :blink:
 
Uuuhm... So C++ would be more difficult to wrap my head around than C? :blink:
C++ has a lot more features that add a great deal more power, but a lot of those features also make certain things easier. With C, you pretty much have to know how to handle memory right from the very start. With C++ that can be abstracted away so you can get to learning, and memory management can be introduced gradually.


C has a steeper learning curve than C++, but C++ has a much longer way to go to become a "master" (if anyone can ever truly master such a language)

So what exactly *is* a library? (see just how little I know)


And where do I find these libraries you're referring to and what do i do with them?
A library is a collection of instructions someone else has written, you just use them. For example, you might have a graphics library where you can colour a pixel on the screen by just saying "setPixel(x, y, color)", and the person who wrote the library has taken care of all math and memory manipulations and all that stuff for you.
 
but C++ has a much longer way to go to become a "master" (if anyone can ever truly master such a language)

not so sure, try to mimic inheritence and polymorphism... even in a dumb down naive implementation it get quite hairy to master... the difficulty in C++ or higher level language is to master the abstraction done while keeping an idea of what's going on. with C the difficulty would be to master the huge quantity of code you produce to so the same things.
 
not so sure, try to mimic inheritence and polymorphism... even in a dumb down naive implementation it get quite hairy to master... the difficulty in C++ or higher level language is to master the abstraction done while keeping an idea of what's going on. with C the difficulty would be to master the huge quantity of code you produce to so the same things.
Hence the idea that C has a steeper learning curve but C++ has more "stuff" to learn.


There's less "stuff" in C to learn, but to use it well is a difficult climb. C++ has more "stuff" to achieve similar results, but each bit of "stuff" is a more gradual step up the learning mountain.
 
Back
Top