|
2000 goto's will suffice for this month, please stop it (that may take another goto, break would not work in your loop).
|
|
|
|
|
I don't think that I have used a GOTO since 8 bit Atari BASIC in the mid '80s.
I think that a goto would be acceptable if it would clearly make the code simpler and easier to read. However, if you really has such a complex structure that a goto would actually improve the code, it should probably be completely rewritten instead.
Another sitaution where a goto might be acceptable is for performance reasons. However, it's not very often that a goto would actually improve performance much.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
When programming in assembly or a related language that lacks higher level control constructs.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
when they are called branch or jump, it is an entirely different matter.
|
|
|
|
|
I was thinking that myself earlier - I don't use assembly at all on the PC, but I use it exclusively for PIC programming where goto and/or bra (and their variants bnz etc) depending on the family I'm using are invaluble. I'm sure alot of our lovely gotoless code ends up being assembled down to jump instructions.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I especially like the "skip next instruction if..." kind of instructions, such as BTFSS on PIC 16F84.
They may well flabbergast these high-level programmers that frown on a simple goto...
|
|
|
|
|
I've recently moved from the 16F to 18F series and in the last couple of weeks because of peripheral requirements the dsPIC30F series. You should have a look at the number of variations that are available for those instruction types (the PIC I'm currently using[^] - secion 18-2). Most of these are 2 cycles (8 clocks) including the branch, the non branching instructions are mostly 1 cycle. Running at 30MIPS some code can perform (almost) as well as a PC running at supposedly several GHz because of the inefficient code and wasted clock cycles.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
You should use goto whenever you need it (this is a rather subtle point).
The problem is that unexperienced programmers (aka 'Senior Developers') will misuse it. That's the reason for the draconian sentences against the poor goto statement.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
IMHO, Goto is only acceptable during the next Ice Age and every 3rd Ice Age thereafter.
Seriously, I haven't used one in over 8 years, and don't plan on doing so anytime soon. If your app, data model, algorithm, ..., is designed correctly, you shouldn't need one.
Dewald wrote: Could anyone give me examples of where you would be willing to use the goto statement?
Have you ever seen the little window stickers of the kid peeing on some company logo?? Put the Goto in place of the logo...
|
|
|
|
|
Dave Kreskowiak wrote: Have you ever seen the little window stickers of the kid peeing on some company logo?? Put the Goto in place of the logo...
Ok, that is definitely an acceptable use of goto.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi
I've a DLL that basically refers 2 another .Net DLLs, with the given situation is it possible for us to create only one TLB file using (TLBEXP.EXE) with all dependencies?
Thanks in advance ...
|
|
|
|
|
Are you asking if it's possible to get all three .DLL's in the same TLB? No, it's not. AT least, I've never heard of a tool that will do this.
|
|
|
|
|
Thanks for your reply.
So what is the option to build one CCW setup that should actually expose all DLLs?
|
|
|
|
|
Why do you have to have one?
AFAIK, there isn't an option.
|
|
|
|
|
OK, i think if i explain my situation you can suggest me.
I've an application (.Net C#) and i want to give an interface to COM based users, for this i need to ship all APIs (like say i've 10 DLLs). I just dont want to build 10 different TLB file and register them separately at client machines.
Want to build one wrapper class that will expose all other DLLs, this is what i want to achieve. How can i get it done?
Thanks in advance.
|
|
|
|
|
satsumatable wrote: Want to build one wrapper class that will expose all other DLLs
You just said it, right there. Build a COM-based wrapper class. All those .DLL's are still going to have to be registered though...
|
|
|
|
|
how to arrange images on canvas to form collage with each image different angle and important part of image should be visible and no blank space
|
|
|
|
|
Use Paint Shop Pro, make the collage as a bitmap and set this as the background of the form?
I are troll
|
|
|
|
|
how to select salient part of image ,salient means important part for which we taken out photograph, no matter what is background ,floor,sky...
|
|
|
|
|
There are no standard-functions to do this in .NET that I'm aware of, I'm afraid you'll have to roll your own.
You're baking a photographers-paintprogram?
I are troll
|
|
|
|
|
actualy we r making image collage project which will show salient part of images and so is there any way by using intensity,saturation,hue of pixels we able extract that part
|
|
|
|
|
This class can serve as an example on manipulating colors. Or, you can take a look at MSDN, and take a look at the GetSaturation method of the Color-class.
You got a though project on your hands there.. If I understand you correctly, you'll have to iterate through all the pixels, and judge them based on hue/intensity/color/something?
I are troll
|
|
|
|
|
Yes,now we r just considering pixels intensity factor,but problem with that is time required for two for loop quit large for getpixel(),setpixel() fun so is there other method so that we can increase speed of execution?
|
|
|
|
|
Have you considered Parallel.For? Personally I prefer the AForge version, as it only requires .NET 2.0. It's quite an improvement in execution-time if you got a dual-core (or better) processor
Just noticed that the author is also doing a lot of image-manipulation.
I are troll
|
|
|
|
|
Thanks, we will implement it
|
|
|
|