Page 1 of 1
[Implemented] Revision of example programs
Posted: Wed Dec 03, 2008 4:37 pm
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
instead. This might even be faster.
Regards, Little John
Posted: Wed Dec 03, 2008 6:28 pm
by Rook Zimbabwe
I was hoping for a SWAP() command!
Posted: Thu Dec 04, 2008 5:04 am
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.
Posted: Thu Dec 04, 2008 6:06 am
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
Posted: Thu Dec 04, 2008 6:32 am
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.
Posted: Thu Dec 04, 2008 7:15 am
by Little John
Well said IceSoft, thanks. I couldn't express it as good as you did.
Regards, Little John
Posted: Thu Dec 04, 2008 7:19 am
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.