![]() |
Forum Index : Microcontroller and PC projects : Bug in the code....
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9592 |
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 KingdomPosts: 7858 |
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 KingdomPosts: 4038 |
Dijkstra I think. John |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7858 |
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 ZealandPosts: 9592 |
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 KingdomPosts: 7858 |
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 KingdomPosts: 4038 |
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 KingdomPosts: 7858 |
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 ZealandPosts: 9592 |
Well, indeed. ![]() BEGINNERS all-purpose symbolic instruction code..... Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |