Skip to content

The Weird and The Wonderful

It was the best of code, it was the worst of code. Coding Horrors, Worst Practices, and flashes of brilliance

This category can be followed from the open social web via the handle the-weird-and-the-wonderful@forum.codeproject.com

1.8k Topics 20.7k Posts
  • This is the kind of productivity you get when you pay by lines of code

    tools
    8
    0 Votes
    8 Posts
    0 Views
    W
    You get VB? :-D Wout
  • Is this bad or am I just picky?

    database data-structures debugging question code-review
    19
    0 Votes
    19 Posts
    0 Views
    H
    Bob G Beechey wrote: I am getting tired of silly comments about vb. Presumably by someone who has not checked out vb since vb6. I've used VB2 through VB6 and VB.Net (2002) through VB.Net 2005. VB's mother wears army boots! -- Harvey
  • The best lambda expression I ever saw

    linq functional
    13
    0 Votes
    13 Posts
    3 Views
    B
    As well as the actual lambda Greek letter. Bob Dole The internet is a great way to get on the net. :doh: 2.0.82.7292 SP6a
  • 77

    database com
    6
    0 Votes
    6 Posts
    0 Views
    Sander RosselS
    Nope, I still remember the Aaaa_Bbbbb.Cccccc_Ddddd kind of notation. It's an OO world. public class Naerling : Lazy<Person>{ public void DoWork(){ throw new NotImplementedException(); } }
  • 0 Votes
    7 Posts
    0 Views
    C
    Of course there's a solution with webservices! You can do anything with webservices, you just need enough of them. And lots and lots of really verbose XML. Can't have a solution with webservices without lots of XML! :rolleyes: Quidquid latine dictum sit, altum viditur.
  • A world without Ads

    8
    0 Votes
    8 Posts
    0 Views
    J
    nope that wasnt an AD.
  • When you aren't even sure WHY you're writing bad code

    help sales tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    CHill60C
    Scarily Issue 2862 on our tracking system was raised in 2003 - I'm now searching our codebase for DenverCoder9 :-D
  • It does what now?

    question
    8
    0 Votes
    8 Posts
    0 Views
    V
    It throws an exception when visible == null.
  • Happy new year... kind of...

    database question
    11
    0 Votes
    11 Posts
    0 Views
    V
    An attempt to create new, better LINQ to SQL?
  • 0 Votes
    15 Posts
    0 Views
    S
    It is a bit psuedo. With properly declared variables and keywords it would compile and run. Unfortunately it has a bug and is therefore quite dangerous to anyone stepping on the trap door. I forgot two important parameters. A variable for a timer and a constant for maximum standing time allowed. The trap would trigger as soon as you got up to use the restroom. Now, if you really want to use the code, rather than applying it to a trap door, apply it to an arduino or raspi controlled supper soaker water gun sitting on the desk, pointed in the direction of the standing interloper. To be not so obvious and have some real fun, place a small hidden water device on the sealing above the spot and have it spew out just enough water to make it feel like a bird just pissed on the individual. For real effectiveness, make the device focus on any area behind the desk that's within the monitors viewing area. Hmmm; It appears that I have been reading way to many Instructables and Hackadays. And also watching to many YouTube videos utilizing arduino controlled devices. :laugh:
  • working with Dates...

    4
    0 Votes
    4 Posts
    0 Views
    J
    hahahah guess you got the whole point
  • Spurious use of goto...

    ruby
    2
    0 Votes
    2 Posts
    0 Views
    J
    Now this is what happens if you Google "coding" in the "Fill in the blanks" forum
  • Drinking and coding

    21
    0 Votes
    21 Posts
    1 Views
    J
    Obviously. :doh: People say nothing is impossible, but I do nothing every day.
  • Domain vs Technology

    csharp asp-net visual-studio wcf
    11
    0 Votes
    11 Posts
    2 Views
    R
    Thanks a lot. I have choose Healthcare domain, May be I will keep up to date with the technology if don't get any opportunity to work the same in office. Ranjan.D
  • Reversing time, without a flux capacitor

    csharp announcement
    15
    0 Votes
    15 Posts
    1 Views
    J
    I assume this had something to do with IAsyncResult.CompletedSynchronously[^] (possibly derived from Socket.Available[^])? Interesting because under extreme and consistent load this means that the async loop could cause a StackOverflowException (even with your fixed code); I wonder if there is a way to turn off this 'optimization' without having to resort to: private void StartAsyncReadLoop() { ReadAsyncLoop(null); } private void ReadAsyncLoop(IAsyncResult state) { try { if (state != null) { var length = _socket.EndReceive(state); // ... } // Ensure that only one level of recursion happens. if (state == null || !state.CompletedSynchronously) \_socket.BeginReceive(..., ReadAsyncLoop, null); else // Maybe it's best to just always do this. Although considering how sockets use the thread pool // it's very likely overkill. ThreadPool.QueueUserWorkItem(\_ => \_socket.BeginReceive(..., ReadAsyncLoop, null)); } catch (SocketException ex) { // ... } } I wonder if Socket.UseOnlyOverlappedIO[^] would have an effect on this, considering Overlapped IO is my 'asyncy' than IOCP. He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chinese Proverb] Jonathan C Dickinson (C# Software Engineer)
  • Strangely Refactored Name

    com question
    12
    0 Votes
    12 Posts
    2 Views
    J
    The fastest code to execute is code that doesn't exist.
  • What was I thinking

    database
    20
    0 Votes
    20 Posts
    24 Views
    R
    Ah, now I see what people mean by maintainable code - code that will require maintenance, and hence pay the bills for years to come. Genius.
  • The best refactoring I have ever seen

    c++ visual-studio com json code-review
    5
    0 Votes
    5 Posts
    1 Views
    R
    I think you'll find the technical term is refuctoring.
  • Two Approaches to Avoiding Repeating an Item Template

    csharp html asp-net wpf wcf
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Handling "Special" Cases in "Special" Ways

    com
    5
    0 Votes
    5 Posts
    1 Views
    P
    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. ORDER BY what user wants