GP32 Well, I Took The Plunge.


T

TelcoLou

Guest
I just ordered a book, "Learn C++ in 21 Days". It comes with a CD ROM with a compiler and some other stuff. I dabbled in Visual Basic a few years ago, but never did anything more than create a small point & click adventure for Windows.

I also programmed in BASIC on my Texas Instruments TI-99/4A computer from ~1983.

I was hoping to try my hand at creating something on the GP32. My super-uber-n00b question is this:

SDK, means Software Development Kit, yes? And what does this 'kit' contain? I'm assuming it has the necessary libraries to get your C++ program to run on the GP32?? I also see a few different SDKs out there for the GP32 .... how are they different?

Any input would be greatly appreciated, as it will take me some time to learn C++ syntax and all.

Thanks in advance :)
 
You will need three things to get started:

1. A devkit or toolchain.
This is basically a special version of the compiler made for compiling things for the gp32. I would recommend using a prebuilt toolkit like devkitARM. You can get it from devkit.tk and there is a tutorial there on how to set it up.

2. An SDK
Two choices here. The official gamepark SDK or Mr Mirko's Alternative SDK. I would recommend Mirko's SDK because it it vastly easier to use IMO.

3. An editor or IDE
This is something of a personal preference. Here are some of the common editor choices that people are using.
Crimson Editor
Dev-C++
Eclipse
Microsoft Visual C++
Textpad
UltraEdit

I would warn you that Dev-C++ is not the easiest thing to setup for gp32 development.
 
Thank you so much!

/me feels 10X smarter already :lol:
 
I really think people should learn C prior to C++. I found that C++ has a lot of trapdoors if you're not used to object oriented programming (which is said to be easier to understand for beginners - don't think so). Plus, C++ isn't the most easy way for GP32 coding, a lot of people have problems with it.
 
don posted on Aug 7 2004 at 09:16 AM said:
I found that C++ has a lot of trapdoors if you're not used to object oriented programming (which is said to be easier to understand for beginners - don't think so).
OOP _is_ easier to understand for beginners.. it's just that c++ is hardly OOP. or to put it in alan kay's words (the guy who coined the term OOP): "when I invented OOP, I did not think of c++"
 
Last edited by a moderator:
or to put it in alan kay's words (the guy who coined the term OOP): "when I invented OOP, I did not think of c++"

Most OOP history books say Simula 67 was the start of Object Oriented Programming. Smalltalk was written on a Simula machine. Anyway, Alan Kay doesn't even consider Java to be an OOP language.

Did Alan Kay actually coin the term "Object Oriented Programming" first?
 
generalnmx posted on Aug 7 2004 at 03:29 PM said:
Most OOP history books say Simula 67 was the start of Object Oriented Programming. Smalltalk was written on a Simula machine. Anyway, Alan Kay doesn't even consider Java to be an OOP language.

Did Alan Kay actually coin the term "Object Oriented Programming" first?
actually, alan kay knew simula 67 - it's hard to say these days who coined the term, everybody from simula over smalltalk to the oberon people claim to have done significant work on the "OOP" concept. istr that kay claimed that he explicitely coined that term, and as he (or his team) developed the first "real" OO GUI system, I think the step to call it all "object oriented" is much smaller for him, than for nygaard et al.

out of curiosity, I just looked up the grammar of simula67 - it's static typed, which makes it pretty uninteresting for me (and adds a very non-OO, non-message-send feeling)

simula67
Code:
 Begin
   Procedure RightText(T, N, FitsIn); Text T; Integer N;
               Name FitsIn; Boolean FitsIn;
   Begin
      Integer I;
      FitsIn := N >= T.Length;   
      For i:=1 step 1 until N-T.Length do OutText(" ");
      OutText(T)
   End of RightText;

   RightText("Short", 30); OutImage;
   RightText("And the long one", 30);
End of Program;

smalltalk
Code:
String>>printRightAlignedInto: anInteger
  "prints the text right aligned into anInteger long field,
   returns false if string doesn't fit in"
  1.to: (anInteger-self length) do: [ |x| Transcript show: " " ].
  Transcript show: self.
  (self length > anInteger) ifTrue: ^False.
 ^True

'Short' printRightAlignedInto: 30.
"and the long one" printRightAlignedInto: 30.

the first one looks like pascal to me (except that it can be a method of a bigger class), the latter one shows real usage of objects. yes, integers are objects, too - and you can make them count, so "for" is not necessary anymore (unlike, it seems, in simula)

