Page 1 of 2

PureBasic-Reference-Wikipedia

Posted: Wed Jul 05, 2023 2:38 pm
by Splunk
The "PureBasic-Reference", its description, hints and examples often turns out quite scarce and often it leaves more questions open than it answers. Also because of this -but not only- there is this forum to answer such questions. (eg. my last post: viewtopic.php?t=81949)

For the "PureBasic-Reference" I have therefore the following suggestion:

How would it be, if the PureBasic-Team would create something like a "PureBasic-Reference-Wikipedia" on their website, which all users of the forum could edit with more examples, additional descriptions, tips&tricks about the topic or whatever? (no discussions or anything...just facts!).

It happens often enough that questions are asked here in the forum that have already been answered several times. If it is found that the question results from the fact that the necessary information is missing in the reference, it is easy to add it. This would also relieve the PureBasic-Team.

Eventually you would have a reference that would provide ultimate answers.

What do you think about this?

Re: PureBasic-Reference-Wikipedia

Posted: Wed Jul 05, 2023 3:51 pm
by Fred
If you want to contribute to enhance the doc, you can do it on the github here: https://github.com/fantaisie-software/purebasic . It's not as easy than a wiki but it will be reflected in the IDE and online help which is great.

Re: PureBasic-Reference-Wikipedia

Posted: Thu Jul 06, 2023 7:16 am
by Janni
I very much agree with Splunk.
Often the examples are short or just too tricky understand (to us newcomers).

Contributing to the official help file is just for the pro's - I would never have the confidence to do it.

An easy way to add examples would easily improve people's understanding of many concepts. Forum is often a needle in the haystack.
Wiki is great, and also PHP.net is a good example where they have "user contributed notes" that everyone can vote up or down.

Re: PureBasic-Reference-Wikipedia

Posted: Thu Jul 06, 2023 12:26 pm
by blueb
Janni wrote: Thu Jul 06, 2023 7:16 am I very much agree with Splunk.
Often the examples are short or just too tricky understand (to us newcomers).
A good PureBasic source is the Rosetta Code site with about 600 PureBasic examples.

https://rosettacode.org/wiki/Category:PureBasic

Re: PureBasic-Reference-Wikipedia

Posted: Thu Jul 06, 2023 12:37 pm
by Janni
blueb wrote: Thu Jul 06, 2023 12:26 pm
Janni wrote: Thu Jul 06, 2023 7:16 am I very much agree with Splunk.
Often the examples are short or just too tricky understand (to us newcomers).
A good PureBasic source is the Rosetta Code site with about 600 PureBasic examples.

https://rosettacode.org/wiki/Category:PureBasic
Thank you! nice to know.
I still think a better solution would be what's mentioned within the Purebasic domain.

Re: PureBasic-Reference-Wikipedia

Posted: Thu Jul 06, 2023 1:27 pm
by Tenaja
Janni wrote: Thu Jul 06, 2023 12:37 pm
blueb wrote: Thu Jul 06, 2023 12:26 pm
Janni wrote: Thu Jul 06, 2023 7:16 am I very much agree with Splunk.
Often the examples are short or just too tricky understand (to us newcomers).
A good PureBasic source is the Rosetta Code site with about 600 PureBasic examples.

https://rosettacode.org/wiki/Category:PureBasic
Thank you! nice to know.
I still think a better solution would be what's mentioned within the Purebasic domain.
The biggest problem with Rosetta is that most of the examples look like they weren't written by an experienced PB user. They appear to be copied and modified from another example. That process isn't bad if done by an expert, but otherwise misses out on many features that make PB stand out.

Somebody with free time could remedy that, and correct some misconceptions that Rosetta conveys. It should be done... In addition to an official pb wiki, which has been suggested before.

Re: PureBasic-Reference-Wikipedia

Posted: Thu Jul 06, 2023 4:16 pm
by Demivec
Tenaja wrote: Thu Jul 06, 2023 1:27 pm The biggest problem with Rosetta is that most of the examples look like they weren't written by an experienced PB user. They appear to be copied and modified from another example. That process isn't bad if done by an expert, but otherwise misses out on many features that make PB stand out.

Somebody with free time could remedy that, and correct some misconceptions that Rosetta conveys. It should be done... In addition to an official pb wiki, which has been suggested before.
The code examples on the Rosetta Code site serve a different need than those in the PB Reference Manual. Rosetta's purpose is to demonstrate how to accomplish a specific task in different languages. The examples in the PB Reference are to illustrate the use of a PureBasic language or library feature. Both sets of examples are typically written without wasting lines of code on extraneous elements, such as using an elaborate GUI for code that is written to show how to use math operators.

