473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

what kind of bug?

would you include infinite loops, possibly infinite loops, unaccounted
for user input, infinite recursion, and that type of thing? if so
those are probably my biggest problems...

more specifically, I lose track of my loops and the scope of variables
while in those loops... for example:

for(int i=0;i<10;i++)
{
//code here
i--
//code here
}

in that example I may be using the LCV to try to increase (or
decrease) the amount of time the loop runs depending on how things go
inside the loop, but then I may miss something similar to above, where
it essentially creates an infinite loop...
Jul 22 '05 #1
3 1187
Major_Small wrote:
would you include infinite loops, possibly infinite loops, unaccounted
for user input, infinite recursion, and that type of thing? if so
those are probably my biggest problems...

more specifically, I lose track of my loops and the scope of variables
while in those loops... for example:

for(int i=0;i<10;i++)
{
//code here
i--
//code here
}

in that example I may be using the LCV to try to increase (or
decrease) the amount of time the loop runs depending on how things go
inside the loop, but then I may miss something similar to above, where
it essentially creates an infinite loop...


Are you responding to some other posting? I can't understand your
question, perhaps the context is missing. Next time try to stay in the
same posting thread instead of starting a new one.

If you're not responding to somebody's earlier posting, please be a bit
more clear on what you'd like to know. "What kind of bug?" is not a very
good subject line either.

If you're asking for a general discussion on what bugs are the toughest
to fix, for example, then I'd say, memory bugs. Especially buffer
overruns and using memory that has been freed. The trouble with those
is that the effect is intermittent and often shows up much later than
the cause of it.

V
Jul 22 '05 #2

"Major_Small" <JS*******@gmail.com> wrote in message
news:95**************************@posting.google.c om...
would you include infinite loops, possibly infinite loops, unaccounted
for user input, infinite recursion, and that type of thing? if so
those are probably my biggest problems...

more specifically, I lose track of my loops and the scope of variables
while in those loops... for example:

for(int i=0;i<10;i++)
{
//code here
i--
//code here
}


Don't do that. You are violating the llop invariant and things *will* get
messy very soon. The better solution is to rework your algorithm so you
don't need to modify variables associated with the invariant.

And that is *always* possible and *usually* ends up in much simpler
solutions.
Jul 22 '05 #3
> Are you responding to some other posting? I can't understand your
question, perhaps the context is missing. Next time try to stay in the
same posting thread instead of starting a new one.


yeah, must have clicked a wrong link somewhere... meh...
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
58
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
16
by: Abhishek | last post by:
why do I see that in most C programs, pointers in functions are accepted as: int func(int i,(void *)p) where p is a pointer or an address which is passed from the place where it is called. what...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
28
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.