-
Dec 15th, 2021, 07:56 PM
#681
Member
Re: TwinBasic
Originally Posted by baka
what I don't like:
I like this C feature, add it now!
.
I absolutely get that. I've been in the C# world for nearly 2 decades now, but I got my start in VBA, and then VB6.
I understand the BASIC ethos. The B stands for beginner after all - "Make it easy for humans to follow". I wouldn't want to propose anything that prevented that. But generics, overloads, and delegates do exist these days, and to pretend they don't does learners a disservice.
-
Dec 15th, 2021, 08:03 PM
#682
Re: TwinBasic
Originally Posted by mansellan
But generics, overloads, and delegates do exist these days, and to pretend they don't does learners a disservice.
You have no idea what a huge deal this is. VB.Net introduced me to so many new concepts I had never imagined I'd ever be able to grasp or find useful.
A big example for me is templates in C++. For years I'd have so much trouble understanding them. Like what is their point, why are they so popular, how can I use them, why didn't they just do it the old fashion way. They used to drive me crazy because they were so alien and confusing to me. When I moved to VB.Net which introduced me to generics, I was finally able to grasp them. This is such a fantastic point you made here.
-
Dec 15th, 2021, 08:05 PM
#683
Re: TwinBasic
I will use
a = a + 2
but I could do
a += 2
as well, if its available.
I told u, I dont care about += its quite simple stuff, and easy enough to understand.
but u need to be careful since that kind of syntax can open up a lot of more complicated one.
anyway I will keep using a = a + 2 since its easy to understand.
for me it means
a = will became a + 2
so its not algebra a = a
a += 2 means:
a plus is equal to 2
or
a plus will became 2
or
a plus, (plus what?) is equal to 2
-
Dec 15th, 2021, 08:06 PM
#684
Re: TwinBasic
Despite what I said in my last post, I do think feature adoption in a Basic language should be relatively slow - maybe the slowest of any language. Being on the forefront of fashionable syntax is not a good idea. That said, adopting the best time-tested ideas from other languages makes sense, especially if you want to appeal to a new generation of programmers. After all, Basic uses inventions like these.
-
Dec 15th, 2021, 08:12 PM
#685
Re: TwinBasic
Originally Posted by jpbro
Despite what I said in my last post, I do think feature adoption in a Basic language should be relatively slow - maybe the slowest of any language.
I can co-sign this. Despite what everyone might think, I'm not advocating TwinBASIC be turned into C#. I just think there should be a common baseline of "must haves" for any language in 2021 and the += family of operators should be among them. Async/Await would be another as we live in a multi-core world now. Both of these can be implemented without sacrificing VB6 compatibility.
-
Dec 15th, 2021, 08:14 PM
#686
Re: TwinBasic
Originally Posted by Niya
No it's not a Python term. The official name for operators like += is augmented assignment operator. It's language agnostic.
I'm not sure I've ever come across the term 'augmented assignment operator' (until I just googled it).
I've known them as 'compound assignment operators'.
In real life though surely everyone just calls them assignment operators.
I'd suggest just googling 'assignment operators' would give less Python-biased results.
-
Dec 15th, 2021, 08:16 PM
#687
Re: TwinBasic
Originally Posted by VB6 Programming
I'd suggest just googling 'assignment operators' would give less Python-biased results.
Yea, mostly C and JavaScript results showed up for me.
Still, I get a lot of Python results for quite a few language-agnostic queries.
-
Dec 15th, 2021, 08:32 PM
#688
Member
Re: TwinBasic
Originally Posted by Niya
I can co-sign this. Despite what everyone might think, I'm not advocating TwinBASIC be turned into C#. I just think there should be a common baseline of "must haves" for any language in 2021 and the += family of operators should be among them. Async/Await would be another as we live in a multi-core world now. Both of these can be implemented without sacrificing VB6 compatibility.
Careful... Async/Await is very, very tricky. It pretty much rewrites your code into Begin/End methods. If it finds it needs to do that inside a loop, it has to write an entire state machine for you to capture all the variables you might be using after the await. It's... fiendish.
It could easily divert a single developer (no matter how awesome) into a rabbit hole. Microsoft likely spent millions on it to fix all the edge cases.
-
Dec 15th, 2021, 08:43 PM
#689
Re: TwinBasic
Originally Posted by jpbro
I just want to say one more thing about the "+=" debate, especially in regard to newcomers. This operator is not much different than saying 1 + 1 or 1 + 2. What is "+"? Shouldn't a true Basic force us to write X = 1 Plus 1? Perhaps we should make it even more natural English and enforce a syntax like "X Equals One Plus One". Of course not, because we learned as children what symbols like +, =, 1, 2, 3, etc.. mean. I have X school age children who might eventually be part of a new generation of programmers coming to a new generation of Basic. They are taught some programming at school and they have no problem understanding the += operator. AFAIAC it's done, the programming world has decided that it's a useful operator and whether you like it or not, you're wrong if you're on the other side of this one. It's like getting mad about the letter W. You've already lost, so pick a fight you can still win.
AFAIK, math is taught like this:
a = 1
a = b
a = 1 + 2
a = b + 1
a = a + 1
Do you really think that that changed at school?
What is "natural" is what you do outside programming and you are already familiar before learning programming.
-
Dec 15th, 2021, 08:47 PM
#690
Re: TwinBasic
The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.
-
Dec 15th, 2021, 08:50 PM
#691
Member
Re: TwinBasic
Originally Posted by Eduardo-
AFAIK, math is taught like this:
a = 1
a = b
a = 1 + 2
a = b + 1
a = a + 1
Do you really think that that changed at school?
What is "natural" is what you do outside programming and you are already familiar before learning programming.
a = 1
a = b
a = 3
a = b + 1
a++
FTFY
(and indeed, static analysis tools would have fixed all of these)
-
Dec 15th, 2021, 08:53 PM
#692
Member
Re: TwinBasic
Originally Posted by dee-u
The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.
Yep.
-
Dec 15th, 2021, 09:07 PM
#693
Re: TwinBasic
Originally Posted by mansellan
Careful... Async/Await is very, very tricky. It pretty much rewrites your code into Begin/End methods. If it finds it needs to do that inside a loop, it has to write an entire state machine for you to capture all the variables you might be using after the await. It's... fiendish.
It could easily divert a single developer (no matter how awesome) into a rabbit hole. Microsoft likely spent millions on it to fix all the edge cases.
Oh I'm aware of how it works and how complicated it is internally but it has already become apart of the modern programming lexicon. However, owing to it's immense complexity, I can accept that the developers may have not have the resources to tackle it and on that grounds it would be prudent to avoid attempting to implementing it in TwinBASIC.
-
Dec 15th, 2021, 09:08 PM
#694
Re: TwinBasic
Originally Posted by jpbro
A long, long, time back, the comic strip B.C. ran a strip where the one-legged character Willy realized that he hated the letter W and anything that started with the letter W (an obvious issue). So, hating the letter W is a thing. I'm curious as to whether or not you picked that letter at random, or if you knew that hating the letter W was a thing?
My usual boring signature: Nothing
-
Dec 15th, 2021, 09:09 PM
#695
Re: TwinBasic
Originally Posted by mansellan
a++
What kind of math is that?
Anyway, I posted something wrong because a = a + 1 is not taught at school in math class anyway, a = a + 0 might be.
-
Dec 15th, 2021, 09:14 PM
#696
Member
Re: TwinBasic
Originally Posted by Eduardo-
What kind of math is that?
Anyway, I posted something wrong because a = a + 1 is not taught at school in math class anyway, a = a + 0 might be.
Um, I think you just proved my point? The math they teach at (high) school is equations. Not assignments.
Have you seen the symbols used in higher math? I couldn't begin to understand them. You need special symbol sets just to approximate them. To submit a paper you need LaTeX. And time. Lots and lots of time.
-
Dec 15th, 2021, 09:15 PM
#697
Re: TwinBasic
Originally Posted by Eduardo-
AFAIK, math is taught like this:
a = 1
a = b
a = 1 + 2
a = b + 1
a = a + 1
Do you really think that that changed at school?
What is "natural" is what you do outside programming and you are already familiar before learning programming.
Actually, that's NOT what I remember from school. In school, you are taught this:
1 + 2 = a
b + 1 = a
1 + a = a
It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.
My usual boring signature: Nothing
-
Dec 15th, 2021, 09:17 PM
#698
Member
Re: TwinBasic
Originally Posted by Shaggy Hiker
Actually, that's NOT what I remember from school. In school, you are taught this:
1 + 2 = a
b + 1 = a
1 + a = a
It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.
Might be a NA thing. Never saw assignments in high school in the UK.
-
Dec 15th, 2021, 09:17 PM
#699
Re: TwinBasic
Originally Posted by Shaggy Hiker
Actually, that's NOT what I remember from school. In school, you are taught this:
1 + 2 = a
b + 1 = a
1 + a = a
It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.
Yes, this is how I was taught in school as well.
-
Dec 15th, 2021, 09:22 PM
#700
Re: TwinBasic
Originally Posted by mansellan
Um, I think you just proved my point? The math they teach at (high) school is equations. Not assignments.
I have to concede in part.
Now I remember that when I begun learning programming, a = a + 1 seemed a bit strange. Because a = a, not = a + 1.
Still, the notation is familiar.
Originally Posted by mansellan
Have you seen the symbols used in higher math? I couldn't begin to understand them. You need special symbol sets just to approximate them. To submit a paper you need LaTeX. And time. Lots and lots of time.
OK, but that is something very specialized, not taught at school (where most of the new programmer will come from).
-
Dec 15th, 2021, 09:24 PM
#701
Re: TwinBasic
Yes guys, I already said that the last line was a mistake.
I have to leave it, at least for now. I'm too tired and make mistakes.
-
Dec 15th, 2021, 11:14 PM
#702
Re: TwinBasic
Originally Posted by Shaggy Hiker
A long, long, time back, the comic strip B.C. ran a strip where the one-legged character Willy realized that he hated the letter W and anything that started with the letter W (an obvious issue). So, hating the letter W is a thing. I'm curious as to whether or not you picked that letter at random, or if you knew that hating the letter W was a thing?
LOL I picked W for personal reasons I guess. I also have a pre-school aged child who is currently obsessed with the (English) alphabet. We have an almost non-stop ABC stuff going on around here. It gave me plenty of opportunity to think about how illogical it seemed that we call it double-U instead of double-V. I didn't investigate too far, but it seemed to fit the current discussion about a hatred of certain symbols.
While we're here, I have an irrational hatred of leading underscores in names (I think it means something in C or C++? Maybe even double-underscores mean something? It drive me nuts). Even naked underscores bother me (e.g. something like (a, _, b) = Something). The weird part is that I'm fine with internal underscores and use them all the time (so something like This_Is_A_Variable scans fine for me). What can I say, I'm an irrational meat computer doing his best.
-
Dec 15th, 2021, 11:36 PM
#703
Re: TwinBasic
Originally Posted by Eduardo-
AFAIK, math is taught like this:
a = 1
a = b
a = 1 + 2
a = b + 1
a = a + 1
Do you really think that that changed at school?
What is "natural" is what you do outside programming and you are already familiar before learning programming.
I'm ignoring the mistake, but math is absolutely taught differently at younger grades here. There is a certain amount of straight arithmetic like 1 + 1 = 2, there is also a lot of focus on different approaches to finding answers to questions like 532 + 129 = ?. When I was a kid you would do right-left math, but now they do left to right math. So, start with an estimate (500+100+ a bit left over = around 650?). Then do the actual math: 500+100 = 600, 30+ 20 = 50, 2+9= 11. 600+50= 650. 650+11 = 661. Pretty simple, and I find it works quite well across a wide range of large-ish numbers. The way I was taught I'd be carrying numbers and having to maintain a much larger mental state along the way working out a precise answer the whole way through. Interestingly, I started using the left-right approach myself after many years of programming financial(ish) software. It was faster to scan and do quick addition that way compared to the way I was taught.
But they also teach programming now. So things like variable assignments come more naturally at a younger age. All of us here can figure out the answer to this puzzle easily, but not everyone in the general population can.
Code:
X = 1
Y = 2
X = X + Y
Does X equal:
A) 1
B) 2
C) 3
It's not the symbols that are difficult, it's the idea of a symbol holding a value, and the symbol's value being modifiable by other symbol's values that is difficult. It's second nature to us a programmers, but it's a major mental leap for any newcomer. IMO, it's a much larger mental leap than the meaning of += versus + variable.
-
Dec 16th, 2021, 12:30 AM
#704
Re: TwinBasic
It was just an example.
Operations with letters are not taught in the first grades.
I think all around the world math must be taught more or less the same way, at least in Occident.
There are trends that change over the years, but I think they change everywhere. And more now, that everything is globalized.
-
Dec 16th, 2021, 02:29 AM
#705
Re: TwinBasic
why are you trying to compare algebra with how basic is assigning values, strings and objects?
we could have an entire discussion alone about that, tell me any language that is strictly following school methodology.
VB is using A = something, as already explained before, " Let A be B ". and its part of VB6 syntax.
its like you are trying to tell that "yes, we found something to complain about and we will use it".
and your premise is that because VB6 is faulty, it means everything we add is ok. so lets add:
+= , -= , *= , /= , %= , <<= , >>= , &= , ^= , |= , ?: , || , && , == != , < <= > >= , () [] -> . ++ - - etc.
why not, its something you learn in school already.
-
Dec 16th, 2021, 02:34 AM
#706
Re: TwinBasic
The Problem people have with "a = a + 1" in Basic, is that Basic has overloaded the "="-operator:
Assignment AND equality/comparison
Look at other languages
a) Pascal: "=" equal - ":=" assign
b) C/C++: "==" equal - "=" assign
.
.
.
.
I'm not advocating to change it! It's the way Basic is.
I'm still staying with my initial proposal: Offer people to write their own operators
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Dec 16th, 2021, 02:46 AM
#707
Re: TwinBasic
Zvoni yeah I think you are on the right track.
maybe even a IDE setting.
we can pick an option where we can change between VB and C Operation modes.
that way people can choose.
the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.
-
Dec 16th, 2021, 04:05 AM
#708
Re: TwinBasic
Baka, no need for an IDE setting or whatever.
Since Wayne has already implemented those C-ish operators it's a fait accompli.
No use to cry over spilt milk.
TwinBasic offers NEW (intrinsic) operators we didn't have in vb6? Great! (ShiftLeft etc.)
Did we need those C-ish intrinsic operators, when there is a perfectly valid way of doing things in a "Basic" way? Not really!
BUT, offer to write your own operators, and people can define their C-ish operators to their hearts contents
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Dec 16th, 2021, 05:24 AM
#709
Re: TwinBasic
Originally Posted by dee-u
The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.
+1
or do I mean +=1
-
Dec 16th, 2021, 05:42 AM
#710
Re: TwinBasic
Originally Posted by baka
the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.
Exactly.
Originally Posted by Zvoni
Offer people to write their own operators
That would be a Babel tower. Everyone with his own syntax.
-
Dec 16th, 2021, 05:50 AM
#711
Re: TwinBasic
Originally Posted by dee-u
The feature is already there then what is the debate all about? For it to be removed from TB?
Now that would be hilarious and explains why cries to "keep it more BASIC-ish" are so funny in this thread.
In most C/C++ compilers there is built-in ASM support which 99.99% of C/C++ programmers never use but I've never heard anyone complaining about it being available like some VB6 developers would like to keep the vNext language simple (and stupid).
cheers,
</wqw>
-
Dec 16th, 2021, 05:56 AM
#712
Re: TwinBasic
Rather than all this bickering, why not create a forum poll on a specific language variation that you would like to have, a poll on each that we can bothered to raise. Then we can simply vote on it.
The results could be maintained and could form a sort of blueprint-for-the-BASIC-that-has-yet-to-come.
It wouldn't be binding of course but it might act as a guide to the desires of those who are interested, if nothing more.
Last edited by yereverluvinuncleber; Dec 16th, 2021 at 06:08 AM.
Reason: typos removed
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Dec 16th, 2021, 06:06 AM
#713
Re: TwinBasic
Personally, I find that having two or more languages under one's belt and being relatively familiar in both gives you a perspective that change is not always wrong and that compatibility in itself is useful. I often find myself creating polyfills to create missing or obsolete VB6 functions when programming in VB.NET and sometimes even when using .js - and vice versa.
Curly brackets, semi colons, BEGIN and END statements, ==, += from C, .js or Delphi all make some sort of sense when you have to program in them for a while and become familiar - and not so alien. Sometimes BASIC is more understandable in its brevity, certainly when compared to Delphi. Most often though, it is more verbose but as a result quite understandable, certainly when compared to C.
BASIC is a good place to start but is important to remember to maintain the ethos of being a beginner language capable of more or less anything with a fair wind. If we just follow that mantra but also allow flexibility. we are still in a good place.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Dec 16th, 2021, 06:08 AM
#714
Re: TwinBasic
Originally Posted by Eduardo-
Exactly.
That would be a Babel tower. Everyone with his own syntax.
Your point?
If someone with such "own" syntax asks for support, he can get it in the "official basic" way.
Would be the same as: "Why is my Function not working?" showing only the call to it, but not the code of it.
And now i'm out of this discussion.
It's there, live with it.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Dec 16th, 2021, 06:38 AM
#715
Re: TwinBasic
Originally Posted by Zvoni
And now i'm out of this discussion.
It's there, live with it.
LOL! I didn't agree to one thing, showing the reason, that is something obvious, and you get offended?
Of course if someone inherits a projects from someone else, in a new job or wherever, and comes to a forum with an unknown custom syntax that the previous programmer invented, this poor new programmer won't get any help.
I don't mean you particularly Zvoni, but reading other posts from other people it seems that some people think that discussing something is bad, it is fighting, that one have to win and others to lose.
What wrong minded... how can you improve something if you don't evaluate each option, brainstorming, having people that think in one way and others in another?
-
Dec 16th, 2021, 06:42 AM
#716
Re: TwinBasic
Originally Posted by Eduardo-
LOL! I didn't agree to one thing, showing the reason, that is something obvious, and you get offended?
Of course if someone inherits a projects from someone else, in a new job or wherever, and comes to a forum with an unknown custom syntax that the previous programmer invented, this poor new programmer won't get any help.
I don't mean you particularly Zvoni, but reading other posts from other people it seems that some people think that discussing something is bad, it is fighting, that one have to win and others to lose.
What wrong minded... how can you improve something if you don't evaluate each option, brainstorming, having people that think in one way and others in another?
Ah, Ed.
has nothing to do with you.
I respect opinions of others (even if i don't agree with them), and i'm definitely not offended, if someone disagrees with me, as long as he/she can provide plausible reasons from their point of view (which you did).
And:
Discussion <> Fight
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Dec 16th, 2021, 07:01 AM
#717
Re: TwinBasic
Originally Posted by Zvoni
Ah, Ed.
has nothing to do with you.
I respect opinions of others (even if i don't agree with them), and i'm definitely not offended, if someone disagrees with me, as long as he/she can provide plausible reasons from their point of view (which you did).
And:
Discussion <> Fight
-
Dec 16th, 2021, 07:46 AM
#718
Re: TwinBasic
Originally Posted by Zvoni
Discussion <> Fight
Maybe we should be able to write Discussion != Fight in Basic. I'm kidding, I'm kidding!
-
Dec 16th, 2021, 07:55 AM
#719
Re: TwinBasic
Originally Posted by baka
Zvoni yeah I think you are on the right track.
maybe even a IDE setting.
we can pick an option where we can change between VB and C Operation modes.
that way people can choose.
the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.
The biggest problem with an IDE setting is what happens if you open a project from someone who has their IDE set up differently to yours? Would the code still compile if your IDE was set to not use the += syntax and their code was written that way? If that would be a compile failure then you have instantly caused fragmentation amongst the users, if it would compile then why bother with an IDE setting anyway? Just a thought, probably something Wayne would be best to answer is if tB supports .editorconfig files as a way of managing this kind of thing.
-
Dec 16th, 2021, 08:07 AM
#720
Re: TwinBasic
Originally Posted by Zvoni
As i said: Implement writing your own operators, and all that stuff would be a non-argument, because everyone could then write his own shortcuts like he/she likes them
Code:
Public Operator +=(ByVal ALong As Long, Optional ByVal AStep As long = 1) As Long
Return ALong + AStep
End Operator
The problem you get with that is somebody could then make the += operator do something non-obvious. That could result in the following two examples doing two completely different things...
Code:
Dim i as Integer = 10
i = i + 5
and
Code:
Dim i as Integer = 10
i += 5
The only way you would be able to tell while reading the code is to look at the source of an operator and see exactly what it does. I have seen code like that in C++ (many, many years ago thankfully) that resulted in a very hard to track down bug, lots of swearing, and an utter inability to understand why the original dev chose to do things that way.
Making += a shorter version for an addition and an assignment is a much safer option.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|