as for java, there are more things than classes inside it: exposed primitives (int vs. Integer, float, bool, ..), classes aren't classes itself, so reflection needs some hack in the API that does give you a Proxy object but by no means a real class object, etc..
 
Last edited by a moderator:
I really suggest just learning a very small amount of C maybe the first 100-200 pages of your book and moving on to C++ after that. Its alot easier that way.

You can aim for C++ but you will still have the basics of C.
 
I hate languages that make everything an object like its some sort of technical masturbation. for is a lot simpler than making objects count. Although I agree it might scale better, the php foreach also does the same job to almost any object successfully. Stuff like 1.next from Ruby is just plain over the top.
 
Rico posted on Aug 8 2004 at 01:03 AM said:
I hate languages that make everything an object like its some sort of technical masturbation. for is a lot simpler than making objects count. Although I agree it might scale better, the php foreach also does the same job to almost any object successfully. Stuff like 1.next from Ruby is just plain over the top.
the difference lies in system design.. it's good that you brought up php as an example - it's an excellent example on how _NOT_ to design languages (eg. namespace pollution).

back to topic:

making objects count is regular.. when you design that object, you give it a method - always the same name, like to:do: in smalltalk - and _everything_ that ever encounters this object, and knows by context that it's supposed to be able to count can use it!

how would php do it: for($flubber=$start;$flubber<$end;$flubber++)

EEEEEEEEKS!