Many PureBasic examples on Rosetta Code were written in 2010. Many examples in the PB Reference Manual were written before 2005 or were written at the time a new feature or library was first added.

Any reference source is easy to do and complete in every way if the task is handed over to an 'expert' who has 'some free time'. :wink:

Rosetta Code is a Wiki and anyone could make modifications there, line by line if needed. A PureBasic Wiki was done before but eventually died on the vine after a few years. Here's a link to some discussions in the forum about it, https://www.purebasic.fr/english/viewtopic.php?p=112054&hilit=Wiki#p112054. They have a familiar ring to them.

After all that background, my opinion is that many of the examples in the Reference Manual can definitely be improved. Things start to get more complicated when you try to answer some of the questions that come next (in no particular order):
  • How should the existing examples be improved?
  • Should code include EnableExplicit?
  • How should code be commented (none, minimal, verbose) ?
  • Should code use Debug statements or a GUI for output?
  • How should variables be named and what capitlization, if any, should be used?
  • Should examples for different commands and librarys utilize identical structures or invent new structures for variety?
  • Should object IDs be numeric constants, enumerated constants, or generated with #PB_Any?
  • Should several short code samples be included or one longer one that combines the short ones?

I followed the link that Fred posted earlier for GitHub but it didn't seem to help me discern what I could do to help in any way or if things are even moving along there.

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 10:27 am
by moricode
+1 , agree with Splunk, the DOC is outdated long and miss out many new informations and extensive examples ,
many examples were found same as is PB 4.x , and there was some "undocumented" features suppose to be documented
some way but was left out ages.

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 10:35 am
by Fred
I don't agree, the doc is kept up-to-date with current features, if you find something wrong, please report it in the doc bug forums. If you want to submit more examples for a single command, you can also open a thread with your new example and it will be added.

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 12:29 pm
by AZJIO
Splunk
I made my own selection, but everyone has their own preferences, so it's all purely individual. And on the forum you can find if you try different requests. Sometimes the answer is hidden in a lot of results, then I use the output of results only in the topic title. So experiment and find what you are looking for.
My reference

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 1:04 pm
by Little John
Demivec wrote: After all that background, my opinion is that many of the examples in the Reference Manual can definitely be improved. Things start to get more complicated when you try to answer some of the questions that come next (in no particular order):
Yes, there is something to discuss. :-)
Anyway, a first obvious step is e.g. to use constants with meaningful names, rather than using 0 for different purposes.

By the way, hopefully someone will change the title of this thread, which is wrong and misleading:
This thread is about a PureBassic wiki, while wikipedia is this: https://www.wikipedia.org

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 1:42 pm
by AZJIO
Demivec
Not a single question is confusing.
Since there are many window elements, in each example you can show different programming options.
EnableExplicit - only for large examples. You can use one "EnableExplicit" for every 10 examples so that the user can quickly see it and look at the description of what it is for.
Standard debugger "Debug".
Variable names can be discussed. I've never had any problems with this.
Structures do not need to be invented, except for structures in the structure section
Identifiers are always constant (#btn) or #PB_Any, alternating between options, but NEVER use numbers. Why show the wrong way of programming and then get rid of it. That is, I copy the example from the help and start changing numbers to constants. I would rather not do this useless work.
Examples can be made large if their concise versions increase the overall size of the code through repetition.

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 1:51 pm
by Fred
I setup a wikimedia here: https://www.purebasic.com/wiki/index.php/Main_Page, feel free to toy with it. BTW @AZJIO your reference is very nicely done !

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 4:41 pm
by Janni
Fred wrote: Fri Jul 07, 2023 1:51 pm I setup a wikimedia here: https://www.purebasic.com/wiki/index.php/Main_Page, feel free to toy with it. BTW @AZJIO your reference is very nicely done !
That's really great Fred! :D

I hope people will contribute with examples! May I suggest that all articles uses the same name as from the official PB commandindex (https://www.purebasic.com/documentation ... index.html)

That way a dynamic link to the wiki can even be added under examples in the official docs.

First page: https://www.purebasic.com/wiki/index.php/ACos

Re: PureBasic-Reference-Wikipedia

Posted: Fri Jul 07, 2023 7:45 pm
by Splunk
:mrgreen:

I think Fred is not a fan of long discussions - he does!