Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

singh iz king

@singh iz king
About
Posts
8
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Friday programming quiz
    S singh iz king

    SomeValue

    The Lounge

  • !(How to best use a try catch block) [modified]
    S singh iz king

    Yes, That is one of the ways I suggested, but also added that if you are calculating an average, then the name should probably reflect that as well :)

    The Weird and The Wonderful tutorial

  • !(How to best use a try catch block) [modified]
    S singh iz king

    Lol...good one Unfortunately, I've come across so many such instances of bad programmers in my career (and I'm sure most of you have as well). This fortunately for me has been the only instance where the developer has understood what they've done wrong and positively taken on board the recommendations I've made. I actually came across this while doing a code review for a team that I had not worked with before.

    The Weird and The Wonderful tutorial

  • !(How to best use a try catch block) [modified]
    S singh iz king

    Hi Thomas, Thanks for that. The day I came across this, I had a private discussion with the developer and reasoned the right way of doing this. The message seems to be slowly getting across :)

    The Weird and The Wonderful tutorial

  • !(How to best use a try catch block) [modified]
    S singh iz king

    Yup...rightly picked up. I forgot to include the get block :doh:

    The Weird and The Wonderful tutorial

  • !(How to best use a try catch block) [modified]
    S singh iz king

    Just came across a class which has tens of such properties. These properties are called by other classes and by other properties / methods of this class!!! Oh! and also look how the property name says total, but is actually returning an average :omg:

    public double CrappyTotal
    {
    double CrappyTotal = 0; // notice the name of the variable is the same as the property
    try
    {
    CrappyTotal = this.SomeItem.Details[0].Value;
    CrappyTotal += this.SomeItem.Details[1].Value;
    CrappyTotal += this.SomeItem.Details[2].Value;
    CrappyTotal += this.SomeItem.Details[3].Value;
    CrappyTotal = CrappyTotal / 4;
    }
    catch
    {
    CrappyTotal = -1;
    }
    return CrappyTotal;
    }

    modified on Wednesday, July 8, 2009 11:35 PM

    The Weird and The Wonderful tutorial

  • LINQ gotcha I ran into
    S singh iz king

    What about ?

    var finished = ordered.Where(n => n != 0).Concat(ordered.Where(n => n == 0))

    What is the benefit of using SkipWhile and TakeWhile over just using the Where clause?

    Clever Code help csharp linq announcement

  • Good if paid by number of lines!
    S singh iz king

    this seems to be one of the most common horrors' posted here and also one of the most common I come across...

    The Weird and The Wonderful code-review
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups