Go Down

Topic: Is there a good Basic interpreter? (Read 9459 times) previous topic - next topic

Docedison

No.. Nick The God *dhenry* has spoken it isn't for us mere mortals to understand the words or meaning, If as you say, there ever was one...

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

GoForSmoke

You can take away my GOTO when you can pry it out of my cold dead fingers.
It's my right! Anyone who doesn't like it can take an unconditional jump!






Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

PaulS

Quote
It's my right!

So is shooting yourself in the foot. Not recommended, though.

GoForSmoke

Next thing, they'll want background checks!
Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Nick Gammon


Anyone who doesn't like it can take an unconditional jump!


Whoa, whoa. That's like a GOTO isn't it?

Suggest amendment:

Code: [Select]

if (YouDontLikeIt)
  exit (1);
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

PeterH


You can take away my GOTO when you can pry it out of my cold dead fingers.


Quote from: Bug
Your proposal is acceptable.
I only provide help via the forum - please do not contact me for private consultancy.

GoForSmoke

Well there does come a time in all Basic code where you just have to say NOP to GOTO's.
No, no, no! No new GOTO's!
In fact, make GOTO cuts! Cut-cut-cut!
Sign the NOR-logic pledge and join the NOP party today!

And yeah, I'm playing at something extreme here. can ya guess what?

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Docedison

--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

0AlphaOmega

*fetches beer*
*pulls us a chair*
*throws a few GOTOs into the melee, sits back and watches the show"
]:D ]:D ]:D
For whom does the clock pulse? It pulses for you!

Chaul

I've encountered a few variations of Basic starting from mid 80's. All of them felt somehow broken and I've had to learn to work around the most serious issues.

Most recently I worked with VB6. In VB6 there is no way of resizing a dynamic array back to zero elements other than dedicating a separate unassigned array type for that purpose. If you did ReDim a(0), you'd get an array with a single element, not an empty one. Of course, ReDimming to -1 does not work either.

You can't really test does an array have zero elements either because there are only functions for finding the first and last index in the array. So, you need to write a function of your own with exception handling that would catch the case where the array has not been added any values to. That way, it'll return 0.

Localization has always provided plenty of error cases. For some reason, if you take code from one system to another, it fails, because in the other system, the  decimal separator is different. String to double conversion throws an exception, funny that. At least in DotNet, you could at least make the conversions culture invariant.

It kinda supports object oriented programming, but you need to have each class in a separate file and they come with some limitations.

And I still have not found a way to "continue" a loop, so in that case, I'm forced to use a GOTO in order to skip the rest of the loop and continue with the next iteration.

For scripting, it's almost usable, and easy to debug, but I can't imagine myself writing an application in Basic. Then there are plenty of other options for scripting that easier to work with in my opinion. I haven't really been coding in any form of Basic for almost 2 years, good riddance.

dhenry

Quote
good riddance.


No language (or any tool, for that matter) can do everything effectively and efficiently to everyone's satisfaction - that's why we have so many different langues / tools.

Judging a language's "inferiority" on its inability to perform a task is futile.

GoForSmoke

What's faster to cut logs with?

A flint ax?
A hatchet?
A bow saw?
A buzzsaw?

Would there be a task that I'd rather use a flint ax for that none of the others isn't better for?
Be a museum piece?

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Chaul


No language (or any tool, for that matter) can do everything effectively and efficiently to everyone's satisfaction - that's why we have so many different langues / tools.

Judging a language's "inferiority" on its inability to perform a task is futile.

That was meant as a personal remark as in I'm happy not to be coding in this language any more. You are right, most modern languages have their place even if they had some peculiar perks that look weird if you moved from another language. One has to learn to pick the right tool for the task at hand. It's just that we didn't have much of choice in the product back then, so I grew frustrated when I learned the tool wasn't really fitting the tasks and as a result I got bugs to fix.

VB String class apparently handles character data in 64K blocks and this can result in exponential growth in execution time if you go over the bound. You can work around this too but for handling of very large text files, VB is not good at all.

Another thing that can bother a C coder. Basic interpreter evaluates all the conditions in a clause while C quits evaluating if the following conditions couldn't change the result.

I still think the language, at least VB6, is more or less broken, call that a judgement or not. However, Microsoft has later added operators like OrElse and AndAlso into later VB versions to cover the conditional operator topic. I'm sure VB as language has progressed in other topics too. I'm not this familiar with non-VB Basic interpreters.

0AlphaOmega

What's better for understanding the development of humans?

A flint ax?
A hatchet?
A bow saw?
A buzzsaw?

Would there be a task that I'd rather use a buzzsaw for that none of the others would be better for?
Making a chainsaw massacre movie. All arguments can be inverted.

Quote
No language (or any tool, for that matter) can do everything effectively and efficiently to everyone's satisfaction - that's why we have so many different langues / tools.

Indeed, and how many offerings of C do we have?
No language is written to create bad code! The goto was put there for good reason, and that was not to provide a method for making spaghetti. Just as it was in C!
Our understanding of what is considered to be good code has developed over time.
IMO it isn't the job of a language to impose structure, the language should be open and flexible. Maybe that is why I like assembler so much, the quality of the finished code is purely down to me. It's more than writing code, it's competition, a game, a challenge that I enjoy.
And as I said below, anyone can write "bad" or sloppy code, even, yes even on the Arduino, just take a look though these annals.
One has to separate the vagrancies of the workman from his tools before casting judgement from on high.
For whom does the clock pulse? It pulses for you!

dhenry

Quote
One has to separate the vagrancies of the workman from his tools before casting judgement from on high.


Right on. As they say, only incompetent carpenters blame their tools.

Go Up