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. Revenge of Redmond – C# and the .Net Frameworks

Revenge of Redmond – C# and the .Net Frameworks

Scheduled Pinned Locked Moved The Lounge
csharpannouncementdelphidotnetvisual-studio
75 Posts 28 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.
  • C Carlosian

    Stefan_Lang wrote:

    goto is a short circuit.

    I'm honestly curious to know what you think of break and continue. Those are short-circuits too, just in a more limited context. But of course they can't jump to previous code which it seems to me is the most harmful use of goto.

    S Offline
    S Offline
    Stefan_Lang
    wrote on last edited by
    #61

    I am grudgingly willing ;) to accept these. Especially the use of break in a switch statement is something I do not know any good way around.

    1 Reply Last reply
    0
    • J jschell

      Stefan_Lang wrote:

      In 26 years of C++ programming I've yet to see a piece of code that convinces me of using goto,

      There was an article/column in the C\C++ users Journal in that time period that was implementing printf (or maybe sprintf) which is part of the standard C library and it used goto quite a bit. As I remember it I doubt other constructs would have made the code more readable nor easier to understand. Other constructs might have been the same speed but introducing artificial conditionals would not have met that goal. And back then many applications would have been impacted by a slower implementation of that method.

      S Offline
      S Offline
      Stefan_Lang
      wrote on last edited by
      #62

      *shrug* There was a time where I would contemplate other peoples programming styles in published media and maybe adapt some of it. But I have long since realized that everyone makes mistakes and just because something is published doesn't mean it's good. That said, I have to point out, again, that my argument was about language designers putting the goto command into a language, not programmers using what language designers gave them.

      J 1 Reply Last reply
      0
      • J jschell

        Stefan_Lang wrote:

        That takes virtually no time at all

        That of course is the detail since if you are already optimizing a piece of code based on a measured (not guessed at) need then a conditional branch is in fact slower than an unconditional one.

        S Offline
        S Offline
        Stefan_Lang
        wrote on last edited by
        #63

        That point is moot: I said the language designers shouldn't have put goto into C#. If you're so strained about performance, why do you even use C# to start with?

        J 1 Reply Last reply
        0
        • J jschell

          Stefan_Lang wrote:

          ...worse for OO, and catastrophic for anything involving multithreading

          How can you construct "catastrophic" code with a goto involving threads for which you cannot do the same thing using some other idiom that involves branching? Certainly both Java and C++ compilers generate most branching idioms that exist in the language specifically by substituting structures that use goto. And both of them seem to handle threading without problems related to that.

          S Offline
          S Offline
          Stefan_Lang
          wrote on last edited by
          #64

          Lock(someSharedVariable)
          if (someCondition) goto someOtherPlace;
          doStuff(someSharedVariable); // do some stuff
          Unlock(someSharedVariable);

          That's what I mean by catastrophic, only that in real code, there may be alot more fluff around, hiding the fact that you're actually accessing a shared resource and jumping out of the context before releasing a lock.

          1 Reply Last reply
          0
          • S Stefan_Lang

            That point is moot: I said the language designers shouldn't have put goto into C#. If you're so strained about performance, why do you even use C# to start with?

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #65

            Stefan_Lang wrote:

            If you're so strained about performance, why do you even use C# to start with?

            That statement of course makes no sense. The performance of an application or even an enterprise system might be dependent on a language choice. But of course it is even more dependent on requirements, architecture and design. Conversely this discussion related to goto would only be relevent to optimizing the performance of code. And of course one might wish to optimize any section of code regardless of language choice.

            S 1 Reply Last reply
            0
            • S Stefan_Lang

              *shrug* There was a time where I would contemplate other peoples programming styles in published media and maybe adapt some of it. But I have long since realized that everyone makes mistakes and just because something is published doesn't mean it's good. That said, I have to point out, again, that my argument was about language designers putting the goto command into a language, not programmers using what language designers gave them.

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #66

              Stefan_Lang wrote:

              There was a time where I would contemplate other peoples programming styles in published media and maybe adapt some of it. But I have long since realized that everyone makes mistakes and just because something is published doesn't mean it's good.

              Which of course has nothing to do with what I said.

              S 1 Reply Last reply
              0
              • J jschell

                Stefan_Lang wrote:

                There was a time where I would contemplate other peoples programming styles in published media and maybe adapt some of it. But I have long since realized that everyone makes mistakes and just because something is published doesn't mean it's good.

                Which of course has nothing to do with what I said.

                S Offline
                S Offline
                Stefan_Lang
                wrote on last edited by
                #67

                That's what you said: There was an article/column in the C\C++ users Journal in that time period that was implementing printf (or maybe sprintf) which is part of the standard C library and it used goto quite a bit. Since you seemed to be basing your argumentation on the example of that article I was making a point that some old article is not a valid argument from my PoV.

                J 1 Reply Last reply
                0
                • J jschell

                  Stefan_Lang wrote:

                  If you're so strained about performance, why do you even use C# to start with?

                  That statement of course makes no sense. The performance of an application or even an enterprise system might be dependent on a language choice. But of course it is even more dependent on requirements, architecture and design. Conversely this discussion related to goto would only be relevent to optimizing the performance of code. And of course one might wish to optimize any section of code regardless of language choice.

                  S Offline
                  S Offline
                  Stefan_Lang
                  wrote on last edited by
                  #68

                  jschell wrote:

                  That statement of course makes no sense.

                  Do I really have to point out the known facts about performance differences between C++ and C#? Or the consequences of having a garbage collection block vital threads in a real time system?

                  jschell wrote:

                  The performance of an application or even an enterprise system might be dependent on a language choice. But of course it is even more dependent on ....

                  You were the one who based your performance argument solely on the language, and more specifically on the availability of the goto command, not I. So you were assuming that to be a mandatory requirement as well. I think it's about time for me to step out of the discussion at this point. You seem capabale of countering your own arguments without my help just fine. ;P

                  J 1 Reply Last reply
                  0
                  • S Stefan_Lang

                    jschell wrote:

                    That statement of course makes no sense.

                    Do I really have to point out the known facts about performance differences between C++ and C#? Or the consequences of having a garbage collection block vital threads in a real time system?

                    jschell wrote:

                    The performance of an application or even an enterprise system might be dependent on a language choice. But of course it is even more dependent on ....

                    You were the one who based your performance argument solely on the language, and more specifically on the availability of the goto command, not I. So you were assuming that to be a mandatory requirement as well. I think it's about time for me to step out of the discussion at this point. You seem capabale of countering your own arguments without my help just fine. ;P

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #69

                    Stefan_Lang wrote:

                    Do I really have to point out the known facts about performance differences between C++ and C#? Or the consequences of having a garbage collection block vital threads in a real time system?

                    That of course has nothing to do with optimizing a method. Perhaps you are not aware that this same discussion can apply to C++ as well?

                    Stefan_Lang wrote:

                    You were the one who based your performance argument solely on the language,

                    Wrong. I suggest you re-read what I posted and what I responded to.

                    Stefan_Lang wrote:

                    and more specifically on the availability of the goto command, not I.

                    Wrong. I specifically responded to your comment that booleans and conditional checks were just as good as goto.

                    S 1 Reply Last reply
                    0
                    • S Stefan_Lang

                      That's what you said: There was an article/column in the C\C++ users Journal in that time period that was implementing printf (or maybe sprintf) which is part of the standard C library and it used goto quite a bit. Since you seemed to be basing your argumentation on the example of that article I was making a point that some old article is not a valid argument from my PoV.

                      J Offline
                      J Offline
                      jschell
                      wrote on last edited by
                      #70

                      Stefan_Lang wrote:

                      That's what you said:

                      That is not all I said. My point was that based on that article MY interpretation of it was that implementatino presented there was better than the possible alternatives.

                      1 Reply Last reply
                      0
                      • J jschell

                        Stefan_Lang wrote:

                        Do I really have to point out the known facts about performance differences between C++ and C#? Or the consequences of having a garbage collection block vital threads in a real time system?

                        That of course has nothing to do with optimizing a method. Perhaps you are not aware that this same discussion can apply to C++ as well?

                        Stefan_Lang wrote:

                        You were the one who based your performance argument solely on the language,

                        Wrong. I suggest you re-read what I posted and what I responded to.

                        Stefan_Lang wrote:

                        and more specifically on the availability of the goto command, not I.

                        Wrong. I specifically responded to your comment that booleans and conditional checks were just as good as goto.

                        S Offline
                        S Offline
                        Stefan_Lang
                        wrote on last edited by
                        #71

                        Ok, the way threads are displayed in this forum when trying to respond to a comment unfortunately hides most of the history. (is there a way to prevent it from folding? I've always found that very annoying, and never really helpful). It appears that while my memory served me right in that I wasn't the one to bring up the topic of performance, nevertheless it wasn't you, either. Sorry for bringing it to your door. Anyway, this is my last comment to this thread. I've made my points, you made yours. Obviously we disagree. Be that as it may.

                        J 1 Reply Last reply
                        0
                        • S Stefan_Lang

                          Ok, the way threads are displayed in this forum when trying to respond to a comment unfortunately hides most of the history. (is there a way to prevent it from folding? I've always found that very annoying, and never really helpful). It appears that while my memory served me right in that I wasn't the one to bring up the topic of performance, nevertheless it wasn't you, either. Sorry for bringing it to your door. Anyway, this is my last comment to this thread. I've made my points, you made yours. Obviously we disagree. Be that as it may.

                          J Offline
                          J Offline
                          jschell
                          wrote on last edited by
                          #72

                          Stefan_Lang wrote:

                          Ok, the way threads are displayed in this forum when trying to respond to a comment unfortunately hides most of the history. (is there a way to prevent it from folding? I've always found that very annoying, and never really helpful).

                          I agree with that.

                          1 Reply Last reply
                          0
                          • S Stefan_Lang

                            I still don't get why any modern language needs goto at all. goto is a first generation language command. It was already bad for procedural programming, worse for OO, and catastrophic for anything involving multithreading. Not to mention functional programming.

                            T Offline
                            T Offline
                            Toyist
                            wrote on last edited by
                            #73

                            In the end it's all goto's. The processor turns everything into a goto to a memory address or register. Contained within a procedural function a goto is much more efficent than a bunch of if-then-else's or cases. It is also much more readable to an experienced programmer when used properly. Goto's are not bad; misuse or no use is poor practice.

                            S 1 Reply Last reply
                            0
                            • T Toyist

                              In the end it's all goto's. The processor turns everything into a goto to a memory address or register. Contained within a procedural function a goto is much more efficent than a bunch of if-then-else's or cases. It is also much more readable to an experienced programmer when used properly. Goto's are not bad; misuse or no use is poor practice.

                              S Offline
                              S Offline
                              Stefan_Lang
                              wrote on last edited by
                              #74

                              In the beginning was darkness. And God said, let there be goto ... Hmm, I think it wasn't quite like that ;) What I meant to say is just because in the end there are gotos doesn't mean they should be there from the beginning. In this case I was arguing about goto being in the language C# in the first place. Remember, this thread is about language, not about what programmers (or the compiler) makes of it.

                              1 Reply Last reply
                              0
                              • F Fran Porretto

                                I've heard a great deal of praise heaped on C#, but in my encounters with it to this point, I've always come away bruised. In part, that's because it's still changing (and VS .NET with it). In part, it's because I'm a dinosaur who expects the facilities I've come to know and love to remain available and convenient when I "upgrade." But more significant than those reasons or any others is this one: I dislike being "protected from myself."

                                I like pointers.
                                I prefer permissive type conversions.
                                I'm a high expert at picking floating-point numbers apart from their binary representations. (Ever seen old-style IBM floating-point? What about CDC's 60-bit version?)
                                If I can't substitute an address for an integer or vice-versa, I'll throw a fit.
                                And don't you dare move something I've put in allocated memory! I'll do my own "garbage collection," thanks very much.

                                My first language was assembler on a PDP-9. I moved from there to the Data General NOVA 1200, still programming in assembler, and from there to the PDP-11, and then to the Intel 8080, 8085, and Zilog Z80, still programming in assembler. Over those years, various persons attempted to convert me to the glories of FORTRAN, Pascal, Algol, APL, PL/I, LISP, and Forth. I spurned them all: not one of them permitted me to do everything I felt I might need to do in some hypothetical situation. When I was introduced to C, for the first time I felt I could "go machine-independent" without losing the full freedom of the machine.

                                Today I program in C++ and microcode for special-purpose devices. I'm uninterested in C#, Ada, or any other language that attempts to restrict what operations I can attempt. I find it puzzling that other software engineers are willing to accept such shackles. But hey, I told you already: I'm a dinosaur.

                                I wonder if you'll miss my sort when we're completely extinct...

                                (This message is programming you in ways you cannot detect. Be afraid.)

                                S Offline
                                S Offline
                                stevev6
                                wrote on last edited by
                                #75

                                There are a few other things to think about here: 1) us dinosaurs lived through the debacle of P-Code. .NET is just another attempt at that solution. It is more successful because they have quad-core, multi-giga hertz processors to over-power their ineptitude. Because we lived through it, we find it difficult to embrace it again./ Maybe in a few years... 2) us dinosaurs lived through the first garbage collectors too. The ones that would lock-up your display for 30-60 seconds at a (random) time. We find it difficult to go back to those bad old days just because of more powerful processors make the lock up less than a second. 3) Redmond had to have C pound. They had a horrible time trying to be compliant with the C++ international standard language and library. And it only changed every ten years. You can't sell compilers when it only changes every ten years. You gotta get your own language, pile your employees on the standardization board and "make it your own". Those bi-yearly changes will be well worth it. 4) remember, dinosaurs that have programmed professionally for 30 years didn't do that by not paying attention. They got burned early with new sexy languages and techniques and are a bit skeptical of 'the latest thing'. We experimented with C++ using C-Front because it offered real advantages. But it didn't get used in production for another five years. OOP & OOD were watched carefully and embraced as they matured. .NET may make it but it ain't there yet.

                                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