Jeff H's Profile User Rating: -----

Reputation: 112 Stalwart
Active Members
Active Posts:
309 (0.16 per day)
30-January 11
Profile Views:
Last Active:
User is offline Dec 09 2015 03:07 PM

Previous Fields

Dream Kudos:
Icon   Jeff H has not set their status

Posts I've Made

  1. In Topic: Method Complexity

    Posted 13 Aug 2014

    A little late but something not mentioned or to bring more attention to about TakeABreath example is its readability.

    Anyone person can only keep about 4 to 7 ideas or thoughts in their mind at one time.
    Breaking up methods into smaller parts that are not easily understood probably isn't any better.

    When you look at TakeABreath method it is easy to see that there 3 main parts inhale, process, exhale.
    There might be complex computations happening but, if all I need to know is call TakeABreath when a breath is needed that's it. If something changes and need to know what it does it is easily understood at a high level and do not require unnecessary information or noise to understand the lower level ideas.
    For example if need change the way oxygen is brought in I do not need to know about processing oxygen or exhaling to see to what happens when inhaling, or to put it another way it does not require having to understand, filter out, etc.. to see inhale implementation.

    Hopefully it makes sense but can you see how TakeABreath and its functions is close or organized to the way people naturally read or organize an idea? You appreciate code like that when scrolling up constantly because a method has 34 different local variables and it is 5th time you had to look because you can't remember what this one variable type is and that leads to some other class that constructor is just as bad.

    It has to happen somewhere but making code readable and broken up in way that makes it easy read is a very helpful skill.

    Not sure what your doing but might lend itself to CQS design.
    Not CQRS and the terminology has nothing to do with relational database.

    Quick overview is every method is a query or command.
    A query has NO side effects and returns a value. This could be value in private field etc..
    A command returns void and performs an action or changes state.

    A command can call a query but a query can not call a command.

    Also you can use functional programming concept of a "maybe" or in F# a maybe.
    Basically a collection constrained to having either 0 or 1 items instead of settings variables to null and null checks

My Information

Member Title:
D.I.C Regular
Age Unknown
Birthday Unknown

Contact Information




Page 1 of 1
  1. Photo

    Jeff H Icon

    14 Jul 2011 - 04:21
    To show it twice
  2. Photo

    Jeff H Icon

    14 Jul 2011 - 04:21
    To show it twice
  3. Photo

    Jeff H Icon

    13 Jul 2011 - 17:41
    Everything I do in my profile it does it twice.
  4. Photo

    Jeff H Icon

    13 Jul 2011 - 17:41
    Everything I do in my profile it does it twice.
  5. Photo

    raziel_ Icon

    13 Jul 2011 - 16:16
    lol i just saw your having fixo added twice in your friend list :D
  6. Photo

    Jeff H Icon

    09 Jul 2011 - 08:52
    Thanks smohd,
    and nice work yourself
  7. Photo

    smohd Icon

    03 Jul 2011 - 16:21
    Hi, nice work in VB.NET forum. keep it going :)
Page 1 of 1