[Implemented] Revision of example programs

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

[Implemented] Revision of example programs

Post by Little John »

This is not actually a wish, but a suggestion for improvement:

I think some of the example programs that ship with PureBasic could/should be slightly revised. For instance, in the program QuickSort.pb (PureBasic 4.30 beta 5) it reads

Code: Select all

tmp.l = a(i)
a(i) = a(j)
a(j) = tmp
When a new PureBasic user reads that code, (s)he might get the wrong impression that there is no Swap command in PureBasic. Therefore, and for the sake of readability, it's IMHO better to write

Code: Select all

Swap a(i), a(j)
instead. This might even be faster.

Regards, Little John
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

I was hoping for a SWAP() command!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
idle
Always Here
Always Here
Posts: 5839
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

We could always redo them ourselves and have a good time ribbing each other.

It is after all for the communities benefit and the last thing the dev team want to be doing is rewriting old examples when there's bugs to fix.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Post by Little John »

I think it's always a good idea, when the capabiities of a product are obvious to its new users. The main purpose of the example programs is to help new users learning PureBasic, no?
idle wrote:We could always redo them ourselves
That's not the point. From the example program mentioned above, new users could learn that PureBasic has a Swap command, especially when swapping is what actually happens in the code. Not all new users read the forum, and it shouldn't even be necessary to read the forum just to get good example programs.

Regards, Litle John
User avatar
IceSoft
Addict
Addict
Posts: 1683
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

idle wrote:We could always redo them ourselves and have a good time ribbing each other.
It is after all for the communities benefit and the last thing the dev team want to be doing is rewriting old examples when there's bugs to fix.
Examples should be more as a source example for newcomers.

They are:
1. Source examples for newcomers of course.
2. Copy/Paste examples for using on your own code (often from the scratch)
3. And this is important: It is also one of the developer source code which should be used for a first check of the behavior between a new PureBasic version and the latest released PureBasic version (but it seems Fantaisie use not the delivered example source code for this kind of important internal tests.)

4) And last but not least:
If an example not running....what should a possible customer think? Should he buy it also if the delivered example source is not running?
No I think example source code are not only examples...they are also the first taste for a 'buy or no buy' decision.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Post by Little John »

Well said IceSoft, thanks. I couldn't express it as good as you did.

Regards, Little John
User avatar
idle
Always Here
Always Here
Posts: 5839
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

@littlejohn

I agree with you, though that's not to say, that we as the people who directly benefit from the dev teams effort; sometimes without paying for those added benefits, its not a big ask for the community to pull together and actually contribute to those new comers in a positive way.
I have great respect for the PB community and I try to contribute where I can as others so graciously do.

I think it would be really good if the Dev team created a CVS for the examples and let the community post examples.

Anyway thats my 2 cents worth, I've cracked a bottle open and am now reclining to enjoy a well deserved vino.
Post Reply