bmx-ng / bmx-site

BlitzMax website source
3 stars 7 forks source link

Beginners guide outdated #19

Open GWRon opened 5 years ago

GWRon commented 5 years ago

During a Pull Request Brucey asked to add Then to if-statements.

The (current) Beginners Guide writes this:

When to use Then? You can put it after your If expression. The use of Then, is not required and I think the code is just as easy to read without Then. Like this, If A = 1 Then B = 2 is equal to If A = 1 B = 2. If you take a BlitzMax file and delete all Then, it will run the same. Use Then if you think it helps you read the code. When I use then, then it is to make an ifstatement on one line more readable, like in the example above and in the example below. My advice is, never use then if your if-statement is not on one line.

(source: https://blitzmax.org/docs/en/tutorials/beginners_guide/)

Maybe we should update that part to fit to the way we write the docs/examples.


~Right below that quote you will find a attention/notice-box:~

~BlitzMax doesn't have Boolean variables which only accepts True or False.~

~This is not true with NG - as NG understands the new type Bool.~

woollybah commented 5 years ago

There is no type Bool in NG.

GWRon commented 5 years ago

So TBool is there just for BCC ... I wasn't sure and just checked the bcc sources and saw some "bool stuff".

Ignore that second part then.

I know, not an as good candidate to report now but: Global Name$[] 'Declear an Array! contains a little typo.

BTW: should we try to make the "Beginners Guide" SuperStrict (as we do with the examples) ?

woollybah commented 5 years ago

Yes, eventually.