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

|
The fastest code to execute is code that doesn't exist.
|
|
|
|

|
A sample of the code I'm working on now:
TimeZone = If(item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value <> "", item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value, "")
In short, set the result to the value when the value is not an empty string; otherwise, set the result to an empty string.
|
|
|
|
|
|

|
Something similar I catch myself almost writing is along the lines of:
if ( x <> y ) x = y
|
|
|
|

|
Are you by chance working in a funny language where !(a<>b) does not mean b can be used instead of a in all contexts?
Let's say you have a language where null == "" (for simplicity, you know?) Then you have an API that does not follow that convention and throws on a null.
|
|
|
|

|
Few weeks ago i decided to create an application to make my work easier as we used to execute different scripts to complete our tasks, other than using different applications to do this, i created this application. And because everyday we can use different scripts i decided to make the application extendable so you can add new dll and the application know how to execute this new script. Right now while am having a drink and reading a little bit about MEF, my heart start to beat very fast as i found this exactly what i was doing without using reflection. I think i will have couple of drinks more and dive more deep with this sweet lovely thing. Just wanna share my feelings with you guys
Genius is one percent inspiration and ninety-nine percent perspiration.
|
|
|
|

|
Good luck but don't mix drinks with MEF
Ranjan.D
|
|
|
|

|
Don't worry ... JD is my best friend
Genius is one percent inspiration and ninety-nine percent perspiration.
|
|
|
|

|
"I don't often read tech manuals, but when I do, I drink Dos Equis." -- The world's most nerdiest guy.
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin