Click here to Skip to main content
15,894,291 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: top this Pin
bleedingfingers4-Aug-10 21:41
bleedingfingers4-Aug-10 21:41 
GeneralRe: top this Pin
devvvy5-Aug-10 15:57
devvvy5-Aug-10 15:57 
GeneralRe: top this Pin
sameerazazi877-Aug-10 1:21
sameerazazi877-Aug-10 1:21 
GeneralRe: top this Pin
Bigdeak12-Aug-10 21:40
Bigdeak12-Aug-10 21:40 
GeneralHow to read a file completely? PinPopular
Bernhard Hiller29-Jul-10 2:22
Bernhard Hiller29-Jul-10 2:22 
GeneralRe: How to read a file completely? Pin
Single Step Debugger29-Jul-10 3:35
Single Step Debugger29-Jul-10 3:35 
GeneralRe: How to read a file completely? Pin
Phil Martin29-Jul-10 13:15
professionalPhil Martin29-Jul-10 13:15 
GeneralRe: How to read a file completely? Pin
David Skelly29-Jul-10 22:34
David Skelly29-Jul-10 22:34 
I'm not really a .NET programmer, so I might be missing something here. I would expect this to break out of the do-while loop after the exception has been logged. So, if it breaks out of the infinite loop after writing to the log, why would it fill the log file? And surely it will only write to the log file if Trace is enabled? So in a production environment I wouldn't expect it to write anything at all.

I'm not defending using infinite loops to process something that isn't endless like this, I think it's bad practice, but I don't understand why this would just keep writing error messages endlessly to the System Trace log, which is what the poster seems to suggest.

As I said, I'm not a C# programmer really, so maybe there's something going on here I'm not aware of.
GeneralRe: How to read a file completely? Pin
Luc Pattyn30-Jul-10 0:02
sitebuilderLuc Pattyn30-Jul-10 0:02 
GeneralRe: How to read a file completely? Pin
David Skelly30-Jul-10 2:29
David Skelly30-Jul-10 2:29 
GeneralRe: How to read a file completely? Pin
Luc Pattyn30-Jul-10 2:53
sitebuilderLuc Pattyn30-Jul-10 2:53 
GeneralRe: How to read a file completely? Pin
David Skelly30-Jul-10 4:18
David Skelly30-Jul-10 4:18 
GeneralRe: How to read a file completely? Pin
PIEBALDconsult30-Jul-10 6:21
mvePIEBALDconsult30-Jul-10 6:21 
GeneralRe: How to read a file completely? Pin
Luc Pattyn30-Jul-10 6:26
sitebuilderLuc Pattyn30-Jul-10 6:26 
GeneralRe: How to read a file completely? Pin
MalikRizwan22-Sep-10 0:09
MalikRizwan22-Sep-10 0:09 
GeneralRe: How to read a file completely? Pin
Luc Pattyn22-Sep-10 2:02
sitebuilderLuc Pattyn22-Sep-10 2:02 
GeneralRe: How to read a file completely? Pin
MalikRizwan22-Sep-10 19:27
MalikRizwan22-Sep-10 19:27 
GeneralRe: How to read a file completely? Pin
Luc Pattyn22-Sep-10 19:39
sitebuilderLuc Pattyn22-Sep-10 19:39 
GeneralRe: How to read a file completely? Pin
Bernhard Hiller1-Aug-10 20:02
Bernhard Hiller1-Aug-10 20:02 
GeneralRe: How to read a file completely? Pin
itsravie3-Aug-10 0:33
itsravie3-Aug-10 0:33 
AnswerRe: How to read a file completely? Depends on how you read the file. Pin
Dwayne J. Baldwin3-Aug-10 20:38
Dwayne J. Baldwin3-Aug-10 20:38 
GeneralRe: How to read a file completely? Pin
Machaira4-Aug-10 2:24
Machaira4-Aug-10 2:24 
GeneralBored of if..else? PinPopular
Dan_Martin28-Jul-10 22:45
Dan_Martin28-Jul-10 22:45 
GeneralRe: Bored of if..else? Pin
Keith Barrow29-Jul-10 2:57
professionalKeith Barrow29-Jul-10 2:57 
GeneralRe: Bored of if..else? PinPopular
Jeroen De Dauw29-Jul-10 3:09
Jeroen De Dauw29-Jul-10 3:09 

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.