Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:18 29 Oct 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Give me MMBasic instead

     Page 1 of 2    
Author Message
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 02:44pm 23 Sep 2025
Copy link to clipboard 
Print this post

"Let's use := instead of = and a semicolon to terminate each line so that we don't have to admit that it's BASIC"  



 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10533
Posted: 04:38pm 23 Sep 2025
Copy link to clipboard 
Print this post

Having a line termination character like ; allows a statement to be split across multiple lines
Basic = confuses assignment and equivalence. If you read := as "becomes equal to" then = is just the equivalence logical operator.
Personally, I like both but then my first language was Pascal
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 05:32pm 23 Sep 2025
Copy link to clipboard 
Print this post

Yeah but that stuff can be as much a PITA as Python's indentation.
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 575
Posted: 05:45pm 23 Sep 2025
Copy link to clipboard 
Print this post

I suspect it was easer to process that variable assignment with :=. Basic didn't need it, because it had the LET command. Then as people become more familiar with programming, they realised that the LET was not required.

My biggest problem with ':=' is that in my day job I use ':=' (C#) and then when I go to program my CMM2 - I keep typing ':=' instead of '=' (and || for OR etc.).

But here's the weird thing about that - I like the fact that it makes me change, because it all helps bring me back to my BASIC programming nostalgia - and reminds me that I am not, in fact, doing work.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 06:25pm 23 Sep 2025
Copy link to clipboard 
Print this post

But that is why BASIC is smarter because it understands the context.

I use a Basic compiler that isn't much more than a translator to asm.

Write the code in C or Basic, no matter, the generated asm is identical.

So why bother with gobbledygook?
 
Andy-g0poy
Regular Member

Joined: 07/03/2023
Location: United Kingdom
Posts: 81
Posted: 07:19pm 23 Sep 2025
Copy link to clipboard 
Print this post

  PhenixRising said  But that is why BASIC is smarter because it understands the context.

I use a Basic compiler that isn't much more than a translator to asm.

Write the code in C or Basic, no matter, the generated asm is identical.

So why bother with gobbledygook?


Exactly, all you doing is the work that the compiler writer should have done.
everyone knows when you have a comparison or assignment.

In all the years that I have been programming (mainly old assembler stuff) there was never any issue between the two in whatever language was used. It was defined by the operation.

Also

Move1Pos : DINT 3000000 ;

Type of syntax seems very clumsy. There is no need for the : between the variable name and the type, the space delimits the two, I don't know anything about this language but I'm a bit suspicious of the : (maybe the ; as well) It looks as if it is looking for {space}:{space} or {space};  


i.e.
would this confuse it?

Move1Pos : DINT 3000000 ;
foobar   : DINT 3000000 ;
boojum : DINT 3000000   ;

If so it's just as bad as the Python indent madness and the programmer is being made to do the work that the compiler writer should have done.


Andy
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 575
Posted: 07:21pm 23 Sep 2025
Copy link to clipboard 
Print this post

I would guess it's all a throwback because C more closely mimics the operation/antics of assembly code, and if you want to assign a variable value in the middle of a comparison, you absolutely can. Should you? Probably not. And I imagine most modern compilers would stop you. But going back to the days of 100 bytes programs - these sort of tricks were probably relevant.

But I do agree - it's not relevant in modern languages.

It used to be that languages had specialised functions (like Fortran's 64-bit Integer), but I think all modern languages support those now (though I do seem to recall Fortran having Complex numbers as well).  I suspect any non-Object Oriented language can probably be directly translated into any other language (and any Object Oriented language can be translated into any other Object Oriented language).

But wouldn't it be a dull world if we only had one programming language to rule them all. It seems that people have claimed as much in the past (Java - I'm looking directly at you) - yet here I am still faffing around with C and C++.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4100
Posted: 08:10pm 23 Sep 2025
Copy link to clipboard 
Print this post

In such as
Move1Pos : DINT := 3000000 ;

it looks like the spaces are optional and put in by a human who preferred them.

I can't see anything wrong or odd about that.

John
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 08:16pm 23 Sep 2025
Copy link to clipboard 
Print this post

At least in my industrial world, MMBasic needs to be the standard...Period

We can stomp all over the garbage that's out there.

It's a perfect example of The Emperor's New Clothes and I'm the kid who is calling BS on all those who comply like little wimps  
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 08:20pm 23 Sep 2025
Copy link to clipboard 
Print this post

  JohnS said  In such as
Move1Pos : DINT := 3000000 ;

it looks like the spaces are optional and put in by a human who preferred them.

I can't see anything wrong or odd about that.

John


Move1Pos = 3000000

Job done. Why the BS?
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4100
Posted: 08:53pm 23 Sep 2025
Copy link to clipboard 
Print this post

  PhenixRising said  
  JohnS said  In such as
Move1Pos : DINT := 3000000 ;

it looks like the spaces are optional and put in by a human who preferred them.

I can't see anything wrong or odd about that.

John


Move1Pos = 3000000

Job done. Why the BS?

I expect they want to define its type so it can be checked and/or more efficient code generated.  Neither of those is BS.

Defining type helps avoid programming bugs

MMBasic with OPTION EXPLICIT does that, too, or are you saying that's BS?

John
Edited 2025-09-24 06:55 by JohnS
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 10:42am 24 Sep 2025
Copy link to clipboard 
Print this post

No I like OPTION EXPLICIT due to my lousy typing  

But this is cleaner/more refined:

dim float strt,fini,mcmd,i,a,b,c
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 472
Posted: 11:26am 24 Sep 2025
Copy link to clipboard 
Print this post

  matherp said  Having a line termination character like ; allows a statement to be split across multiple lines


With ANSI Standard BASIC, you usually don't have that problem. ANSI only allows one statement per line. Also, every line has to start with a keyword, which is why LET is mandatory.
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 472
Posted: 11:30am 24 Sep 2025
Copy link to clipboard 
Print this post

  matherp said  Basic = confuses assignment and equivalence. If you read := as "becomes equal to" then = is just the equivalence logical operator.


Some languages use = for assignment and == for equivalence. To me, this is easier since I do a lot more assigning than testing. It saves me much typing.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 516
Posted: 02:13pm 24 Sep 2025
Copy link to clipboard 
Print this post

I also like the = and == to differentiate assignment and equivalence. What I don't like is when a language uses the code format in its syntax, as Python does. Oh boy, why changing my code indentation will affect my code validity?
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5398
Posted: 02:26pm 24 Sep 2025
Copy link to clipboard 
Print this post

  LeoNicolas said  I also like the = and == to differentiate assignment and equivalence. What I don't like is when a language uses the code format in its syntax, as Python does. Oh boy, why changing my code indentation will affect my code validity?


+1

Every language has it's quirks (so has MMBasic). Python indenting feels dangerous. I have seen occasions (i.e. this forum) where formatting gets lost. Python code would not run when pasted in this forum. Line ending characters (";") don't get lost.
PicomiteVGA PETSCII ROBOTS
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 83
Posted: 04:48pm 24 Sep 2025
Copy link to clipboard 
Print this post

"Once upon a time in the very past" there was a programming language called "COMAL" - it was some kind of "Better BASIC"..

German Wiki:
https://de.wikipedia.org/wiki/COMAL

English Wiki:
https://en.wikipedia.org/wiki/COMAL

COMAL used the ':=' as assignment operator to distinguish from '=' for useage in comparison expressions - as pascal does..

The examples shown in the English Wiki are wrong for that!

Heretical question: Why not allow MMBasic to accept both '=' and ':=' for assignments and have a option, which decides, which variant is shown by the 'LIST' command?  

@Peter: Does MMBasic use different tokens for '=' used as assignment operator and '=' used for comparisons? That would make it easy..

Regards, bfwolf
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8232
Posted: 05:08pm 24 Sep 2025
Copy link to clipboard 
Print this post

No, please....
MMBasic is BASIC. No BASIC accepts := as anything other than a syntax error. If people want to program in a language that uses := then they can, but BASIC isn't that language. It isn't C, C#, C++, Python2, Python3, COMAL, COBOL, Lithp or anything elth either...

:)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Andy-g0poy
Regular Member

Joined: 07/03/2023
Location: United Kingdom
Posts: 81
Posted: 05:55pm 24 Sep 2025
Copy link to clipboard 
Print this post

  Volhout said  
Every language has it's quirks (so has MMBasic). Python indenting feels dangerous. I have seen occasions (i.e. this forum) where formatting gets lost. Python code would not run when pasted in this forum. Line ending characters (";") don't get lost.


I find one major problem is when you are working with several different systems and moving code between them. Some editors use different conversions for tabs and usually DO NOT use the actual tab character. Flipping code across systems that use 4 spaces for a tab and others that use 8 etc causes mayhem

Aside from the typing error we all make, I just find the block-identified by indent hard to see on the screen especially if I need to make a major change in the middle of some multiple condition set of statements. TYhigs get out of sequence very fast.

Then there is the other issue in that I like to format my code MY WAY which is of course much better than anything else< not someones elses idea of what is correct :-)

Andy
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2787
Posted: 09:44pm 24 Sep 2025
Copy link to clipboard 
Print this post

  Quote  I just find the block-identified by indent hard to see on the screen especially if I need to make a major change in the middle of some multiple condition set of statements.

MMEdit can help you with that. On the left it links each Sub, Do, For, If with it's correct end point.
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025