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, embarrasing 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.
|
|
 |

|
Just came across the following in some code I maintain:
foreach (Object item in group)
{
int i = 1;
string key = "SomeString_" + i.ToString();
}
I suspect the idea was to use i to help make the dictionary keys unique.
|
|
|
|

|
try
{
account.Save();
}
catch { ; }
|
|
|
|

|
At least there are comments.
|
|
|
|

|
I can think of a few comments myself...
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|

|
Guess programmer was hungry thats why he "ate" the exception
Always Keep Smiling.
Yours Pankaj Nikam
|
|
|
|

|
Relax.
This is just sweeping under the rug.
It could be worse.
Mislim, dakle jeo sam.
|
|
|
|

|
I'm impressed they wasted the energy on a surplus semicolon.
Software Zen: delete this;
|
|
|
|

|
They might have a style rule that enforces: "catch block cannot be empty" Warning: Empty catch block. ftfy: ";"
|
|
|
|

|
... which just demonstrates how misleading style enforcement can be.
Software Zen: delete this;
|
|
|
|

|
What kills me is the comment. It would have taken the same effort to say Logger.Log(ex);
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin