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
  1. Home
  2. The Lounge
  3. ROTD

ROTD

Scheduled Pinned Locked Moved The Lounge
question
29 Posts 15 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tom Delany
    wrote on last edited by
    #1

    Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

    public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
    {
    IsReadOnly = true;

    return CoroutineFns.AsResult(
        () => \_repository.FindToDoItemByID(toDoItemID,
                                           (r) =>
                                           {
                                               Item = r;
                                               Item.PropertyChanged +=
                                                   (s, e) => NotifyOfPropertyChange(() => CanSave);
                                               if (onSuccess != null)
                                                   onSuccess();
                                           }, onFail));
    

    }

    Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

    WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

    D E S T C 12 Replies Last reply
    0
    • T Tom Delany

      Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

      public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
      {
      IsReadOnly = true;

      return CoroutineFns.AsResult(
          () => \_repository.FindToDoItemByID(toDoItemID,
                                             (r) =>
                                             {
                                                 Item = r;
                                                 Item.PropertyChanged +=
                                                     (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                 if (onSuccess != null)
                                                     onSuccess();
                                             }, onFail));
      

      }

      Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

      WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

      D Offline
      D Offline
      Dalek Dave
      wrote on last edited by
      #2

      Welcome to the Curmudgeon Club. Myself, Roger, Nagy and others are long time members, not forgetting the honorary chairman, Henry.

      ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

      H 1 Reply Last reply
      0
      • T Tom Delany

        Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

        public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
        {
        IsReadOnly = true;

        return CoroutineFns.AsResult(
            () => \_repository.FindToDoItemByID(toDoItemID,
                                               (r) =>
                                               {
                                                   Item = r;
                                                   Item.PropertyChanged +=
                                                       (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                   if (onSuccess != null)
                                                       onSuccess();
                                               }, onFail));
        

        }

        Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

        WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #3

        I bet the method call uses a lambda to define onFail and onSuccess too.

        Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

        T 1 Reply Last reply
        0
        • T Tom Delany

          Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

          public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
          {
          IsReadOnly = true;

          return CoroutineFns.AsResult(
              () => \_repository.FindToDoItemByID(toDoItemID,
                                                 (r) =>
                                                 {
                                                     Item = r;
                                                     Item.PropertyChanged +=
                                                         (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                     if (onSuccess != null)
                                                         onSuccess();
                                                 }, onFail));
          

          }

          Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

          WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

          S Offline
          S Offline
          Single Step Debugger
          wrote on last edited by
          #4

          I’m with you on this. I rarely use lambdas usually with LINQ (to memory not to SQL of course) and that is. What you have found is not programing, it’s a childish show off. Edit: typo Edit2: spoted second typo. :sigh:

          There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.

          T 1 Reply Last reply
          0
          • T Tom Delany

            Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

            public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
            {
            IsReadOnly = true;

            return CoroutineFns.AsResult(
                () => \_repository.FindToDoItemByID(toDoItemID,
                                                   (r) =>
                                                   {
                                                       Item = r;
                                                       Item.PropertyChanged +=
                                                           (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                       if (onSuccess != null)
                                                           onSuccess();
                                                   }, onFail));
            

            }

            Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

            WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

            T Offline
            T Offline
            TorstenH
            wrote on last edited by
            #5

            You should consider a change of programming language.

            regards Torsten When I'm not working

            M 1 Reply Last reply
            0
            • T TorstenH

              You should consider a change of programming language.

              regards Torsten When I'm not working

              M Offline
              M Offline
              Marc Clifton
              wrote on last edited by
              #6

              TorstenH. wrote:

              You should consider a change of programming language.

              GWBASIC ? Marc

              My Blog

              N 1 Reply Last reply
              0
              • T Tom Delany

                Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                {
                IsReadOnly = true;

                return CoroutineFns.AsResult(
                    () => \_repository.FindToDoItemByID(toDoItemID,
                                                       (r) =>
                                                       {
                                                           Item = r;
                                                           Item.PropertyChanged +=
                                                               (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                           if (onSuccess != null)
                                                               onSuccess();
                                                       }, onFail));
                

                }

                Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                yup. the primary purpose of lambdas seems to be as a mechanism by which people demonstrate how clever they are.

                image processing toolkits | batch image processing

                1 Reply Last reply
                0
                • T Tom Delany

                  Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                  public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                  {
                  IsReadOnly = true;

                  return CoroutineFns.AsResult(
                      () => \_repository.FindToDoItemByID(toDoItemID,
                                                         (r) =>
                                                         {
                                                             Item = r;
                                                             Item.PropertyChanged +=
                                                                 (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                             if (onSuccess != null)
                                                                 onSuccess();
                                                         }, onFail));
                  

                  }

                  Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                  WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                  R Offline
                  R Offline
                  R Giskard Reventlov
                  wrote on last edited by
                  #8

                  Over-engineering of the smuggest sort. The very best code is that which observes the KISS principle: "keep it simple, stupid".

                  "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                  1 Reply Last reply
                  0
                  • T Tom Delany

                    Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                    public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                    {
                    IsReadOnly = true;

                    return CoroutineFns.AsResult(
                        () => \_repository.FindToDoItemByID(toDoItemID,
                                                           (r) =>
                                                           {
                                                               Item = r;
                                                               Item.PropertyChanged +=
                                                                   (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                               if (onSuccess != null)
                                                                   onSuccess();
                                                           }, onFail));
                    

                    }

                    Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                    WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #9

                    Good god. Not only the lambda's, but the method name "GetToDoItem" is a misnomer, it certainly doesn't return a todo item, instead it implements IoC. And worse, there's a side effect of adding an event handler, which I noticed never gets removed. I wonder how many times that event gets wired up and what effect that has. And not to mention that onSuccess can be null, so why would you call "GetToDoItem" if you never DO anything with it? I guess this method can also be used to check if there's a todo item of the particular ID and then throw an exception. Gee, but what if onFail is null? There's no check for that! Freaking insane, when: Dictionary<int, Item> itemsByID; would seem so much simpler. But then again, what do I know? I'm sure I'm missing the bigger picture here. Marc

                    My Blog

                    T N 2 Replies Last reply
                    0
                    • E Ennis Ray Lynch Jr

                      I bet the method call uses a lambda to define onFail and onSuccess too.

                      Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

                      T Offline
                      T Offline
                      Tom Delany
                      wrote on last edited by
                      #10

                      Yeah. I did not say it was incorrect. I just find that stuff hard to follow.

                      WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                      1 Reply Last reply
                      0
                      • T Tom Delany

                        Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                        public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                        {
                        IsReadOnly = true;

                        return CoroutineFns.AsResult(
                            () => \_repository.FindToDoItemByID(toDoItemID,
                                                               (r) =>
                                                               {
                                                                   Item = r;
                                                                   Item.PropertyChanged +=
                                                                       (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                                   if (onSuccess != null)
                                                                       onSuccess();
                                                               }, onFail));
                        

                        }

                        Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                        WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                        D Offline
                        D Offline
                        Daniel Grunwald
                        wrote on last edited by
                        #11

                        Well that's just how async programming looks like in C# 4.0 and most other programming languages. await in C# 5.0 will allow writing such code in a much more readable fashion; but until then, continuation passing style using nested lambdas is the way to go. Well, there's also the alternative of using a separate thread for every operation (so that the methods can block and return results directly instead of using callbacks), but that's not very scalable and makes it much more difficult to write correct code (you need locks etc.).

                        T 1 Reply Last reply
                        0
                        • T Tom Delany

                          Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                          public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                          {
                          IsReadOnly = true;

                          return CoroutineFns.AsResult(
                              () => \_repository.FindToDoItemByID(toDoItemID,
                                                                 (r) =>
                                                                 {
                                                                     Item = r;
                                                                     Item.PropertyChanged +=
                                                                         (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                                     if (onSuccess != null)
                                                                         onSuccess();
                                                                 }, onFail));
                          

                          }

                          Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                          WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                          W Offline
                          W Offline
                          W Balboos GHB
                          wrote on last edited by
                          #12

                          When learning assembly language (oh so long ago!) I used to look at disassemblies to get a feel for techniques, which even if not the greatest were still tips on how things should (might) be done. One thing I learned is that, as a general rule, you can be cheep and delusionally clever with your coding, putting as much into a statement as you wish. The compiler? For the most part, she don't give a damn. The code still needs to be executed stepwise - and so the (disassemblies) looked the same. Just because you didn't declare any intermediate storage doesn't phase the compiler one bit. The obvious lesson is that one might as well make the code human-comprehensible by breaking it down into manageable steps - which is what you really wanted, anyway.* * Turn on the optimizer and you're really pharting into the wind.

                          "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                          "As far as we know, our computer has never had an undetected error." - Weisert

                          "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

                          1 Reply Last reply
                          0
                          • S Single Step Debugger

                            I’m with you on this. I rarely use lambdas usually with LINQ (to memory not to SQL of course) and that is. What you have found is not programing, it’s a childish show off. Edit: typo Edit2: spoted second typo. :sigh:

                            There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.

                            T Offline
                            T Offline
                            Tom Delany
                            wrote on last edited by
                            #13

                            I tend to agree with you. Lambdas have their uses, but that kind of code is just horrible to follow in my opinion. It might be standard practice, but that does not mean that I have to agree with it. X| Edit: DYAC!

                            WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              Good god. Not only the lambda's, but the method name "GetToDoItem" is a misnomer, it certainly doesn't return a todo item, instead it implements IoC. And worse, there's a side effect of adding an event handler, which I noticed never gets removed. I wonder how many times that event gets wired up and what effect that has. And not to mention that onSuccess can be null, so why would you call "GetToDoItem" if you never DO anything with it? I guess this method can also be used to check if there's a todo item of the particular ID and then throw an exception. Gee, but what if onFail is null? There's no check for that! Freaking insane, when: Dictionary<int, Item> itemsByID; would seem so much simpler. But then again, what do I know? I'm sure I'm missing the bigger picture here. Marc

                              My Blog

                              T Offline
                              T Offline
                              Tom Delany
                              wrote on last edited by
                              #14

                              In fairness to the author (whomever that might be), the code was from a sample project. It was never intended to be production code. Edit: but thanks for pointing out the flaws. This WPF stuff is fairly new to me. I'm trying real hard to follow good MVVM design practices in my code (as soon as I get my head around it).

                              WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                              1 Reply Last reply
                              0
                              • D Daniel Grunwald

                                Well that's just how async programming looks like in C# 4.0 and most other programming languages. await in C# 5.0 will allow writing such code in a much more readable fashion; but until then, continuation passing style using nested lambdas is the way to go. Well, there's also the alternative of using a separate thread for every operation (so that the methods can block and return results directly instead of using callbacks), but that's not very scalable and makes it much more difficult to write correct code (you need locks etc.).

                                T Offline
                                T Offline
                                Tom Delany
                                wrote on last edited by
                                #15

                                So I am learning. :sigh:

                                WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                                1 Reply Last reply
                                0
                                • D Dalek Dave

                                  Welcome to the Curmudgeon Club. Myself, Roger, Nagy and others are long time members, not forgetting the honorary chairman, Henry.

                                  ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

                                  H Offline
                                  H Offline
                                  Henry Minute
                                  wrote on last edited by
                                  #16

                                  -O +U[^]

                                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

                                  N 1 Reply Last reply
                                  0
                                  • H Henry Minute

                                    -O +U[^]

                                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

                                    N Offline
                                    N Offline
                                    Nagy Vilmos
                                    wrote on last edited by
                                    #17

                                    I wanna be like you!


                                    Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                                    1 Reply Last reply
                                    0
                                    • M Marc Clifton

                                      TorstenH. wrote:

                                      You should consider a change of programming language.

                                      GWBASIC ? Marc

                                      My Blog

                                      N Offline
                                      N Offline
                                      Nagy Vilmos
                                      wrote on last edited by
                                      #18

                                      Holy retardation Batman! Where did you pull that fossil from? :-D


                                      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                                      1 Reply Last reply
                                      0
                                      • T Tom Delany

                                        Note: Before the flamers get their blasters out, this is NOT a programming question. It is just a rant. I hate code like this:

                                        public IResult GetToDoItem(int toDoItemID, Action onSuccess, Action<Exception> onFail)
                                        {
                                        IsReadOnly = true;

                                        return CoroutineFns.AsResult(
                                            () => \_repository.FindToDoItemByID(toDoItemID,
                                                                               (r) =>
                                                                               {
                                                                                   Item = r;
                                                                                   Item.PropertyChanged +=
                                                                                       (s, e) => NotifyOfPropertyChange(() => CanSave);
                                                                                   if (onSuccess != null)
                                                                                       onSuccess();
                                                                               }, onFail));
                                        

                                        }

                                        Lambdas in lambdas in lambdas in lambdas. I find that to be nearly incomprehensible. Gaa!! I'm sure it is written very efficiently. X| I must be getting old and turning into a curmudgeon. :~

                                        WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #19

                                        In my experience I have seen new and older programmers. The newer ones have taken to landas more naturally. Not sure if they are crammed down their throats in school or what. But in working with them I find they use them not necessarily to show off, but that is what they know. For example, I have seen code riddled with

                                        public event EventHandler SomeEvent = (s, e) => { };

                                        Where as I have always let the event be null and let the objects needing it build up the event collection (i.e. +=). Then create some wrapper for null check

                                        private void RaiseSomeEvent()
                                        {
                                        if(SomeEvent != null)
                                        {
                                        SomeEvent(this, EventArgs.Empty); //Or pass through the args received
                                        }
                                        }

                                        Maybe the new recruits are on to something. Not sure. I did some perf testing a while back and found empty delegates were more expensive than an if, however what about one empty delegate to many ifs. Not sure. But that is not the point really. They did not put this code in to 'show off' nor did they do perf testing. They did it because they knew how, and it took care of some problems (null ref). The same is true with other uses of lambda or any new technologies. A programmer finds a way to get something down, and tends to stick with it. Even if an entire framework comes out simplifying it the programmer will use their old methodolgies. When I first saw lamdas I gagged a little. But I find them quite easy to read now. Espeacially after writting some quite complicated ones that were even more complicated with out. In some cases it is easier for your thought flow in creating. Maybe it is harder for a non-Lamda user to understand after the fact, but that is not likely the programmers initial concern. I am not defending this particular code chunck, as it is not clean at all. But most likely you renamed and lost a little formatting in the post here. I have found that formatting (white space etc.) and proper naming is the key to leaving bread crumbs for your collegues (and yourself for that matter). I am defending lamdas though as I have found them quite usefull and dare I say cleaner in many cases. It just takes proper usage, but this is true with any technology.

                                        Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

                                        T P 2 Replies Last reply
                                        0
                                        • M Marc Clifton

                                          Good god. Not only the lambda's, but the method name "GetToDoItem" is a misnomer, it certainly doesn't return a todo item, instead it implements IoC. And worse, there's a side effect of adding an event handler, which I noticed never gets removed. I wonder how many times that event gets wired up and what effect that has. And not to mention that onSuccess can be null, so why would you call "GetToDoItem" if you never DO anything with it? I guess this method can also be used to check if there's a todo item of the particular ID and then throw an exception. Gee, but what if onFail is null? There's no check for that! Freaking insane, when: Dictionary<int, Item> itemsByID; would seem so much simpler. But then again, what do I know? I'm sure I'm missing the bigger picture here. Marc

                                          My Blog

                                          N Offline
                                          N Offline
                                          Nagy Vilmos
                                          wrote on last edited by
                                          #20

                                          Marc Clifton wrote:

                                          I'm sure I'm missing the bigger picture here.

                                          You and me both. I think it's an under 40 thang.


                                          Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

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