Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:52 11 Jul 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 : Bug in the code....

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9592
Posted: 06:37am 05 Jan 2025
Copy link to clipboard 
Print this post

How do you think I should fix this one?



Smoke makes things work. When the smoke gets out, it stops!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7858
Posted: 08:40am 05 Jan 2025
Copy link to clipboard 
Print this post

Brilliant!  

If debugging is the practice of removing bugs from code then programming must be the practice of inserting them. (I read that somewhere)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 04:45pm 05 Jan 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  If debugging is the practice of removing bugs from code then programming must be the practice of inserting them. (I read that somewhere)

Dijkstra I think.

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7858
Posted: 05:16pm 05 Jan 2025
Copy link to clipboard 
Print this post

Very possible - it sounds like one of his. :)


Edit:
Just looked it up, and yes, it was. :)
.
Edited 2025-01-06 03:18 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9592
Posted: 05:32am 06 Jan 2025
Copy link to clipboard 
Print this post

I DO remember this as being quite accurate when using line-numbers for programming.
Back in the days of Atari BASIC, I could not see PAST line-numbers for programming.

Now, with structured programming and indented loops/subs etc, I can't see HOW to do some stuff now WITH line-numbers!      

It is a BEAUTIFUL thing(structured code), compared to line-numbers.

But then, line-numbers are EXCELLENT as a learning curve or device if you are new to programming, but having said that, I would - these days - recommend newbies ONLY start out with structured programming languages.
Smoke makes things work. When the smoke gets out, it stops!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7858
Posted: 08:06am 06 Jan 2025
Copy link to clipboard 
Print this post

I cut my teeth on Z80 machine code (not an assembler, there was no room for one) so addresses were the norm. When I got my first TINY BASIC I *expected* line numbers as otherwise it would have been impossible to program, wouldn't it? They are BASIC's instruction addresses.

I did the usual blundering around with line numbers until I eventually got "BASIC Faster And Better" from Tandy. That opened my eyes as to how line numbers *should* be used. They indicate lines, sentences, paragraphs, sections and whole regions of code. RENUMBER is the very worst thing you can do to a program. It totally destroys all meaning.

Line numbers can work well, but getting rid of them completely is so much better. :) Whether keeping beginners away from them altogether is the right thing to do I'm not absolutely sure. They introduce the concept of instruction addresses, the "doing things in a fixed sequence" pattern. I think that might be important at first as it ties in with flow charts, which are definitely not dead even if they now usually refer to program blocks rather than individual instructions.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 08:16am 06 Jan 2025
Copy link to clipboard 
Print this post

I think line numbers had much more of a place when computers had no screens, no screen editors (duh) and so on i.e. were so limited.

Now you can see large parts of programs and edit by moving a cursor, may even have/like "folding" editors and so on.

The original BASIC had to fit in a tiny memory with no such facilities so adopted the compromises of line numbers, pathetic variable names, etc.

That's no reason to keep let alone teach (*) those limitations!

(*) unless to computer science students (& lecturers) so they "get" why BASIC got its reputation

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7858
Posted: 09:01am 06 Jan 2025
Copy link to clipboard 
Print this post

It depends on what you are teaching, I suppose. Is making programs on an Arduino "programming" when most of it is calling standard library routines? If no-one learns that a microprocessor is actually extremely dumb and only really does one thing at once like

01  test a bit
02  jump to an address if it's zero
03  test a different bit
04  jump to address 03 if it's zero

then who is going to write the assemblers and compilers? Who will be able to build the libraries?

BASIC was originally written for Beginners as an introduction to how programming works. It was never intended to be a language for writing serious software in. As such it's perfect for demonstrating how low level programming works. This is not a "limitation" of BASIC, it's why it was designed in the way that it was.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9592
Posted: 04:59am 07 Jan 2025
Copy link to clipboard 
Print this post

Well, indeed.  

BEGINNERS all-purpose symbolic instruction code.....
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025