Click here to Skip to main content
15,900,254 members
Home / Discussions / C#
   

C#

 
AnswerRe: How this below code works Pin
Richard MacCutchan11-Jan-10 12:52
mveRichard MacCutchan11-Jan-10 12:52 
GeneralRe: How this below code works Pin
indian14311-Jan-10 13:40
indian14311-Jan-10 13:40 
GeneralRe: How this below code works Pin
DaveyM6911-Jan-10 14:11
professionalDaveyM6911-Jan-10 14:11 
GeneralRe: How this below code works Pin
indian14311-Jan-10 14:27
indian14311-Jan-10 14:27 
QuestionBoolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 10:14
aespielberg11-Jan-10 10:14 
AnswerRe: Boolean value changes without being modified, don't know why. Pin
Luc Pattyn11-Jan-10 10:56
sitebuilderLuc Pattyn11-Jan-10 10:56 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 11:08
aespielberg11-Jan-10 11:08 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
Luc Pattyn11-Jan-10 11:24
sitebuilderLuc Pattyn11-Jan-10 11:24 
Aha.

1.
My debugging rule #1 is: when something goes wrong, it either is your fault (very likely for a novice, quite likely for an experienced programmer) or it is not (rather unlikely, as most bugs get discovered and reported by the thousands of other users and some/most of them get fixed before you would encounter them).

Now if it's your fault, then it could well be one or several of your assumptions is wrong. So don't assume a thing, check all of it. Step through your code and watch; or add logging statements and watch.

2.
having more than one thread (or a timer, or an asynchronous handler) may result in the same method being executed more than once at the same time; when that method operates on the same object, or on static data, it would confuse the person debugging it.

3.
Yes, in order to pinpoint anything, I would need to see more code. Maybe this:
- the declaration of the relevant variables, within their scope (method? class?)
- the method and class the snippet is part of.
- all the callers to the method behaving badly.

4.
How can your code be to large to publish? Did you type tens or hundreds of lines, and then discovered nothing really worked? Then start developing in an incremental way: create something small, observe it, and change it until what you have works the way it should; only then start expanding it a little. Repeat this process until done. Do not a big thing and then observe its failure, since by then you will have several bugs and their combination will significantly increase your debugging problems.

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.


GeneralRe: Boolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 11:41
aespielberg11-Jan-10 11:41 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
Luc Pattyn11-Jan-10 12:06
sitebuilderLuc Pattyn11-Jan-10 12:06 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 12:23
aespielberg11-Jan-10 12:23 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
Luc Pattyn11-Jan-10 13:08
sitebuilderLuc Pattyn11-Jan-10 13:08 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 13:24
aespielberg11-Jan-10 13:24 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
aespielberg11-Jan-10 13:34
aespielberg11-Jan-10 13:34 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
Luc Pattyn11-Jan-10 13:50
sitebuilderLuc Pattyn11-Jan-10 13:50 
GeneralRe: Boolean value changes without being modified, don't know why. Pin
Daniel Grunwald12-Jan-10 6:20
Daniel Grunwald12-Jan-10 6:20 
QuestionHow do I set the "Apply onto" option in NTFS file security rights using c#? Pin
arnold_w11-Jan-10 9:12
arnold_w11-Jan-10 9:12 
AnswerRe: How do I set the "Apply onto" option in NTFS file security rights using c#? [modified] Pin
arnold_w12-Jan-10 2:52
arnold_w12-Jan-10 2:52 
GeneralRe: How do I set the "Apply onto" option in NTFS file security rights using c#? Pin
batrado_®8-Feb-10 1:42
batrado_®8-Feb-10 1:42 
QuestionSend video capture over LAN Pin
shutupsquare11-Jan-10 8:58
shutupsquare11-Jan-10 8:58 
AnswerRe: Send video capture over LAN Pin
Alex Manolescu11-Jan-10 9:49
Alex Manolescu11-Jan-10 9:49 
QuestionFinding * characters in a string Pin
sleepyman11-Jan-10 8:52
sleepyman11-Jan-10 8:52 
AnswerRe: Finding * characters in a string Pin
Alex Manolescu11-Jan-10 9:31
Alex Manolescu11-Jan-10 9:31 
GeneralRe: Finding * characters in a string Pin
PIEBALDconsult11-Jan-10 14:54
mvePIEBALDconsult11-Jan-10 14:54 
AnswerRe: Finding * characters in a string Pin
Luc Pattyn11-Jan-10 9:48
sitebuilderLuc Pattyn11-Jan-10 9:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.