Pandora The best programming language for the Pandora?


FaeMinx

Rainbow Liberation Instigation
Joined
Dec 11, 2010
Messages
3,143
Age
43
Location
outside looking in side looking out
One of the things I would really love to do once i get a Pandora is write my own software for it.


Only thing is, I know nothing about coding. I've never even used Linux!


My intention is to acquire the needed resources and teach myself (with help from the community)... but I don't know where to begin. Please help! :unsure:
 
Python. Start with the tutorial, the one that comes in the Python documentation.
 
Python. Start with the tutorial, the one that comes in the Python documentation.

How do I decide what to go for - Python 2 or 3?


I'm worried that I won't find enough resources to learn Python 3 effectively, also I'm assuming most people I would turn to for support are using 2? Would this be an issue?


Then again, shouldn't I go for something up to date?
 
I suspect Pandora ships with Python 2 but not Python 3. And I'm almost certain that the libraries you'd need in order to write games in Python on the Pandora are only for Python 2. So I suspect you should learn Python 2.


Python 3 is definitely a better language. But it's not wildly different. The changes are mostly in ways that probably won't affect you so much. Python 3 is better at Unicode handling (characters outside of the normal A-z 0-9 and punctuation), and the I/O libraries are improved. Beyond that the changes get more subtle. So really Python 3 isn't all that different from Python 2.


If you embraced Python 2 right now, it wouldn't be a big deal for you to switch to Python 3 in the future. There's even a program that does a lot of the conversion for you, called "2to3". I used it on a medium-sized project (a couple thousand lines of code) and it did an admirable job :)
 
Ok. I've downloaded Python 2.7.1 for Windows (I have XP)(as that is what I'll be using till I get my Pandora) and some documentation.


Now I'm trying to decide which text editor to use - there are so many on the Python Editors page! :blink:


What do you recommend?
 
the pandora has python 2.2x something i believe, i had to wrestle with python versions a while back on it.


as to python being a good starting language...probably not, yes it's pretty simple to start with, and the forced indentation can be useful, but i say it's much better in the long run to start out with C, at least then everything is strongly typed and you get into decent practices (just need to learn to indent for readability purposes, not because the language requires it).


though the language itself doesn't matter much, it's learning to program and think logically, once that's nailed down you should be able to take any language there is and apply it to the problem at hand.


i'd recommend trying out linux too, especially if you're going to try your hand at some C, as you'll need basic knowledge of the linux shell, and the gnu toolchain/etc setup


edit: oh and editor-wise, anything really, but something like geany or even eclipse are handy to have, anything other than notepad.exe :p
 
Last edited by a moderator:
You could also start with C++, since C++ without object orientation is nearly the same as C.


IIRC I learned QBasic, then VisualBasic, then Java, then C++. And I considered C++ to be the most valuable language I've learned so far, because it can do almost anything.


Editors, eh?


For Windows, Notepad++ is pretty good, I think it's based on Scintilla.


Once you get to Linux, there's a few other options:


* SciTE is pretty decent, I used it for a while but now I don't


* Geany is also good as it has the terminal subwindow for compiling things, but it's based on GTK+


* Kate is also good as it has the terminal subwindow, and it's based on KDE / Qt, but for some reason it runs slowly sometimes and I doubt you want kdelibs on the Pandora


* Leafpad, I think is used in xfce... can't be any worse than notepad.exe.


Just don't use stock notepad, anything else is much better.


Eclipse is like the opposite of notepad: Really huge, takes ages to load, and wants to be some kind of a framework framework framework so you can program while you program while you lag your face off and eat memory. I don't care for it.
 
Last edited by a moderator:
If it's really best that I do so, then sure... but isn't C++ daunting for someone who has zero experience?


I suppose in the long run I would be grateful that I have no limits to what I can do - the question though is:


For someone who is essentially an artist and *at present* doesn't get a huge amount of time to spend with a computer. (I dropped maths in school too btw - I was falling behind)... Will I ever know C++ well enough to justify learning it?


