Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Numsgil on October 19, 2005, 09:36:48 PM

Title: Porting the code
Post by: Numsgil on October 19, 2005, 09:36:48 PM
I've just finished porting the Robots module to C++.

It took me a while because I also redid a number of things along the way, and fixed a few minor bugs in random places.

If anyone wants to see what the unfisinished code looks like at the moment, holler and I'll zip it and put it on the FTP.
Title: Porting the code
Post by: Numsgil on October 20, 2005, 12:17:24 PM
Wolfhound is selecting a GUI library.  Soon he will probably begin porting the GUI to C++.

I'll be sure that we kep this GUI idiot proof (no offense meant.  It's a technical term, I swear).
Title: Porting the code
Post by: Zelos on October 20, 2005, 12:49:27 PM
why is it so important to port DB?
Title: Porting the code
Post by: Numsgil on October 20, 2005, 01:24:05 PM
2 things:

1.  Speed
2.  Pointers

VB is slow and lacks pointers.  With speed, well, that's fairly obvious.  The faster the better.

With pointers, I can construct abstract classes, that makes having two programmers working on different sections of code easier.
Title: Porting the code
Post by: vryko on October 21, 2005, 10:21:44 AM
Quote
2 things:

1.  Speed
2.  Pointers

VB is slow and lacks pointers.  With speed, well, that's fairly obvious.  The faster the better.

With pointers, I can construct abstract classes, that makes having two programmers working on different sections of code easier.
because vb is bad

in vb your programs are run trough an interpretor, so you lose a lot performance.  In c++ your program is completly compiled so it runs directly on your os, api's and hardware without any translations from an interpretor.

and most important, I learned c++.  I could understand most of the vb-code, but became demotivated by all the little things I didn't understand directly.

(sorry for any spelling-mistakes)
Title: Porting the code
Post by: PurpleYouko on October 21, 2005, 10:25:47 AM
Quote
in vb your programs are run trough an interpretor, so you lose a lot performance. In c++ your program is completly compiled so it runs directly on your os, api's and hardware without any translations from an interpretor.
Not quite.

VB only runs through an interpreter while you are running it in debug mode directly from code.

Once you make an execuatable then VB is 100% compiled. The reason that C is faster is that VB is compiled into a slightly less efficient format due to the high level of the VB language.
Title: Porting the code
Post by: vryko on October 21, 2005, 10:35:41 AM
it isn't compiled for 100%

it is more like java, but the vm is integrated in windows (maybe because it is from the same firm).
Title: Porting the code
Post by: PurpleYouko on October 21, 2005, 10:52:27 AM
OK maybe you are right that it isn't 100%. I am not in a position to know that for sure.
The one thing I do know is that you don't require any kind of interpretter program to run an executable created from VB. It just kicks out a .exe file that can be run on any windows OS
Title: Porting the code
Post by: Zelos on October 21, 2005, 11:26:35 AM
I still think its kinda sad ure moving it, when im starting to understand vb you guys move it into something I cant under stand :( :'(
Title: Porting the code
Post by: PurpleYouko on October 21, 2005, 11:49:03 AM
I think I like the idea suggested in another thread that we possibly split DB into two camps.

On the one hand we have the developmental version being ported to C. This will eventually be much faster and hopefully better than the VB version. Also should be able to run cross platform.

On the other hand, I think the VB version should also be honed to fix all the bugs that are still there in V2.36.

It will be very useful to have a completely bug free version for people who want a stable environment for long term sims. This version will most likely be one of the VB versions for a long time yet.
Title: Porting the code
Post by: Botsareus on October 21, 2005, 11:49:22 AM
Quote
GUI idiot proof

NO offance taken, but what do you mean by that?
Title: Porting the code
Post by: PurpleYouko on October 21, 2005, 11:56:12 AM
It is just standard jargon, normally understood to mean that the end user is unable to do anything that will cause a problem to the software no matter how hard they try.

"Idiot proof" is the holy grail to all programmers. Often quite difficult to achieve.

To test how "idiot proof" a piece of software is, you would normally give it to a known idiot for them to make every possibly attempt to break it.

In my case I give my software packages to my boss (Director of Research and Eductaion, Head of Chemistry). Not the kind of person that you would normally call an idiot, but from the point of view of breaking software, he difinitely fits the bill.
Title: Porting the code
Post by: Botsareus on October 21, 2005, 03:35:23 PM
Don't get me wrong... You need to be skill to brake some software PY... I finaly broke igod the one that got more hits then alice...



Oh, I thought you mean "idiot proof" as in "Ha! No c++ newbys will ever understand this peace of code". Never mind then...
Title: Porting the code
Post by: Numsgil on October 21, 2005, 03:39:14 PM
Quite the contrary, I'm hoping even people who don't have any idea of what classes are will be able to figure out what's going on.

If anything, I think the C++ code as it stands is more readable.
Title: Porting the code
Post by: Botsareus on October 21, 2005, 03:56:10 PM
Yea I just got some "readable" AIML code. He wrote each prosedure in a seporate .h file. How readable is that?  :banghead: #include@$$%%$#!! .... ok ok, don't reply ... it is a dead topic.
Title: Porting the code
Post by: Numsgil on October 21, 2005, 03:58:40 PM
You're supposed to fragment your code into multiple files.  That makes multiple developers working on the same project easier to share source.

I usually have about 500 lines of code in each .cpp file.
Title: Porting the code
Post by: Numsgil on October 21, 2005, 04:30:23 PM
I've uploaded the C++ code as it now stand to the FTP.  Definately look at it along side the VB code to see how they're similar/different.
Title: Porting the code
Post by: Botsareus on October 21, 2005, 04:36:22 PM
exselent.