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. Other Discussions
  3. The Insider News
  4. Programming Language Peculiarities — C#

Programming Language Peculiarities — C#

Scheduled Pinned Locked Moved The Insider News
csharpcomhelpcareer
16 Posts 13 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.
  • K Kent Sharkey

    DZone[^]:

    It's been extremely hard to write C# oddities because it appears the people who created it did a pretty good job.

    It's not a bug, it's a feature

    I'm pretty sure he's wrong about the switch statement, but I'm too lazy to test/look it up.

    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu Peter
    wrote on last edited by
    #7

    Hello! Anybody home! It is bad enough to use switch at the first place, but since when we solve repetitive task using 'fall through'? Dear author - for that we introduced method (function/subrutine/...)

    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

    J 1 Reply Last reply
    0
    • S Super Lloyd

      Baloney! His allegedly NOT compiling switch statement is the like of which I write every day, and it compiles. Enough said!

      All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

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

      Yes it's allowed. Fall through is only not allowed in C# when the case contains something. If it's empty like he showed, that's fine.

      1 Reply Last reply
      0
      • K Kent Sharkey

        DZone[^]:

        It's been extremely hard to write C# oddities because it appears the people who created it did a pretty good job.

        It's not a bug, it's a feature

        I'm pretty sure he's wrong about the switch statement, but I'm too lazy to test/look it up.

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #9

        The comments on the article are rather amusing - especially his reply to Brian Friesen.

        Apologies, it appears you are right. It is a while since I programmed in C# and this was an example I found while researching this article. Perhaps you have some other examples that I can use in its place.

        This space for rent

        1 Reply Last reply
        0
        • K Kent Sharkey

          DZone[^]:

          It's been extremely hard to write C# oddities because it appears the people who created it did a pretty good job.

          It's not a bug, it's a feature

          I'm pretty sure he's wrong about the switch statement, but I'm too lazy to test/look it up.

          R Offline
          R Offline
          realJSOP
          wrote on last edited by
          #10

          His switch statement example is absurd. 0) Nobody would write a switch statement that falls through from the first case all the way to default. That's just f*ckin stupid. 1) He neglected to include the break statement, which would satisfy the compiler. 2) Real programmers don't use goto. 3) "each case must either have a break or a return" - wrong, retard. 4) In some instances, fall-through is viable and necessary. On declaration order of variables... 0) Regardless of whether or not a given variable is static, it MUST be declared before using it. Where did this idiot learn to write code? On I++.ToString()... 0) It's call precedence. Learn how to write code before calling something stupid. On the other hand, we can call you a retard, and be correct whenever we do it.

          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
          -----
          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
          -----
          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

          L 1 Reply Last reply
          0
          • R realJSOP

            His switch statement example is absurd. 0) Nobody would write a switch statement that falls through from the first case all the way to default. That's just f*ckin stupid. 1) He neglected to include the break statement, which would satisfy the compiler. 2) Real programmers don't use goto. 3) "each case must either have a break or a return" - wrong, retard. 4) In some instances, fall-through is viable and necessary. On declaration order of variables... 0) Regardless of whether or not a given variable is static, it MUST be declared before using it. Where did this idiot learn to write code? On I++.ToString()... 0) It's call precedence. Learn how to write code before calling something stupid. On the other hand, we can call you a retard, and be correct whenever we do it.

            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
            -----
            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
            -----
            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

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

            Something to expect from a student who is just starting and comparing languages :) "I just did my homework, and came across these strange things.."

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

            R 1 Reply Last reply
            0
            • L Lost User

              Something to expect from a student who is just starting and comparing languages :) "I just did my homework, and came across these strange things.."

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              R Offline
              R Offline
              realJSOP
              wrote on last edited by
              #12

              I just noticed humanity, and came across full-on retards. :)

              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
              -----
              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
              -----
              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

              1 Reply Last reply
              0
              • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                Hello! Anybody home! It is bad enough to use switch at the first place, but since when we solve repetitive task using 'fall through'? Dear author - for that we introduced method (function/subrutine/...)

                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                J Offline
                J Offline
                Jorgen Andersson
                wrote on last edited by
                #13

                Kornfeld Eliyahu Peter wrote:

                but since when we solve repetitive task using 'fall through'?

                When optimizing for example. Have you seen Duff's device - Wikipedia, the free encyclopedia[^]

                Wrong is evil and must be defeated. - Jeff Ello

                1 Reply Last reply
                0
                • K Kent Sharkey

                  DZone[^]:

                  It's been extremely hard to write C# oddities because it appears the people who created it did a pretty good job.

                  It's not a bug, it's a feature

                  I'm pretty sure he's wrong about the switch statement, but I'm too lazy to test/look it up.

                  J Offline
                  J Offline
                  Joe Woodbury
                  wrote on last edited by
                  #14

                  He needs to look at the main code of the company I worked at about three years ago; it was a nightmare of C# rot.

                  C 1 Reply Last reply
                  0
                  • R Ravi Bhavnani

                    "Something else to note hear..." 'Nuff said. :) /ravi

                    My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                    R Offline
                    R Offline
                    Rob Grainger
                    wrote on last edited by
                    #15

                    That falls on deaf ears.

                    "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                    1 Reply Last reply
                    0
                    • J Joe Woodbury

                      He needs to look at the main code of the company I worked at about three years ago; it was a nightmare of C# rot.

                      C Offline
                      C Offline
                      Camilo Reyes
                      wrote on last edited by
                      #16

                      Hear, hear! 800 line switch statement?? Pffft, hey it compiles to key / value pair so it performs. :laugh:

                      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