What are the differences between Python and C++ ?


Would C++ be easier to learn after I've had a go at Python? Or does the fact I'm lousy at maths mean I'm not suited to tackle ANY programming language? :unsure:
 
forget about languages, they are just tools, you should first learn the logic behind the code and how to design code. I'dd rather search a basic OO course...


Someone knowing how to program can produce good program in any language quickly.


Someone who know a language syntax perfectly but don't know how to program will only create some crap good for the dump.
 
I disagree that C is a good beginner language. I disagree even more that C++ is good for beginners. C/C++ certainly have their advantages--I wouldn't want to write performance-critical code in anything but C--but "ease of learning" simply isn't one of their strengths. For example, memory management is a complicated topic, and yet you have to understand stack vs static vs heap pretty early in your life as a C/C++ programmer. Python hides these details for you.


MIT's Computer Science department recently changed what language they use to teach Introduction to Computer Programming. It was Lisp for thirty+ years. Several years ago they changed it to Python. They've actually uploaded videos of the lectures / the coursework to their "Open Courseware" web site, all for free. So, let MIT teach you computer programming with Python!


http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/
 
I disagree that C is a good beginner language. I disagree even more that C++ is good for beginners. C/C++ certainly have their advantages--I wouldn't want to write performance-critical code in anything but C--but "ease of learning" simply isn't one of their strengths. For example, memory management is a complicated topic, and yet you have to understand stack vs static vs heap pretty early in your life as a C/C++ programmer. Python hides these details for you.


MIT's Computer Science department recently changed what language they use to teach Introduction to Computer Programming. It was Lisp for thirty+ years. Several years ago they changed it to Python. They've actually uploaded videos of the lectures / the coursework to their "Open Courseware" web site, all for free. So, let MIT teach you computer programming with Python!


http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/

I think I'll go ahead with Python 2... after all, I don't want to try C++, get totally discouraged and give up on learning to program altogether!


I'll definitely check out those videos when I have some airtime to burn. (on pay as you go)


Are there any Python specific editors you recommend?


And out of interest, what is the scope of what one can achieve with Python? What about it would frustrate me years down the line and make me want to switch to say C++?
 
forget about languages, they are just tools, you should first learn the logic behind the code and how to design code. I'dd rather search a basic OO course...

Do you have any links or downloadable resources on the matter? As I've mentioned before: I know nothing. :)


My brief view of the wiki on the subject tells me you are indeed correct - I certainly need to learn and understand OOP.
 
Do you have any links or downloadable resources on the matter? As I've mentioned before: I know nothing. :)


My brief view of the wiki on the subject tells me you are indeed correct - I certainly need to learn and understand OOP.

you'll need someone else for this, all the beginer material on the subject was either given by a professor, either paper material, and half of it in french... I could try to find course for you, but you can surely do the same, and I hope people there know that kind of ressources...


edit: hum from the description of this MIT course it looks quite good, starting at the basis, and going quite far in a good way, guess it's not surprising since it comes from MIT... it is based in python, but as I mantionned you don't really have to care about that (but making sure the programming language is supported by your target toolchain is a good idea anyway... it will save you some time by avoiding to learn new syntax)
 
Last edited by a moderator:
Python hides these details for you.
that's arguably one of the reasons C++ is better for beginners than Python: if you hide things from the user because you're worried they won't understand them, then they won't understand them. By teaching these things early on, they don't have a chance to form bad habits. Heap and stack and memory management in general is a very good thing to know, even if your compiler abstracts that stuff away. Concepts of memory management aren't really that hard to teach either, I've demonstrated it a few times to grade schoolers.
 
I won't get to the "best language for a beginner" conversation again (there was a good thread on that somewhere in the gp32x pandora section), but I can recommend Notepad++ editor for almost any coding on windows. I used it for almost everything save for Java (can't beat eclipse for Java).
 
