VBAndCs / sVB-Small-Visual-Basic

Small Visual Basic (sVB) is an educational programming language, created by Eng. Mohammad Hamdy as an evolved version of Microsoft Small Basic (SB). It is meant to be easier and more powerful at the same time, to introduce programming basics to kids and beginners of any age, provided that they can use the English keyboard on the Windows OS.
Other
222 stars 16 forks source link

Assign operator vs. Equal to operator ... #18

Closed boa2145 closed 1 year ago

boa2145 commented 1 year ago

I would like to use two operators in Small Visual Basic for assignment and equality, like Python and C# do. It is confusing to me that one and the same operator "=" is sometimes used for value assignment and then as a comparison operator for equality. It is much better to use "=" for the value assignment and "==" for equality. Regards ... Gregor

VBAndCs commented 1 year ago

@Gregor Unfortunately, this is not possible, because it is one of the BASIC fundamentals, which make VB fanatics hate the C syntax :D = is used for assignment in one possible place, as the second token in the line, preceded with an identifier, otherwise it is defiantly the equality operator. For example, in this code:

x = 1 
y = x = 2

x with be set to 1, and y will be set to False, unlike to C syntax, which will set both y and x to 2!

boa2145 commented 1 year ago

Good morning Mohammad,

okay, I have to respect the Basic fundamentals. I am an old fan of the Basic programming language. It was an idea, because I study other languages, too. I have to say that Python is really nearby Basic what Kemeny and Kurtz said: Basic should be a programming language for everyone. Python has the same aura and I hope that Small Basic, Visual Basic and Small Visual Basic will continue the history of Basic.

Do you know that I still have some old Basic Dialects on 3.5" floppy disks? GW-Basic, QBasic, QuickBasic and the single version of Visual Basic for DOS. I have two old and running computers from the 1990s with the operating system DOS. I am a fan of old computer books from the 1980s and 1990s. They could be a nice part of a computer museum: a bookshelf with a lot of old computer and programming books. My channel Basic-Retro-Programming on Tumblr has also this background.

Kind regards ... Gregor

Mohammad Hamdy Ghanem @.***> schrieb am Mo., 22. Mai 2023, 23:09:

@gregor https://github.com/gregor Unfortunately, this is not possible, because it is one of the BASIC fundamentals, which makes VB fanatics hate the C syntax :D = is used for assignment in one possible place, as the second token in the line, preceded with an identifier, otherwise it is defiantly the equality operator. For example, in this code:

x = 1 y = x = 2

x with be set to 1, and y will be set to False, unlike to C syntax, which will set both y and x to 2!

— Reply to this email directly, view it on GitHub https://github.com/VBAndCs/sVB-Small-Visual-Basic/issues/18#issuecomment-1558004943, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3D5YMUVCWSSQ7I6V7LZPV3XHPIXBANCNFSM6AAAAAAYK5ZCMU . You are receiving this because you authored the thread.Message ID: @.***>

VBAndCs commented 1 year ago

@boa2145 Good morning Gregor. Logo and GW-BASIC were my first languages I learned at Hi-school, then Pascal, C and C++ in collage. But I start considering myself a programmer when I learned VB in Jan 1998. There are more than 100 dialects of Basic. Quick Basic has a new life in QB64. VB6 is getting new dialects today such as RadBasic and TwinBasic (and sVB may be one of those at some level). VB .NET also is getting new dialects like Mercury and ModVB. So, you can say VB will never die :D