now you have to teach php how this type (which we didn't specify in this example) can increment itself - is this even possible in php?


ok, let's look at c++ for some more flexibility:

garbage ThisType::eek:perator++(some more garbage) { logic };

a F*CKING SPECIAL CASE for a small set of functions (+ - * / >> << == = ++ -- ^ %, maybe I forgot some) to teach c++ how to handle objects as first class members - for this small set of operators..

WTF?

smalltalk has 9 keywords, a regular syntax, a bunch of system classes, various OO concepts (which you have to learn for every other "OO" language, too) and builds everything on top of that!

it took a TWO YEARS EFFORT to make g++ "mostly" c++ standard compliant, while php doesn't follow any kind of standard - lucky php hackers (poor php users) - it's insane!

so it isn't just "technical masturbation", it is a design decision (a very early one, too, and they didn't need to drop it for 25 years now) to keep the system simple while allowing complex things neither php nor c++ can ever accomplish within the current design constraints. (example: http://beta4.com/seaside2 )
 
Last edited by a moderator:
oxygene posted on Aug 7 2004 at 11:23 PM said:
the difference lies in system design.. it's good that you brought up php as an example - it's an excellent example on how _NOT_ to design languages (eg. namespace pollution).
Other than namespace pollution, what's really wrong with PHP? I see that brought up a lot but not much else. Nearly every language has function name inconsistencies and you have to make an effort to remember module and function names for those too.

Anyways, the point is moot because PHP is a language to get things done in, not a high-level proto-language or especially OOP style. And it works. I use it as a general-purpose scripting language without OO and save a LOT of time.

As for incrementing, I don't see the need for iterators. You'd just make an array (or 'collection', if you'd rather) of objects and foreach through them. What's that? You abstracted the collection behind a massive API so you can't do that? Get rid of your fucking APIs. Every time I see:

class Foo { int a; int getA(); void setA( int value ); }

I just go CRAZY. It might be useful for some things like automatically cascading changes onto other classes, but just putting it in for the sake of it exemplifies everything evil about OOP. Then again, C++ isn't particularly well designed. It wouldn't be bad for there to be built-in access controls to prevent values from being modified from outside the class.. oh wait, we DO have that, it's called private.

I hear a lot of people talking about Smalltalk but few actually using it to code anything. I hear it has a very nice design to it, 25 years as you say. But is it useful for real world implementation? That Seaside system also looks wonderful but I am naturally suspicious of it. I had a similar idea a while back about making one program for the whole site, and having the web pages get handled by the interpreter - this is it. But there have to be a lot of constraints attached?
 
Last edited by a moderator:
Why do people use Foo in every example anyway? I never figured out where its coming from. Maybe its some sort of hello world type thing which your suppose to use. I have no idea.

Anyway if your gonna learn php PLEASE dont use it offline. I know people who use it offline to code regular programs(to tell you the truth I have no idea how this even works and I dont care). Theres no such thing thats too OOP unless its Java.

Java is WAY too much OOP. Even the main function has to be in an object.
 
CrazyDesi posted on Aug 8 2004 at 05:25 AM said:
Why do people use Foo in every example anyway? I never figured out where its coming from. Maybe its some sort of hello world type thing which your suppose to use. I have no idea.

Anyway if your gonna learn php PLEASE dont use it offline. I know people who use it offline to code regular programs(to tell you the truth I have no idea how this even works and I dont care). Theres no such thing thats too OOP unless its Java.

Java is WAY too much OOP. Even the main function has to be in an object.
http://dictionary.reference.com/search?q=Foo

as for java, I disagree - it's not OOP enough, it's a hybrid (example: integral datatypes)

either do it right (that is, _everything_ is an object of the current environment, incl. integral datatypes, the parser, compiler, classes) or don't do it at all - all those mixed languages (c++, objc, java, php, and so on and so on).. noooo :)
 
Last edited by a moderator:
Other than namespace pollution, what's really wrong with PHP? I see that brought up a lot but not much else. Nearly every language has function name inconsistencies and you have to make an effort to remember module and function names for those too.

the object model looks like a hack, implicit casts between strings and integers are going to haunt you, insecure-by-default settings (mostly solved, luckily) - basically it was designed like a language suitable for prototyping, then used as the real thing.

Anyways, the point is moot because PHP is a language to get things done in, not a high-level proto-language or especially OOP style. And it works. I use it as a general-purpose scripting language without OO and save a LOT of time.
right, php is there to get the job done - if this job can be expressed in less than 2000 LOC and consists of lots of html and not so much logic, I even think, php is worth it, at least for prototyping.

As for incrementing, I don't see the need for iterators. You'd just make an array (or 'collection', if you'd rather) of objects and foreach through them. What's that? You abstracted the collection behind a massive API so you can't do that? Get rid of your fucking APIs.

so how would you "foreach through" a tree, using several strategies (depth first, breadth first, ..)? would you copy it to an array first? would you invent a new API?
how about: build an iterator object for each strategy once, when you need it, apply this iterator to your tree, then move through the tree - no "foreach", still native handling, and easily reusable code.

Every time I see:

class Foo { int a; int getA(); void setA( int value ); }

I just go CRAZY. It might be useful for some things like automatically cascading changes onto other classes, but just putting it in for the sake of it exemplifies everything evil about OOP. Then again, C++ isn't particularly well designed. It wouldn't be bad for there to be built-in access controls to prevent values from being modified from outside the class.. oh wait, we DO have that, it's called private.
in this example, a _would_ be private, and getA/setA would be public.

the thing is, you want to be able to change the class, so that a is something entirely different or that some invariant can be fulfilled (eg. some other, dependant variable must be updated) - using those accessors is thus good style and an example of encapsulation: getA/setA would be able to transform your old argument to the new a (whatever it is), transparently, without you changing code that accesses this property of the class in 1000 locations.

some languages provide some syntactic sugar for that, eg. C# and ruby. they want you to use accessors, but they're mapped onto Foo.a and Foo.a= internally, which are proxied through some method. finally it's simple again.

I hear a lot of people talking about Smalltalk but few actually using it to code anything. I hear it has a very nice design to it, 25 years as you say. But is it useful for real world implementation?
probably the biggest draw back of smalltalk (and lisp, forth, and java to some extent, too) is that they're systems - basically every other language provide direct access to the unterlying system, while those language were designed as systems (back then, when there was no such thing as today's elaborate operating systems), that are able to work stand-alone.

for web applications, any of these languages is fine server side, as the client doesn't (need to) know what it's dealing with.

why smalltalk is referred to by everybody and their cat is, that it's the current high ground in OOP design. MVC, Design Pattern, Extreme Programming, etc. all came out of the realm of smalltalk. unfortunately it is not where the money is - those with the money tend to avoid risks and stick with "C-like" languages, as their developers know "C" already.

let's split languages by their syntactic features: those with curly braces, those with pascal-like begin..end statements, and the exotic ones.
for some reason people seem to think that it's easier to stay in the same decoration - which is why c++, php, java, C# are so successful compared to other languages of their days - C (and later c++) was the "gold standard" they wanted to cater to.

the problem is, it makes things _harder_. ever tried to switch between c++ and java several times a day? pretty much the same syntax, but different semantics. I prefer to have an entirely different (yet, _simple_) syntax so the compiler or whatever will scream at me, when I tried to write in the wrong language.

That Seaside system also looks wonderful but I am naturally suspicious of it. I had a similar idea a while back about making one program for the whole site, and having the web pages get handled by the interpreter - this is it. But there have to be a lot of constraints attached?
the feature of seaside lies in the blocks - you only have them in few other languages (ruby, lisp, and python is supposed to get them soon)
Code:
renderContentOn: html
    html heading: count.
    html anchorWithAction: [self increment] text: '++'.
    html space.
    html anchorWithAction: [self decrement] text: '--'.
this code produces something like <h1>5</h1><a href="?1">++</a> <a href="?2">--</a>
and if you follow the "++" link, the block
"[self increment]" is executed, which leads to a method that increments "count".

boring example, probably even overkill, but it's that, an example.
now, the system allows for some fancies: how would you store that count value in php - in a session? add it to every link, so that the state is up to date?

session means, if count starts with 0, and you press "++" twice, you get "2".. press "back" in your browser, you'll see "1", press "++" - oops, you get "3" - not intuitive.
having the state in every link would help there, but 1. that can get pretty big (think of the whole state of a shop), 2. you probably don't want to expose all elements of your session, for secrecy or just to make sure things stay consistent.
seaside solves this - the "session" is stored with each of the blocks, which have unique ids that are used in the html.

currently, most web development is page based.. you provide some options, get some values back, do something with those values, then decide what to do, and provide a new page - real ("native") applications don't work that way, and seaside is modelled after such applications.


edit: it's getting pretty off-topic now, don't expect more answers from me here
 
the object model looks like a hack, implicit casts between strings and integers are going to haunt you, insecure-by-default settings (mostly solved, luckily) - basically it was designed like a language suitable for prototyping, then used as the real thing.

There isn't really an 'object model'. Variables have explicit temporary types that can check against. magic_quotes_gpc is now enabled by default, while automatically making variables from GPC input is disabled. It's pretty much impossible to sql inject it, and it's damn secure.

right, php is there to get the job done - if this job can be expressed in less than 2000 LOC and consists of lots of html and not so much logic, I even think, php is worth it, at least for prototyping.

PHP has 'just enough' OOP to cut down on code reuse whilst still being very easy to develop with. Hence the number of massive PHP projects - MediaWiki, Scoop, osCommerce, PHP-Nuke etc. that run quite smoothly, especially compared to Perl.

so how would you "foreach through" a tree, using several strategies (depth first, breadth first, ..)? would you copy it to an array first? would you invent a new API?

Point taken, but I'd just foreach, and if the object is_array then recurse. PHP's arrays are ridiculously versatile.

some languages provide some syntactic sugar for that, eg. C# and ruby. they want you to use accessors, but they're mapped onto Foo.a and Foo.a= internally, which are proxied through some method. finally it's simple again.

This sounds exactly what I'm looking for. My main 'beef' is just with people who do it needlessly, but again I can see your point. It's always nice to be able to define get/set functions and have those automatically implemented, but for the program to run fine without them implemented. If Ruby does that then I am impressed.

why smalltalk is referred to by everybody and their cat is, that it's the current high ground in OOP design. MVC, Design Pattern, Extreme Programming, etc. all came out of the realm of smalltalk. unfortunately it is not where the money is - those with the money tend to avoid risks and stick with "C-like" languages, as their developers know "C" already.

XP is steadily gaining acceptance as it has been proven more efficient in various studies, and studies are what the executives are influenced by. Maybe that will mean more acceptance of Smalltalk et al. Though it pains me to say this, however, some big compiler brand (like, say, Microsoft) is going to need to get behind this before it catches on, and MS is pushing .NET so people are migrating to that instead.

I disagree with your 'same decoration'. I've learnt C, Lisp, etc. and can switch between them easily enough. I hear it's not uncommon that programmers find it easy to learn new languages, because its the semantics that count. C++ and Java are admittedly a little too close for comfort given their underlying differences though, as you say.

now, the system allows for some fancies: how would you store that count value in php - in a session? add it to every link, so that the state is up to date?

You'd use databases. Besides, for a store, all you really need to keep around are the user's details and cart. If you want to make sure each page is unique, throw the timestamp in with it :)

currently, most web development is page based.. you provide some options, get some values back, do something with those values, then decide what to do, and provide a new page - real ("native") applications don't work that way, and seaside is modelled after such applications.

Not sure about this ... web applications aren't yet 'real applications', having as they do user-initiated inputs and instant outputs, with dodgy passing of information through cookies etc. Anything that translates that into something resembling a real program, of course, is helpful.

edit: it's getting pretty off-topic now, don't expect more answers from me here

Had to put that at the end, didn't you :/
 
Dalto posted on Aug 8 2004 at 10:56 PM said:
So, TelcoLou, when you made this post did you realize it was going to turn into a debate on the relative merits of Object-Oriented devlopment? :)
:lol:

Nope. At the risk of getting laughed at by the international coding community, I ask this:

Is OOP similar to Javascript?
 
Last edited by a moderator:
Back
Top