Oh FaeMinx, did you know what you were getting yourself in to here? :p


I won't say you should use it, by Python gets my vote of confidence. As a mechanical engineer, I don't have to program much, but when I do Python gets the job done.


To clarify, the Pandora comes with Python 2.6 installed; the 2.7 that you downloaded has a few extra features, but you probably won't encounter them for a long while. Even when you do, they'll be easy enough to work around. Python 3.x isn't yet available 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.


For learning, there are many good resources; I cut my teeth on the various wikibooks available, and I've heard plenty of good things about How to Think Like a Computer Scientist. And, of course, any specific questions can be directed to the Python dev section here.


For editors, your Python installation should include IDLE. I don't know if it's any good, but it should be enough to start.
 
I'm using Komodo Edit these days; it has all the features I need, and it's open source (written in Python!). On the other hand, it's a bit sluggish on older hardware, so I don't think you'd want to use it on a Pandora. On the Pandora I'd probably use gedit. (Or vi, but then I've been using vi for more than twenty years.)


I don't agree that beginners should be exposed to everything immediately. Sticking with the example of memory management: if they continue with their programming, then eventually they'll have to learn about memory management, yes. But if they don't have a knack for programming, or aren't really that interested, the frustration that comes with having/debugging memory-related errors may be enough to discourage them early on. Python sets up the beginning programmer for success. And, as it happens, it sets up the expert programmer for success too.
 
I don't agree that beginners should be exposed to everything immediately.
I probably should have mentioned this but got caught up in the argument, but I also agree Python is a good language for beginners, not because it abstracts memory management, but because it's a simple enough syntax and sufficiently powerful to encourage them to proceed further. When I was talking about "developing bad habits" I was thinking more along the lines of using Java to learn programming, or some other strongly typed garbage collected language: basically if you're going to learn memory management, learn both ends of it at once, the new and the delete, and don't abstract away either side.


To that end, it is entirely possible to write C programs without ever touching the heap and worrying about memory at all, and concepts like the stack and pointer manipulation can be introduced gradually.
 
I'd been looking at programming for the pandora. I've only really used BASIC and variants in the past, principally on my ZXSpectrum, and later my Amiga (yes, I am that old!) I went through the same considerations.


Python is quite nice, but you'll need Pygame as well. I bought a book ('Game Development with Python and Pygame' by Will McGugan) which was great help getting things set up. It was very easy to get working, and I wrote a very simple game which ran under Python on my Laptop (Ubuntu), and then ran exactly the same on my PS3 (Yellow Dog), and my work machine (XP) which was cool! However as someone with a some (very old) programming experience, I didn't like how the code looked, or the duck typing (basically, where the program decides what things are by how they are used as opposed to you telling it what it is!). If you decide to use python you're better off with a python aware editor for your code. IDLE is the standard one, and worked fine for me.


I then had a go at C... it is very daunting to begin with. But I got 'Code::Blocks' (free app) which is a great application for trying out C code... it has debugging and is quite easy to set up, considering (although I have a linux set up, windows might be different) However... I have not tried cross compiling (making code that will run on other machines like a pandora), but there are plenty of guides and helpful people here or on GP32X. As for getting started, I found lots of good tutorials online - Lazy Foo (google it) was one I found invaluable.


My biggest problem is motivation. I ordered within the first few hours on the fabled 30th Sept 2008, and still don't have my pandora. Maybe if and when I get it I'll continue learning. There is nothing quite like the feeling of a big bit of code you've written working just right!
 
Python is quite nice, but you'll need Pygame as well.

I've just had a look at the Pygame page and am a little confused. What version of Pygame must I download to be compatible with Python 2.7.1 for Windows?


Also, is there a version of Pygame compatible with the Python 2.6 that comes installed on your Pandora?


I could probably figure this out if I had enough time to read the page properly... But I have to hurry and get ready for work - I'm late! :blink:
 
Back
Top