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. I hate recent C# versions!

I hate recent C# versions!

Scheduled Pinned Locked Moved The Lounge
csharpquestion
92 Posts 48 Posters 75 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 Behzad Sedighzadeh

    Am I the only one who hates recent addings to the language? Some examples: ?? Named/optional arguments () ?[] discards :confused:

    (_, _, area) = city.GetCityInformation(cityName);

    Switch expressions The list can go on and on. They are trying to make programming much easier and at the same time are making the syntax more and more unreadable:mad::mad:

    Behzad

    O Offline
    O Offline
    obermd
    wrote on last edited by
    #34

    Syntactic sugar. Don't use it if you don't want to but some of these are useful.

    L 1 Reply Last reply
    0
    • O obermd

      Syntactic sugar. Don't use it if you don't want to but some of these are useful.

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

      obermd wrote:

      Don't use it if you don't want to

      You'll have to learn them, if you want to read new and foreign code-bases, so little choice there. There's a trade-off though, and I can't see how much value they add that can justify the confusion and the costs. As an industry, we'd be better of with consistency and fewer changes, saving them up for a few years and come with a decent change. Not just more sugar every umpteen months; if it were as interesting as animated icons on the desktop, then I'd be all for it, but it not even half that good, if anything, it's contra-productive and generating more costs than it is adding in value.

      Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      J 1 Reply Last reply
      0
      • Sander RosselS Sander Rossel

        Eddy Vluggen wrote:

        As hard as we try, we cannot kill the beast.

        Or can't we kill the beast because some of us aren't trying? I know a developer who'd still start new VB6 projects in 2022 because that's all he knows, it works and clients are satisfied. Why learn something new when the old still works? This person also uses hidden controls on a form to store values, instead of using variables like the rest of us do. Also, because it works, so why try harder? He'll be retiring later this year and he gets to keep all of his software and clients because no one, and I mean no one, could ever unearth whatever it is that he built. There are plenty of people like that, sort of technical quakers. We had technology in 1999, which is what God intended, and we need nothing newer.

        Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

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

        Further down in this thread;

        obermd wrote:

        Don't use it if you don't want to

        That's exactly what happened and why VB6 still exists.

        Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          I'd agree - the scope should logically be limited to the if block. It seems strange that it wasn't really ...

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

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

          Needs to apply to an else if present? :~

          OriginalGriffO 1 Reply Last reply
          0
          • P PIEBALDconsult

            Needs to apply to an else if present? :~

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #38

            Nope - because if it isn't that class, it should be at best null and thus unusable in the else :-D

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            P 1 Reply Last reply
            0
            • P PIEBALDconsult

              I agree, yes, that's good, though I don't use C99 either. On the other hand, I notice that there is no similar syntax for while :-D .

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #39

              While is more of a "general purpose" loop construct, most commonly used with things that have been already constructed, like file pointers, linked lists, strings I think. It's less likely that you'd need the declarative part since a while loop doesn't have an initialisation phase like a for loop does.

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              P 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                Nope - because if it isn't that class, it should be at best null and thus unusable in the else :-D

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

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

                Which maybe I want! I can use null better'n anybody! (OK, probably not.) But what if the syntax allowed the use of the null-coalescing operator as well! Way hey!

                1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  While is more of a "general purpose" loop construct, most commonly used with things that have been already constructed, like file pointers, linked lists, strings I think. It's less likely that you'd need the declarative part since a while loop doesn't have an initialisation phase like a for loop does.

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

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

                  But it could! Except then it might just be roughly equivalent to a foreach anyway. :sigh:

                  OriginalGriffO 1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    But it could! Except then it might just be roughly equivalent to a foreach anyway. :sigh:

                    OriginalGriffO Offline
                    OriginalGriffO Offline
                    OriginalGriff
                    wrote on last edited by
                    #42

                    Which they added to C++ anyway ... :laugh:

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                    P 1 Reply Last reply
                    0
                    • OriginalGriffO OriginalGriff

                      Which they added to C++ anyway ... :laugh:

                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

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

                      You can't keep anything nice. (I've only ever dabbled in C++ .) I may need to look at D again.

                      1 Reply Last reply
                      0
                      • L Lost User

                        obermd wrote:

                        Don't use it if you don't want to

                        You'll have to learn them, if you want to read new and foreign code-bases, so little choice there. There's a trade-off though, and I can't see how much value they add that can justify the confusion and the costs. As an industry, we'd be better of with consistency and fewer changes, saving them up for a few years and come with a decent change. Not just more sugar every umpteen months; if it were as interesting as animated icons on the desktop, then I'd be all for it, but it not even half that good, if anything, it's contra-productive and generating more costs than it is adding in value.

                        Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                        J Offline
                        J Offline
                        jmaida
                        wrote on last edited by
                        #44

                        This C# discussion is an age old one. Remember: if it ain't broke don't fix it. Change is the enemy of working. Better is the enemy of good. Perfection is the enemy of good. Static = no growth, no growth = death .... on the other hand when a fix corrects something broken, its a good thing. When change = easier, its a good thing (sometimes) ....

                        "A little time, a little trouble, your better day" Badfinger

                        P 1 Reply Last reply
                        0
                        • J jmaida

                          This C# discussion is an age old one. Remember: if it ain't broke don't fix it. Change is the enemy of working. Better is the enemy of good. Perfection is the enemy of good. Static = no growth, no growth = death .... on the other hand when a fix corrects something broken, its a good thing. When change = easier, its a good thing (sometimes) ....

                          "A little time, a little trouble, your better day" Badfinger

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

                          jmaida wrote:

                          When change = easier, its a good thing (sometimes)

                          Hmm, rarely. And something which merely "saves keystrokes" is best avoided. I can save an awful lot of keystrokes just by not writing comments and documentation.

                          J L 2 Replies Last reply
                          0
                          • P PIEBALDconsult

                            jmaida wrote:

                            When change = easier, its a good thing (sometimes)

                            Hmm, rarely. And something which merely "saves keystrokes" is best avoided. I can save an awful lot of keystrokes just by not writing comments and documentation.

                            J Offline
                            J Offline
                            jmaida
                            wrote on last edited by
                            #46

                            agree

                            "A little time, a little trouble, your better day" Badfinger

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              jmaida wrote:

                              When change = easier, its a good thing (sometimes)

                              Hmm, rarely. And something which merely "saves keystrokes" is best avoided. I can save an awful lot of keystrokes just by not writing comments and documentation.

                              L Offline
                              L Offline
                              lmoelleb
                              wrote on last edited by
                              #47

                              Agree. However they do not just save keystrokes, hence I like the features listed here. Reducing the risk of errors (like the switch expressions) and reducing the amount of code that is not clearly expressing the intend of your algorithm (like ?. and ??) Is a clear benefit for me. I can even get behind the minimalistic stuff, once they expand it to cover all classes. I have no need for one single class to look completely different. But I guess they will eventually realize the main use case for C# is not only doing cool demos at conferences and expand it to us who have "complicated" programs needing two or more classes.

                              1 Reply Last reply
                              0
                              • B Behzad Sedighzadeh

                                Am I the only one who hates recent addings to the language? Some examples: ?? Named/optional arguments () ?[] discards :confused:

                                (_, _, area) = city.GetCityInformation(cityName);

                                Switch expressions The list can go on and on. They are trying to make programming much easier and at the same time are making the syntax more and more unreadable:mad::mad:

                                Behzad

                                M Offline
                                M Offline
                                Member 9167057
                                wrote on last edited by
                                #48

                                Speak for yourself. I, for example, love ?? and switch expressions for making the syntax more readable, actually. They are concise, that is, there's less syntax to achieve the same thing, meaning less overhead to parse when reading.

                                1 Reply Last reply
                                0
                                • B Behzad Sedighzadeh

                                  Am I the only one who hates recent addings to the language? Some examples: ?? Named/optional arguments () ?[] discards :confused:

                                  (_, _, area) = city.GetCityInformation(cityName);

                                  Switch expressions The list can go on and on. They are trying to make programming much easier and at the same time are making the syntax more and more unreadable:mad::mad:

                                  Behzad

                                  H Offline
                                  H Offline
                                  Hassan F
                                  wrote on last edited by
                                  #49

                                  I believe they are competing with JS and python, because programming Meme always noted that python is fast in a single hello world sample, And others are not. The things I'm not sure about is why companies such as JetBrains also support those bad manners, and force users to change code to some of these style, while they just could ignore the user style (that may depend on the surranding and could change readability regarding to that)

                                  1 Reply Last reply
                                  0
                                  • B Behzad Sedighzadeh

                                    Am I the only one who hates recent addings to the language? Some examples: ?? Named/optional arguments () ?[] discards :confused:

                                    (_, _, area) = city.GetCityInformation(cityName);

                                    Switch expressions The list can go on and on. They are trying to make programming much easier and at the same time are making the syntax more and more unreadable:mad::mad:

                                    Behzad

                                    B Offline
                                    B Offline
                                    BillWoodruff
                                    wrote on last edited by
                                    #50

                                    i hope it does not sound patronizing for me to i say that i "love" the discussion of "I hate recent C# versions" :) what a pleasure for an old man about to get new eyes, to savor the illuminations of many of CP's brightest-bulbs. Kornfeld's signature quote from Einstein: "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid." Did make me chuckle ... as I thought of the tree-climbing mudskipper fish whose evolutionary history is detailed in Richard Dawkins' magisterial survey, "The Ancestor's Tale." (see "The Lungfishes' Tale").

                                    Quote:

                                    Another common name, ‘climbing fish’, comes from their habit of climbing mangrove trees looking for prey. They cling to the trees with the pectoral fins, aided by a kind of sucker which is made by bringing the pelvic fins together under the body.

                                    That boomeranging thought leads me to ponder if the evolution of C# ... leads us to believe we ... are ... smart. Is the "destiny" of C# (my favorite grab-bag of syntax and functionality masquerading as a "computer language") to have as much junk in its DNA as we, Homo Saps, do ? cheers, Bill

                                    «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                                    1 Reply Last reply
                                    0
                                    • B Behzad Sedighzadeh

                                      Am I the only one who hates recent addings to the language? Some examples: ?? Named/optional arguments () ?[] discards :confused:

                                      (_, _, area) = city.GetCityInformation(cityName);

                                      Switch expressions The list can go on and on. They are trying to make programming much easier and at the same time are making the syntax more and more unreadable:mad::mad:

                                      Behzad

                                      R Offline
                                      R Offline
                                      RustyF
                                      wrote on last edited by
                                      #51

                                      If you don’t like more succinct code I would just stick with COBOL

                                      S 1 Reply Last reply
                                      0
                                      • P PIEBALDconsult

                                        Seems kludgey. We need a whole new language with everything we've learned over the past twenty years included, with cleaner syntax, rather than bits stuck on at odd angles.

                                        M Offline
                                        M Offline
                                        MikeCLX
                                        wrote on last edited by
                                        #52

                                        We could call it something like B# and just copy and paste VB.NET, best language without the VB name stigma :) Oh wait we don’t want something easy that can do the same job better do we ;) KISS principle

                                        1 Reply Last reply
                                        0
                                        • P PIEBALDconsult

                                          Never hate. I don't use any features of C# newer than v3. The other week I found that I was using a Dictionary Initializer (which is a v6 feature), so I reverted it to a Collection Initializer (which is a v3 feature). I use the ?? operator (the null-coalescing operator, a C# 2 feature) occasionally, such as when interpreting a command line.

                                          Graeme_GrantG Offline
                                          Graeme_GrantG Offline
                                          Graeme_Grant
                                          wrote on last edited by
                                          #53

                                          Then you wont like this valid c# syntax:

                                          if (jsonReader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray)
                                          {
                                          //...
                                          }

                                          Old syntax:

                                          if (jsonReader.TokenType == JsonTokenType.EndObject || jsonReader.TokenType == JsonTokenType.EndArray)
                                          {
                                          //...
                                          }

                                          Graeme


                                          "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee

                                          P 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