Programming On Pandora


Awakening

Active Member
Joined
Mar 5, 2009
Messages
666
Location
Sweden
Website
www.digitalawakening.se
Thinking about the Pandora these last few weeks have gotten me excited about picking up programming again. I've not coded a single line in almost a year now. I'm really fast at coming up with new ideas, ask my board game publisher. Yesterday I started thinking about a simple 2D puzzle game using the touchscreen and today I've "completed" the design.

The pull for me is that I can code anywhere on the Pandora and I've always wanted to code for a portable unit. Now the question is what I should code in. I've programmed a lot in Dark Basic Pro and the simplicity of a high level language is great, I've also done some basic PHP stuff. Perhaps PyGame would be a good option for me, I've only looked at the tutorial quickly.

I've got some very basic knowledge of C++. Compiled code should give me a lot more speed but I've got no idea how much work I'll save using a high level language, nor do I know what bugs and limits I'll run into using PyGame. It sure would be great not having to use ; and {} all the time.

I don't have the time to look into this right now so I would really like a few pointers
 
Last edited by a moderator:
'Awakening' said:
It sure would be great not having to use ; and {} all the time.
Huh? :lol:

Are those keys faulty on your keyboard or something? I've never heard someone say they stay away from certain programming languages due to the use of those characters and just thought it was a little funny!

Steve
 
Last edited by a moderator:
'Rockthesmurf' said:
'Awakening' said:
It sure would be great not having to use ; and {} all the time.
Huh? :lol:

Are those keys faulty on your keyboard or something? I've never heard someone say they stay away from certain programming languages due to the use of those characters and just thought it was a little funny!

Steve


Since I'm used to DBP you have no idea how often I forget ; in PHP, it's also a lot faster not having to type them in. I guess {} are less of a bother, it's just that I need to press Alt Gr + 7 or 0 on a Swedish keyboard to type them in. Alt Gr is the right Alt on a Swedish keyboard.
 
Last edited by a moderator:
Yeah, dude I hate having to make line breaks too, I mean. I just can't stand the ability to span multiple lines with my bigger functions. The brackets really piss me off too, I just hate how easy it makes looking over a section of code and figuring out what happens where.

I kid, I kid.

You do realise, that C++ isn't really a low level language? While, it's considered less abstracted than most, it totally depends on how you're using it. What it is, is type-safe, which Python is not. I don't know why people link type-safe languages with "high level".

Anyway, I'm not too sure what you're asking, you won't have much trouble using Python on the Pandora. C++ is probably your best bet if you know it well, not because it's slightly faster than Python, but for the reason it's so common, it's well supported and libraries are everywhere. But that depends on what you're doing. If you're making a puzzle game in a week, you don't need C++. In the end, it comes down to what you're comfortable with.
 
Last edited by a moderator:
'Awakening' said:
Since I'm used to DBP you have no idea how often I forget ; in PHP, it's also a lot faster not having to type them in. I guess {} are less of a bother, it's just that I need to press Alt Gr + 7 or 0 on a Swedish keyboard to type them in. Alt Gr is the right Alt on a Swedish keyboard.
That's the same for me (norwegian keyboard), but I don't find it that troublesome typing out some { and }. I used DBP for some time, but after trying out some Java and C++, I got used to being a bit more organized. Although this won't help much for the Pandora coding, you could try out the Dark GDK, which is basically DBP for C++. Should make for an easier transition.
 
Last edited by a moderator:
'Awakening' said:
Since I'm used to DBP you have no idea how often I forget ; in PHP, it's also a lot faster not having to type them in. I guess {} are less of a bother, it's just that I need to press Alt Gr + 7 or 0 on a Swedish keyboard to type them in. Alt Gr is the right Alt on a Swedish keyboard.
You could use another character in their place (something like φ) then do a Find-Replace and switch them all out at once.
 
Last edited by a moderator:
'Butterman' said:
You do realise, that C++ isn't really a low level language? While, it's considered less abstracted than most, it totally depends on how you're using it. What it is, is type-safe, which Python is not. I don't know why people link type-safe languages with "high level".
Yeah, I know. Some people call it low level, some call it mid level.

I should probably take a few hours and read up on PyGame one of these days.
 
Last edited by a moderator:
'Awakening' said:
'Butterman' said:
You do realise, that C++ isn't really a low level language? While, it's considered less abstracted than most, it totally depends on how you're using it. What it is, is type-safe, which Python is not. I don't know why people link type-safe languages with "high level".
Yeah, I know. Some people call it low level, some call it mid level.

I should probably take a few hours and read up on PyGame one of these days.


lol, c++ is low level or mid level !? I wonder who those people you know are. Methinks your knowledge about c++ really sucks. I know about Python and still I cannot compare it with C++.

Low level ? assembler (no abstraction, no structure)
Mid level ? probably forth (no structure)
High level ? pascal, c, c++, etc.

