QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: FellippeHeitor on June 09, 2020, 08:44:44 pm

Title: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 09, 2020, 08:44:44 pm
‪Here's the first episode of QB64 Report, our podcast on all things QB64. In this episode, "OPTION _EXPLICIT"  https://www.buzzsprout.com/1147208/4082153-pilot-option-_explicit‬ (https://www.buzzsprout.com/1147208/4082153-pilot-option-_explicit‬)
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: bplus on June 09, 2020, 10:38:35 pm
So cool to hear you guys speaking :)
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Ashish on June 10, 2020, 12:11:17 am
Very nice! Very cool to hear @STxAxTIC  and @Cobalt  voice. :)
As for Fellippe, I already heard him before in his youtube videos
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Richard Frost on June 10, 2020, 01:15:47 am
That was an interesting podcast. 

A side note in it puzzled me, that some people edit not using the IDE.  Why?  I find the IDE fine for editing even 6000 line programs.  The only deficiency it has is that I was used to Ctrl-\ from 4.5 to initiate a search, and I fixed that by using AutoHotKey.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: TempodiBasic on June 10, 2020, 03:18:27 am
Great!
So you force me to improve my listening ability, that at this time is low.

Thanks

I find very interesting to have a different channel of informations about QB64, an extra channel to communicate and let people to deal with QB64.

Cool experience.

Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: TempodiBasic on June 10, 2020, 03:32:32 am
@Richard Frost
Also I use QB64IDE  both to remember old QB45IDE both because I write little programs and I mustn't use more windows to see at different places of code....with my need it is ok and I'm starting to use the comment and uncomment options to debug, a little less the navigation bookmark and so rarely the console$. But I think that this is relative to own way to project and to code.

I've tried the Dav's IDE and also Notepad++ with the RhoSigma's mod for QB64.
At the actual state the only feature that I find fine and it is not in QB64IDE is the action to open/close an indenting block of code like it is possible in Notepad++, Intellij idea, Eclipse, Code Blocks and other modern IDEs.

Good Coding
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Qwerkey on June 10, 2020, 04:46:24 am
Fellippe, Bill & Dave, thanks for taking the time to do this.  Great to hear you.  When I have seen OPTION _EXPLICIT in people's code and then looked it up in Wiki, I have thought "why would anybody do that?", so now I know.  Thanks a lot.
The podcast was both heartening and disheartening:  the latter aspect is for the completely disorganised coder that I am - never have I written code with any kind of structure, and members have had to put up with the shambles that my projects are!  I remain thankful that the QB64 community accepts all types.

A final word re Fellippe: another activity that you have taken on??  I just do not know how you do it, but please do carry on, we're all immensely grateful to you and the team.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Qwerkey on June 10, 2020, 05:03:45 am
Oh, by the way, I have now found a slight typo in the "OPTION _EXPLICIT" Wiki page in the example code given:

OPTION _EXPLICIT
DIM myVariable AS INTEGER
myVariable = 5
PRINT myVariabe

In the last line the variable name is misspelt.  So, if someone has a bit of spare time (but hardly a pressing issue!).

In my code every variable has a variable subscript to define type, so I'll never be using OPTION_EXPLICIT and will declare only arrays and _MEM objects.  I'll be carrying on in my shambles mode!
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: luke on June 10, 2020, 06:27:04 am
A side note in it puzzled me, that some people edit not using the IDE.  Why?
But most importantly, it doesn't have vim keybindings :)
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 10, 2020, 07:09:40 am
Oh, by the way, I have now found a slight typo in the "OPTION _EXPLICIT" Wiki page in the example code given:

OPTION _EXPLICIT
DIM myVariable AS INTEGER
myVariable = 5
PRINT myVariabe

In the last line the variable name is misspelt.  So, if someone has a bit of spare time (but hardly a pressing issue!).

The typo is intended here. Look at the line right below the code sample:

Quote
QB64 IDE Status will show: Variable 'myVariabe' (SINGLE) not defined on line 7
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 10, 2020, 07:10:58 am
Thanks Qwerkey to all of you guys who took time to listen to our first episode! We're excited and looking forward to producing more, and your feedback is really important!
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Qwerkey on June 10, 2020, 07:31:19 am
You may well be excited, but I imagine that sra. Heitor is saying "Oh não! Mais tempo naquele computador estúpido!".
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 10, 2020, 07:33:09 am
She's pretty cool about it 🥰
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Dimster on June 10, 2020, 11:10:07 am
Nicely done, very informative - think there should a link in the wiki to this podcast.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Dav on June 10, 2020, 03:43:02 pm
Very nice Podcast!  Looking forward to the next one already!

- Dav
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: _vince on June 11, 2020, 10:23:14 am
Here is a comment on OPTION _EXPLICIT in comparison to other languages.  Someone mentioned how setting option explicit takes away the convenience of quick and easy introduction of variables for debugging and development.  Other languages that force variable declaration will allow the declaration of local variables within a block such as a FOR or IF block.  For example, in QB64:

Code: QB64: [Select]
  1. IF 1 = 1 THEN
  2.     DIM z AS INTEGER
  3.     z = 3
  4.     ? z
  5. ? z
  6.  

the code will output

Code: [Select]
3
3

but the equivalent code in, say, a language such as C or freebasic will throw the error on the last print statement, variable not declared.  In QB64, variables can only be local to SUBs or FUNCTIONs.  I think this is an important difference because it means that you don't necessarily have to pre-plan every single variable and it is a lot more natural to introduce temporary variables within deep sections of code that are then released.

A major example of this is FOR loops, in C you'd often see the declaration in the for itself:  for (int i=0; i<10; i++).  And in freebasic:
Code: [Select]
for i as integer = 0 to 9
    ? i
next
? i 'would throw an error

For something like traversing arrays or just repeating statements you probably don't want a global 'i'.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: bplus on June 11, 2020, 11:58:55 am
Speaking of OPTION _EXPLICIT, when I am NOT using it, I did stumble upon the same trick Fellippe mentioned in broadcast. To use camel where it is first seen or used in program (that could be a little tricky) and then ever after use all lowercase, if the varaible or subroutine does not change to camel, I know I have a typo, very convenient when you don't use the OPTION of explicit declarations.

There is at least one place that this little trick does not work and that is your quiz for today ;-))

Update: Quiz continues

Honestly I can't remember exactly what that case is to state it in words, I am completely positive I will know it when I see it. I am remembering it as is something enclosed in parenthesis.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 12, 2020, 10:37:20 am
Thanks @Dimster and @Dav! Glad you guys enjoyed this new material.

We're hoping to come up with a new episode soon, still deciding on frequency.

@_vince I honestly had no idea variables would have block scope in those languages as you mentioned. You learn something new every day. I must say I usually do my DIMming as I go, so I'll end up with code like you showcased, with variables being declared in IF blocks or the like, even though I don't have intention of containing the declarations. I will eventually have a DIM i AS LONG at the beginning of programs and SUBs, so that I don't have to bother with other variable names for simple iterations.

@bplus camelCase was my default alternative before OPTION _EXPLICIT was introduced in the language. Now I can't live without it for bigger projects.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: bplus on June 12, 2020, 10:42:27 am
Ah @FellippeHeitor , do you remember the exception to the rule where the camel case version won't be recognized by IDE even though properly DIM'd?

Another little problem is if the variable is only one letter, syllable or word, you'd have to hump the first Letter which is not my habit.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 12, 2020, 10:43:38 am
Ah @FellippeHeitor , do you remember the exception to the rule where the camel case version won't be recognized by IDE even though properly DIM'd?

Are you talking about when you're working on an $INCLUDE module?
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: bplus on June 12, 2020, 10:46:30 am
Are you talking about when you're working on an $INCLUDE module?

No in regular main code or subroutine. It might be REDIM _PRESERVE of an array name or variable ubound or lbound or it might be with UDT items.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 12, 2020, 10:47:34 am
Ah, no. Only case it won't work under normal conditions is when it's used in LBOUND() or UBOUND() calls.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: bplus on June 12, 2020, 10:53:36 am
Ah Fellippe's got it!

Code: QB64: [Select]
  1. REDIM Array(0)
  2.  
  3. REDIM _PRESERVE Array(LBOUND(array) TO 20)
  4.  
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: OldMoses on June 12, 2020, 01:09:36 pm
I've been sitting in the corner, wearing my dunce cap lately, since some of my coding is running up against the limits of my math chops. So I haven't been around as much, spending much of my online time being tutored by Youtube's "Professor Leonard".

Imagine my delight at popping in and finding this podcast. Thanks for doing this, I'll be listening with great interest.

I've used OPTION _EXPLICIT for a program or two, but not exclusively. Interesting discussion.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: Petr on June 12, 2020, 02:48:32 pm
I'm just listening to your conversation, I'm so glad to hear you. Unfortunately, I understand little, I have significant shortcomings in spoken English.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: TempodiBasic on June 13, 2020, 06:54:13 am
about podcasting
I'm new to this way of communication... but they can have subtitle as youtube? In other words if I hear a audio file in the browser it is possible to see subtitle as youtube let do (subtile loaded or selfgenerated by software),  I remember that it works in the same manner the RDS of radio station.

Who can give me these informations?
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 13, 2020, 08:29:39 am
Here's the latest episode hosted on YouTube. You can enable closed captions (the CC button) and see YouTube's auto-generated subtitles. Not the same as a human would do but it's pretty good.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: TempodiBasic on June 13, 2020, 06:44:29 pm
Thanks Fellippe
so I must understand that for get subtitle original or generated by machine it is good to hear on youtube.
Title: Re: QB64 REPORT S01E01: "OPTION _EXPLICIT"
Post by: FellippeHeitor on June 15, 2020, 08:29:22 pm
Hey there. Second episode is now available: https://www.qb64.org/forum/index.php?topic=2711.msg119292#msg119292