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. A programming observation...

A programming observation...

Scheduled Pinned Locked Moved The Lounge
csharpdatabasecomhelptutorial
24 Posts 11 Posters 0 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.
  • B Brady Kelly

    It borrows heavily from widely accepted concepts used in functional languages as well as basic set theory. Pretty soon "a programming background in any language" will include C#3, which plays a significant role in exposing the set based extension method library that is the bulk of pure LINQ. The future will yield more and more C# developers versed in LINQ and more exposed to the functional concept of programming. I utterly fail do grasp the supposed density of this single line of code: int count = objs.DistinctBy(o=> o.ID).Count(); If the lambda is foreign to you, how about a plain objs.Distinct().Count() call on a set of records? Just how dense is that compared to

    bool DistinctList()
    {
    List uniqueList = new List();
    for (int i = 0; i < objs.Count; i++)
    {
    if (sortedSet[i] != sortedSet[i-1])
    {
    uniqueList .Add(sortedSet[i];
    }
    return uniqueList;
    }

    Which one says most about what is does in the most succinct way?

    M Offline
    M Offline
    Member 96
    wrote on last edited by
    #21

    Brady Kelly wrote:

    Pretty soon "a programming background in any language" will include C#3,

    WTF? Do you ever re-read what you've typed to see if it makes sense? :) Here's my reasoning on this as it applies to me: LINQ brings nothing of benefit to my end users of my software and anything that brings no benefit to my end users doesn't get used because I make software for others not my own amusement. LINQ provides nothing that isn't possible without using LINQ. LINQ may or may not be a fad, I have yet to see any real world code that uses it which doesn't mean no one is using it, it just means in my area of work and areas I'm concerned about and responsible for, no one is using it. It's of fundamental importance to me that any code I write be as clear as possible, as widely understandable as possible. To me you are doing the equivalent of an author throwing in french language jokes in an english language novel simply because they seem more clever written in french. Example 2 in your post is clear, easy to understand at a glance and could be understood and worked with by anyone from nearly any programming background and it's future proof, it doesn't rely on a possible fad. Most importantly of all it doesn't rely on any "tricks" that might get changed in the future causing the code to need to be rewritten.


    "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

    B 1 Reply Last reply
    0
    • M Member 96

      Jörgen Sigvardsson wrote:

      Also, you must not forget that John's words are law. All he says is the truth, and nothing but the truth.

      As I've said probably a zillion times on this site and qualified a zillion other times: we all come from our own perspective and what we say reflects that. What you're really saying here is that you don't like a forceful argument and that's a shame but not my concern.


      "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #22

      A modest human being says or writes "I think that..." or "I believe so and so, because...". You don't. Maybe your intent is to say what you think or believe is right, but it doesn't come across. You see, you're not arguing forcefully. You're being a dickhead, denying everybody else of having an opinion. Yes. I think you are a dickhead when you argue that other people are less productive if they use more than one monitor. If I have to explain why I believe so, then you're more narrow minded than I thought. And don't start to whine about "douchebaggery", because you're the douche bag belittling others with your "I am the law"-rhetoric.

      M 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        A modest human being says or writes "I think that..." or "I believe so and so, because...". You don't. Maybe your intent is to say what you think or believe is right, but it doesn't come across. You see, you're not arguing forcefully. You're being a dickhead, denying everybody else of having an opinion. Yes. I think you are a dickhead when you argue that other people are less productive if they use more than one monitor. If I have to explain why I believe so, then you're more narrow minded than I thought. And don't start to whine about "douchebaggery", because you're the douche bag belittling others with your "I am the law"-rhetoric.

        M Offline
        M Offline
        Member 96
        wrote on last edited by
        #23

        :laugh: Modesty will get you a modest life with much to be modest about. ;)


        "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

        1 Reply Last reply
        0
        • M Member 96

          Brady Kelly wrote:

          Pretty soon "a programming background in any language" will include C#3,

          WTF? Do you ever re-read what you've typed to see if it makes sense? :) Here's my reasoning on this as it applies to me: LINQ brings nothing of benefit to my end users of my software and anything that brings no benefit to my end users doesn't get used because I make software for others not my own amusement. LINQ provides nothing that isn't possible without using LINQ. LINQ may or may not be a fad, I have yet to see any real world code that uses it which doesn't mean no one is using it, it just means in my area of work and areas I'm concerned about and responsible for, no one is using it. It's of fundamental importance to me that any code I write be as clear as possible, as widely understandable as possible. To me you are doing the equivalent of an author throwing in french language jokes in an english language novel simply because they seem more clever written in french. Example 2 in your post is clear, easy to understand at a glance and could be understood and worked with by anyone from nearly any programming background and it's future proof, it doesn't rely on a possible fad. Most importantly of all it doesn't rely on any "tricks" that might get changed in the future causing the code to need to be rewritten.


          "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #24

          John C wrote:

          Example 2 in your post is clear, easy to understand at a glance and could be understood and worked with by anyone from nearly any programming background and it's future proof, it doesn't rely on a possible fad.

          Example 2 in my post is also doomed to failure, as is. Now I didn't write a buggy example because I'm dependent on LINQ for such simple tasks, but because I was coding for example, not for a product, but the LINQ example will work as long as IEnumerable and the LINQ assemblies are available, which in most probably cases will be a very long time.

          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