|
It's not "spaghetti code", it's "Flow Diagram code". An easy 1:1 direct conversion.
As long as the customer continues to use a Flow (aka State) Diagram as the documentation, then it's Knex spaghetti for the win!
Naming the `goto` junction points is hard, but then naming is hard anyway. Customer is likely to adopt your naming anyway if they haven't already named things (states) .
|
|
|
|
|
I'm inclined to agree with this.
That said, I still feel spaghetti applies in as much as the code jumps around, and sometimes fires off one thing, which causes another thing, which makes the final result. It's hard to follow without a diagram.
To err is human. Fortune favors the monsters.
|
|
|
|
|
It's a 'source of truth' problem. A well labelled complete flow diagram pre-defines the structure.
Meanwhile a rambling weasel word requirements document is, well, rarely complete, even conceptually. So,
for A very comprehensive and precise spec | CommitStrip[^] ...
|
|
|
|
|
While I have written, or tried to write, well-structured code for over 45 years, there was a time when I had no choice. I was dealing with making changes to the mainframe operating system, a beast in which the non-resident portions were in pages of 384 memory words in length. This was in the days when a 64K machine was considered fairly large.
Not only was it spaghetti code, one of the standard tricks was to overwrite the memory used by the housekeeping and initialization code in order to use it as storage. After all, if that code was only ever executed once, then after it ran it was simply occupying space for no good reason. This, of course, was all done in assembler, and predated the use of read-only memory, so writing self-modifying code was not only de rigueur, it was a talent you had to learn and be good at. Little of that code ever got well commented, but that was the way we rocked.
|
|
|
|
|
We called that overlay programming. You planned your design to allow for the orderly reuse of memory. One could have a program that used 5x the memory you had available. It wasn't like virtual memory where the hardware made all of that transparent, but it accomplished the same basic job except you were in control of when and what overlays were called into memory. The main or parent program was always in memory.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I am guessing you were stuck in C?
I would have expected you to go with one of your generated state machines if you could use C++.
|
|
|
|
|
No, but generated code wouldn't have really helped me here. This flow is too irregular.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Wordle 697 4/6
β¬β¬π©π©β¬
β¬β¬π©π©β¬
β¬π©π©π©β¬
π©π©π©π©π©
|
|
|
|
|
Wordle 697 3/6
β¬π©π©β¬β¬
π©π©π©β¬π¨
π©π©π©π©π©
|
|
|
|
|
Wordle 697 4/6
π¨β¬β¬β¬β¬
β¬π¨β¬β¬π¨
π©π©π©π©β¬
π©π©π©π©π©
|
|
|
|
|
Wordle 697 4/6
β¬β¬β¬β¬β¬
β¬β¬β¬π¨β¬
π¨β¬β¬π¨β¬
π©π©π©π©π©
|
|
|
|
|
Wordle 697 3/6*
π¨β¬β¬β¬β¬
π©π©π©π©β¬
π©π©π©π©π©
#2 was a lucky guess!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
β¬β¬π©π©β¬
β¬β¬π©π©β¬
β¬β¬π©π©β¬
β¬π©π©π©π©
β¬π©π©π©π©
π©π©π©π©π©
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 697 4/6
β¬β¬β¬π©β¬
β¬β¬β¬β¬β¬
π©π©π©π©β¬
π©π©π©π©π©
Lucky third guess!
|
|
|
|
|
Wordle 697 4/6*
β¬β¬π©β¬β¬
β¬β¬π©β¬π¨
β¬π©π©β¬π©
π©π©π©π©π©
Happiness will never come to those who fail to appreciate what they already have. -Anon
|
|
|
|
|
Wordle 697 2/6*
β¬β¬β¬π¨π©
π©π©π©π©π©
|
|
|
|
|
Wordle 697 4/6
π¨π©β¬π©β¬
β¬π©π©π©β¬
β¬π©π©π©β¬
π©π©π©π©π©
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 697 2/6
β¬π©β¬π©β¬
π©π©π©π©π©
Jeremy Falcon
|
|
|
|
|
Wordle 697 5/6
β¬π¨β¬π¨β¬
π¨β¬π©β¬β¬
β¬π©π©β¬π¨
π©π©π©π©β¬
π©π©π©π©π©
hard one
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
#Worldle #480 2/6 (100%)
π©π©β¬β¬β¬β‘οΈ
π©π©π©π©π©π
https://worldle.teuteuf.fr
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I was tracking down the weirdest bug in a circuit I'm building. It was waking up my little MCU seemingly randomly and I couldn't figure it out. It was supposed to wake on button press.
After awhile I realized it would wake up every time I moved, which was weird.
I forgot a pulldown resistor on my button's output line! I was changing the ambient electrical properties of the environment around the wire whenever I moved, which was kind of cool.
It's due to the fact that there's a touch sensor attached to the MCU's input pin I was using for the button. That's fine, but you need a pulldown resistor!
I guess I could use this "bug" to make a digital theramin.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Woooo-oooo-wah!
Do you recognize that tune? I don't. Theremins must be one of the hardest musical instruments to play.
- I would love to change the world, but they wonβt give me the source code.
|
|
|
|
|
The theme music from the original The Day The Earth Stood Still, composed by John Herrmann, included a theremin.
Software Zen: delete this;
|
|
|
|
|
|
Only if she documents it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|