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. Where does it end?

Where does it end?

Scheduled Pinned Locked Moved The Lounge
cssalgorithmsquestioncsharpvisual-studio
44 Posts 12 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.
  • Sander RosselS Sander Rossel

    You do C#, but not LINQ and lambda? How do you work with collections, write out each foreach loop every time?

    Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

    Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

    Regards, Sander

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #41

    Foreach is inefficient, for loops rule.

    Sander RosselS 1 Reply Last reply
    0
    • P PIEBALDconsult

      Foreach is inefficient, for loops rule.

      Sander RosselS Offline
      Sander RosselS Offline
      Sander Rossel
      wrote on last edited by
      #42

      I think/hope you're missing a joke icon :laugh:

      Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

      Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

      Regards, Sander

      1 Reply Last reply
      0
      • Sander RosselS Sander Rossel

        A shame you didn't recognize it. It's an indication that my code is, indeed, 'clever'... Not sure how to make it more readable though (I guess this is the part where it becomes a programming question :laugh: ).

        Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

        Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

        Regards, Sander

        R Offline
        R Offline
        RASPeter
        wrote on last edited by
        #43

        Have you considered adding a comment? I find that's generally a good idea for clever code (with or without quotes).

        Sander RosselS 1 Reply Last reply
        0
        • R RASPeter

          Have you considered adding a comment? I find that's generally a good idea for clever code (with or without quotes).

          Sander RosselS Offline
          Sander RosselS Offline
          Sander Rossel
          wrote on last edited by
          #44

          It's funny you should say that. While you certainly make a valid point allow me to explain why I don't think that's the solution. If the code is so unclear it needs comments I really think you should stop and have another look at your code. Try rewriting it so that it shouldn't need comments (which is what I did). If there's really nothing else you can do you can use a comment, but I highly discourage it. I've said it before and I'll say it now; comments are the evil of this world :) In fact I've had so much bad experiences with comments that I've written a tip about it a few years ago. If you're interested: Write comments that matter[^]. Thanks for the tip though :thumbsup:

          Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

          Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

          Regards, Sander

          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