|
No, they went out on a strike.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
"Suckehihaw" is from the Osage North American First People's language: it refers to a noxious pest weed that grows aggressively by creeping, and climbing, and can even form thick mats which are difficult to walk over without tripping. It can be used to poison fish, and is known as "devil's shoestrings."
You wanna see some code like that: goto QA
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Leave GOTO alone! If we have to forget everything just because some nitwit could misuse it, then we are all out of our jobs.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
You can use GOTO - but you shouldn't be allowed to for at least five years from the end of your course. By then you know when you should (and more importantly shouldn't) use it. And probably won't, because generally you don't need it ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: generally you don't need it
You have not written any code on an 8 bit processor or a microcontroller for a while? By avoiding anything that resembles calling a subroutine you can save a lot of your precious little memory and also save some execution time because you don't have to run up and down the stack at every corner. Plus saving and restoring the contents of any processor registers you might change in your subroutine. If you religiously stick to other wise words, like keeping your functions short and calling them a lot, suddently half or more of your memory is excusively dedicated to working on the stack.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
JMP in assembler isn't the same as GOTO in a high level language - and you know it!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Really? Compilers seem to think that it is the same. Insert a GOTO into the code and behold what the compiler makes out of it:
xdbrnf: goto xdbrnf;
11C774EF nop
11C774F0 jmp 11C774EE
The nop probably is needed to prevent knots in the caches.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Machine languages generally don't have all the loops and higher level controls. All they have is JMP, which is the heart of all program flow control that doesn't involve calling subroutines. Therefore, JMP is not the equivalent of GOTO but it is the basis for GOTO, IF, WHILE, LOOP, etc.
|
|
|
|
|
GOTO is unconditional. JMP is unconditional. There is only one unconditional branching instruction, more would not make much sense. Eell, I do know a processor with two unconditional branching instruction, but that's another story. On that processor I could actually perform an unconditional branch without using any of these instructions. Anyway, the compiler really does not have much choice how to implement a GOTO. It always comes down to this one instruction, so how much more equivalent do you want it?
Loops, IF and all that stuff are based on conditional branches, quite a selection of branching instructions. They all work the same way, but branch only if a specific condition is met. These instructions are not equivalent. A loop obviously does a little more than just branch somewhere.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
CodeWraith wrote: GOTO is unconditional. JMP is unconditional. There is only one unconditional branching instruction, more would not make much sense.
As I recall, the PDP-11 instruction set (which I used to write drivers for lab systems in the dim and distant past) had two unconditional jump instructions. One was a single byte instruction with a single byte target, and could consequently only be used for very local branches, but executed very fast. The other (LNGJMP) had a two-byte target, so it could branch anywhere within the processor's address space, but executed more slowly.
|
|
|
|
|
Exactly as in my old CDP1802 processor. The short branch had only an 8 bit address which changed only the lower half of the program counter. By having to fetch a byte less, it only needed two bus cycles to execute. The long branch instruction loaded the full 16 bit address and was one of the few instructions that needed three bus cycles.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Indeed
"We can't stop here - this is bat country" - Hunter S Thompson - RIP
|
|
|
|
|
I just inserted a GOTO into the code I'm working on and took a look at the disassembly. Guess what assembly instruction a GOTO comes down to... And now please tell me where the grand differences between your JMP and my JMP magically come from.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Would you code in IL, if you could do it and produce the same app in C#?
Of course not: it would take you far longer and produce something that is a lot less maintainable (and as a Assembler / C / C++ / C# programmer for many, many years I know this well!)
IL (and assembler) have JMP operations because that is all they have: they can't use for, foreach, or do ... while loops because the "machine code" doesn't support them - it operates on one machine instruction at a time (massive simplification) and doesn't "look ahead" to see what "loop constructs" are in use.
You know this ... or is the lack of Soapbox bringing a little light trolling to the lounge?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: You know this ... or is the lack of Soapbox bringing a little light trolling to the lounge? How often did you see me trolling in the soapbox? I may be chaotic and evil, but it hurts that you think that of me.
OriginalGriff wrote: Would you code in IL, if you could do it and produce the same app in C#? Forfeit both the direct control over the resulting machine code and the syntactic sugar of the high level language? Why should anyone do that?
OriginalGriff wrote: Of course not: it would take you far longer and produce something that is a lot less maintainable (and as a Assembler / C / C++ / C# programmer for many, many years I know this well!) The keys to rapid development and maintainability don't lie, by my experience, not in any language or paradigm.
OriginalGriff wrote: IL (and assembler) have JMP operations because that is all they have: they can't use for, foreach, or do ... while loops because the "machine code" doesn't support them - it operates on one machine instruction at a time (massive simplification) and doesn't "look ahead" to see what "loop constructs" are in use. Very massive simplification. Since when do we have caches and pipelines in the CPU, along with more or less sophisticated branch prediction? Must have been the good old '286 and things really got in motion with the 386.
The fancy loops are just syntactic sugar and boil down to a handful assembly instructions, so what? The behavior on all levels remains the same, otherwise the whole IL and JIT compiler stuff would not be very useful. An assembly macro could do the same. Besides that, why should a compiler be concerned with branch prediction besides generating code that avoids cache misses and pipeline penalties? That should only be a concern of the JIT compiler, not of the high level language or IL.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
That perfectly describes al lof the code I wrote 10 years ago or more.
CQ de W5ALT
Walt Fair, Jr.PhD P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Which part? I hope not the nitwit!
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Also known as, "Kevin's code". Right Kev?
|
|
|
|
|
I believe it is derived from the Pre-First-Peoples-Language word "Veebeesix", which, since as we no longer have the Soapbox, cannot to any extent be translated on CP.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No-one in the modern world (thankfully) ever ran into its linguistic ancestor Veebeeone but as far as we can tell, the whole language was based round a simple structure a like this:
do
goto (iif (CoinToss.Result = CoinToss.Heads, "Label1", "Label2"))
while (Hope.SomeRemaining = true)
The ancient Veebeeans were, as we all know, drowned in a particularly large stack overflow.
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|
|
PeejayAdams wrote: The ancient Veebeeans were, as we all know, drowned in a particularly large stackoverflow. There decedents are still there . . .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Hah! I happen to have a copy of VeeBeeOne that was distributed by shamans from the Microsoft tribe a long, long time ago. It took an extraordinary 5 floppies.
Software Zen: delete this;
|
|
|
|
|
Would you like a full set of Microsoft reference books for MFC to go with that?
Crikey! I thought I was the only one who saves stuff that long!
Will Rogers never met me.
|
|
|
|
|
We've been having a lab cleanout the last couple of weeks here at work. I found an unopened, shrink-wrapped copy of MS-DOS 6.22, several copies of OS/2 Warp 3 and 4, and a stack of Windows 2003 Server CD's.
Software Zen: delete this;
|
|
|
|
|
Is this from the same guy who was trying to get TFF going? (TFF = That's F***in Funny)
|
|
|
|