Python is just a Prototype based OO interpreter. It also has Bytecode ? oh yeah, what is a virtual machine ? just a bytecode interpreter...
 
Last edited by a moderator:
'Awakening' said:
I don't have the time to look into this right now so I would really like a few pointers
There you answered it, c++ it is :p

(sorry, could not help it ; )
 
Last edited by a moderator:
I'm in sort of a similar situation as you, Awakening, except that I'm just used to programming in a language that does not require using ; at the end of lines. I decided last night that I would try making a game using C++ and SDL, and so far I have a box that moves up, down, left, and right, from keyboard input (great start huh?). I'll start by making a simple game, but eventually I think I'd like to make a game that uses the touchscreen and physics, like one of those stacking games where you could pick up shapes out of a pile with your finger/stylus, and try to stack them up to a certain height to pass the level. I decided to use SDL because I'm pretty sure I've seen some great games made using it, and I can easily test the game and compile it for my gp2x, and then later the Pandora.
 
Last edited by a moderator:
I've been using Turbo Pascal, then switch to DarkBasic and then switched to C, and i'm sticking to it.
C++ has some advantages and shortcuts, but i prefer procedural stuff, instead of OO programming.
OO can sometimes get confusing, as much as procedural can get spaghetti, it just a matter of self-organization. So my pointer would be this *c ;)
and for the {} it's quicker than typing BEGIN END and the ; allows you to put many commands on the same line, much like the : in DB iirc.

and as someone else said, C/C++ has a nice number of libraries.
 
Last edited by a moderator:
Well, I'm not really religious about programming languages. Use whatever you are comfortable with and get's the job done. The Pandora will probably support most languages you can throw at it (except maybe VB6 or something weird like that).

If you are after a language with which you get alot of performance - use C.
If you are after a language that enables you to make applications quickly - use Python.
If you are after both those things - use Java
If you are after a functional/procedural language - use scheme, erlang or haskell

If you are after a hybridof all the above - use Scala
(Scala is a VERY VERY VERY nice language btw. The most well-designed language I've seen until today. Yes, it runs on JVMs so it has Java's legacy, but I said I liked it's design, not it's implementation :p)

Just my 0.02€
 
Last edited by a moderator:
While saying ; is a point against, thats silly :) But I have definately seen a lot of people screwed up by the 705 uses "*" gets put through; overloaded a bit too much for new people to the language. Pointers and references.. try exsplaining the difference to new C++ coders.

Performance isn't likely somethign youneed to worry about right off .. maybe PyGame woudl be a good mix for you; script language, easy to deal with, pretty well supported, and yet also a pretty good language and relatively fast, despite.

Up to you though -- ask yourself -- do you wish to spend your time learning to code again, or writing the code? (ie: If you want to spend a lot of your time stumbling and learning and looking up, go with C or C++; if you want to just get to it, stick to PyGame or some simpler language.)

jeff
 
Last edited by a moderator:
I found LazyFoo's SDL tutorials a nice place to start (just google for them). Sure it's only 2D, but the documentation is pretty good. Programming something simple will get those skills unrusty enough to try something more complex second.

Codeblocks has also been working for me as an IDE, but I started on the console until I got the hang of what libraries were needed to get everything working.

Good luck!
 
Last edited by a moderator:
I know quite a variety of scripting languages and interpreted stuff, like python, lua, php, perl, processing and the like, and I never really used C++ till about 3 or 4 months ago. I say if you want to make a large effort over a large amount of time use c++ but for small games or prototyping just use python
 
PoisonedV said:
I know quite a variety of scripting languages and interpreted stuff, like python, lua, php, perl, processing and the like, and I never really used C++ till about 3 or 4 months ago. I say if you want to make a large effort over a large amount of time use c++ but for small games or prototyping just use python
processing? A scripting language/interpreted? :D
I thought it was just Java with some libraries added... Oh well, I guess you could say Java is interpreted on some machines...

Anyways, I would stay away from scripting languages. Not because I have anything against scripting languages for prototyping or anything like that, but for these 3 reasons:

1. They aren't scalable. If you start some huge project and late realize that your language "is too slow", you have to learn a new one from the ground up or do some serious optimization.

2. They are quite difficult to use im some ways. It's difficult to do reference checking in many sripting languages because to do so, you need to read through the 100 referenced files and semi-execute some of them only to get code completion or something (takes alot of CPU even if an IDE does this for you). Also, to not have type-safety can be a real PITA.

3. They don't have a basic syntax. To manipulate lists, for example, in python, the team did not introduce a new library for that purpose but instead extended the syntax. So, to do some things in scripting languages, you have to get used to new syntax all of a sudden, instead of just learning a new library.

And don't judge a language by it's appearance.
I stumbled upon Scala (as mentioned in my previous post) a few days ago and at first I really thought that it looked dumb. For example, here's a program that just prints it's command line arguments:
CODE

object MyApp {
def main(args: Array[String]) = args.foreach(println)
}


At first, it didn't make any sense. The syntax seemed to be completely messed up.
Then I learned that it is actually very simple, and that the Scala language actually has a very basic syntax (it has max 10 keywords or so), and now that code suddendly makes alot of sense and is even easier to understand for me than Python code.

Don't go by prejudice.
 
Last edited by a moderator:
Not been feeling well today (migraine) and having little else to do on my PC at the moment I've read a little more about Python and downloaded some PyGame projects.

I already knew Lightwave is using Python in their new Core software but I found that Google uses Python and that there are even companies here in Sweden hiring Python programmers. The OLPC project includes PyGame with their computers. The Python website has a lot of information and I just browsed around a bit. It's nice to know it's quite a lot more common then I thought. Never know what might happen in the future.

Right now I'm thinking that something quick and easy to get into would be the best for me. Never coded OO before but other then that PyGame seems to be an easy transition for me. There's also PyGL so I can get into 3D later as well. I really should worry more about having fun and getting things done quickly.
 
Last edited by a moderator:
Since the world hasn't caught up with hlide's very advanced level of advancedness, it considers C++ to be a mid level programming language, since it consists of high and low level features.

The main problem with C++ is that it's not what one would call "accessible". It's very difficult when starting out to find a way in. A language like DarkBasic is much easier to start with, because it's entirely self-contained; everything you need is there right from the start, well documented and ready to go. Hell, I still use BlitzPlus to do prototypes and quick stuff, because it's quick to use and quick to get results with. The downsides are that I can only compile to Windows, and you won't get amazing performance with things like video buffer manipulation, because you don't have that level of access. Since you can still get decent results for a lot of things, the main limit of these types of language proves to be the lack of multi-platform support.

Since you've already made some tentative inroads, I think it would be worth the effort to dive more into C++, since there's a C++ compiler for virtually everything with a CPU in it. It's not for the short-of-beard, but hopefully you'd find the time investment pays off. Indeed, the advent of Pandora has really motivated me to get far more into C++ than I have been.

As for your {}; problem:
workaround one said:
If typing the { } ; characters is really such a problem, you could try using a #define statement at the beginning of your software. It's a pretty horrible workaround , but as an example, adding the following at the beginning of a program:

CODE
//HORRIFYING WORKAROUND!!
#define obr {
#define cbr }
#define sm;
...would allow you to type obr, cbr, sm instead of { } ; and the preprocessor will replace all instances of the former with the latter symbol during the compile. The big drawbacks are that it will give the source code some horrid readability issues, and your IDE won't do all that code-folding / auto indentation stuff. Also, since you're starting out, you would risk acquiring some bad habits. Also, anyone having to work with your source code would hate you with a passion. Before you published any code, you could use a simple text editor to replace those defs.

In fact, I just tried that for a laugh, with a simple program. It works, and is indeed vomitably horrible. Man, you've got to REALLY hate typing {}; to use that solution.
workaround two said:
Try using a keyboard with some custom programmable macro keys, or an additional programmable keypad thingy. I have a Saitek keyboard I use at work, it has a programmable keypad thingy which I use to contain certain awkward functions in various pieces of software.

workaround three said:
If you actually use the Pandora to run the IDE, you'll (hopefully) have easy access to these keys anyway. Admittedly, that doesn't help you much right now.
QUOTE
I would really like a few pointers
... no, too easy. No I'm not going there. &OkayJustThisOnce Dammit, I went there.
 
Last edited by a moderator:
Yeah, big problem with Dark Basic is that it's Windows only. PyGame at least can run on a lot of systems and unless I'm really serious about programming I think I should stick with something easy. For now at least I should stay clear from big projects that I'll never finish anyway.

Thanks everybody for replying :)
 
Last edited by a moderator:
if you are used to Darkbasic then try Glbasic, the GLBasic author made a cross compiler for the GP2X, I am guessing he will make one for the Pandora since he was showing interest at one point, also Craigx was talking about teaming up with some guy to make an AMOS-alike programming language just for the Pandora (check the "full speed amiga" thread...it`s in there somewhere)

and - yes like you, after developing a huge repertoire of BASIC programming tricks, I just can`t grock C++ or any OOP languages at all, it all just looks like some messy incoherent muddle to me, procedural code makes perfect sense to me, C family compilers look like something written by some-one obsessed with demonstrating how clever they are....in fact they are so good at it, they lost me completely.

so in my case, since I am too dumb to understand ooops and main(){};*, I NEED BASIC in some form or another, I just like to knock up code for a hobby, C/C++ takes it beyond fun into hard worksville, I don`t want to go there :p
 
Last edited by a moderator:
Back
Top