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.
  • L leppie

    Pete O'Hanlon wrote:

    As for ArrayList - you honestly like your code to perform badly? Do the terms boxing and unboxing mean anything to you?

    If you exclude value types, all the assumptions are invalid. Casting a reference type is as cheap as it gets.

    IronScheme
    ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

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

    leppie wrote:

    If you exclude value types

    And there's the rub. How much code do you have lying around that just targets reference types?

    *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

    L 1 Reply Last reply
    0
    • P Pete OHanlon

      leppie wrote:

      If you exclude value types

      And there's the rub. How much code do you have lying around that just targets reference types?

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #17

      Pete O'Hanlon wrote:

      How much code do you have lying around that just targets reference types?

      I think you rather mean, how much code you have lying around that does not use value types in non-generic containers? Big difference in the meaning. Anyways, in .NET 1.x, we all used type-safe arrays (when boxing/unboxing was costly), no problems there.

      IronScheme
      ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

      P 1 Reply Last reply
      0
      • L leppie

        Pete O'Hanlon wrote:

        How much code do you have lying around that just targets reference types?

        I think you rather mean, how much code you have lying around that does not use value types in non-generic containers? Big difference in the meaning. Anyways, in .NET 1.x, we all used type-safe arrays (when boxing/unboxing was costly), no problems there.

        IronScheme
        ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

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

        leppie wrote:

        I think you rather mean, how much code you have lying around that does not use value types in non-generic containers?

        Fair point, well made.

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        L 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          ArrayList was an abortion which should never have seen the light of day - particularly in a language that may be used for teaching. The generic List construct was a vast improvement. Personally, I would rather have seen goto restricted to unsafe blocks to make it harder for lazy people to use it...

          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

          G Offline
          G Offline
          GuyThiebaut
          wrote on last edited by
          #19

          Exactly the List construct is definitely the way to go! I started using arraylists etc and nowadays everything goes into a List and if I can I will make it a list of objects and unbox at the other end...

          “That which can be asserted without evidence, can be dismissed without evidence.”

          ― Christopher Hitchens

          1 Reply Last reply
          0
          • P Pete OHanlon

            leppie wrote:

            I think you rather mean, how much code you have lying around that does not use value types in non-generic containers?

            Fair point, well made.

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #20

            Pete O'Hanlon wrote:

            Fair point, well made.

            The answer is 'a lot'. Every time you use the ASP.NET, (pretty much) every value type gets boxed (specifically session, application states and request and response variables). The performance impact is minimal at best. To answer you previous question (pedantically): LOTS, everything in IronScheme is a reference type. All value types are boxed. Some of them like symbols and booleans and numbers from 1 - 1000 are also interned (so that makes equality simply a reference check). As for performance, I have not seen better options where boxing can be avoided. The extra indirection is more costly than unboxing.

            IronScheme
            ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

            P 2 Replies Last reply
            0
            • G gggustafson

              Over the many years that I have been programmer, I have detected a growing arrogance on the part of Microsoft employees. I find this strange because Microsoft depends so much upon its customer base. Yet, whenever some flaw is found in its software, Redmond is quick to argue that the bug is really a feature. This has occurred to me, personally, since Visual Studio 4. This arrogance spiked with the release of the C# programming language and its associated multiple .Net frameworks. Having been a member of the X3J9 Pascal technical committee (circa 1978), I am aware of what makes a “good” programming language. We teach these attributes to serious students of language design. Unfortunately, Redmond either didn’t take the classes or neglected their import. As a result, we have C# in its fourth generation (surprisingly not called "C#-4GL"). Generics, LINQ, and so forth have been added. Unfortunately, they were not part of the original C# language. They are "corrections" to missteps taken by Redmond in its attempt to be all things to all people. And they make my programming job much more difficult. I truly would like to see a new, simple, stripped-down version of C#. What I liked the most with the original C# language were the ArrayList and garbage collection. I believe that all the rest is unnecessary object oriented revenge. Peace.

              Gus Gustafson

              B Offline
              B Offline
              BobJanova
              wrote on last edited by
              #21

              Generics are awesome and were a fairly bad omission from the original release, imo. The C# implementation is very good and they make it much easier to write type safe, efficient, clean code. LINQ, lambdas etc are just syntactic sugar and as long as you can read them, you don't have to bother learning how to write them, but they can increase elegance markedly when used appropriately. I don't agree with you at all, really, I think that the evolution of C# has been positive and made it an easier language to use.

              T 1 Reply Last reply
              0
              • L leppie

                Pete O'Hanlon wrote:

                Fair point, well made.

                The answer is 'a lot'. Every time you use the ASP.NET, (pretty much) every value type gets boxed (specifically session, application states and request and response variables). The performance impact is minimal at best. To answer you previous question (pedantically): LOTS, everything in IronScheme is a reference type. All value types are boxed. Some of them like symbols and booleans and numbers from 1 - 1000 are also interned (so that makes equality simply a reference check). As for performance, I have not seen better options where boxing can be avoided. The extra indirection is more costly than unboxing.

                IronScheme
                ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

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

                leppie wrote:

                Every time you use the ASP.NET, (pretty much)

                And yet another reason for me to rejoice that I don't write ASP.NET applications.

                *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                1 Reply Last reply
                0
                • L leppie

                  Pete O'Hanlon wrote:

                  Fair point, well made.

                  The answer is 'a lot'. Every time you use the ASP.NET, (pretty much) every value type gets boxed (specifically session, application states and request and response variables). The performance impact is minimal at best. To answer you previous question (pedantically): LOTS, everything in IronScheme is a reference type. All value types are boxed. Some of them like symbols and booleans and numbers from 1 - 1000 are also interned (so that makes equality simply a reference check). As for performance, I have not seen better options where boxing can be avoided. The extra indirection is more costly than unboxing.

                  IronScheme
                  ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

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

                  leppie wrote:

                  LOTS, everything in IronScheme is a reference type.

                  OK, I know you're being pedantic here, but replace IronScheme with C# - as this thread is about C# and not IronScheme.

                  *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                  "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  L 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    leppie wrote:

                    LOTS, everything in IronScheme is a reference type.

                    OK, I know you're being pedantic here, but replace IronScheme with C# - as this thread is about C# and not IronScheme.

                    *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #24

                    Pete O'Hanlon wrote:

                    as this thread is about C# and not IronScheme.

                    40% of IronScheme is written in C#. Same rules apply :)

                    IronScheme
                    ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

                    1 Reply Last reply
                    0
                    • C CPallini

                      Pete O'Hanlon wrote:

                      Now, if you'd picked on the var keyword, I'd have had to agree

                      But I would disagree, then. :)

                      Veni, vidi, vici.

                      G Offline
                      G Offline
                      gggustafson
                      wrote on last edited by
                      #25

                      I would have had space allowed :)

                      Gus Gustafson

                      1 Reply Last reply
                      0
                      • OriginalGriffO OriginalGriff

                        ArrayList was an abortion which should never have seen the light of day - particularly in a language that may be used for teaching. The generic List construct was a vast improvement. Personally, I would rather have seen goto restricted to unsafe blocks to make it harder for lazy people to use it...

                        Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

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

                        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.

                        OriginalGriffO A J T 4 Replies 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.

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

                          Because sometimes - very, very rarely - it is the best thing to do. It can save a mess of "get me out of here" bools, and a lot of otherwise unnecessary testing. Having said that, I haven't needed to use it in at least ten years - and I wish teachers were less lazy and didn't start with it on day one to make their lives easier...

                          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                          "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

                          S P 2 Replies Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            Because sometimes - very, very rarely - it is the best thing to do. It can save a mess of "get me out of here" bools, and a lot of otherwise unnecessary testing. Having said that, I haven't needed to use it in at least ten years - and I wish teachers were less lazy and didn't start with it on day one to make their lives easier...

                            Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

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

                            I've heard that argument over and over again. While I can perfectly understand that notion when I look at certain pieces of code, the fact that the code is so convoluted that goto is considered the best way to get out of it, is a very strong indication that you should refactor that code, not use goto. goto is a short circuit. That's the kind of thing a good programmer strives to avoid. Using it intentionally is reserved for dubious causes such as stealing a car. ;) P.S.: saying it may be 'the best thing to do' implies that there are other options. In my experience, programmers telling me 'that it's the best' judge it to be the best for all the wrong reasons. But anyway, it's at least partially subjective. In 26 years of C++ programming I've yet to see a piece of code that convinces me of using goto, but that's just me. Others may have different preferences.

                            OriginalGriffO C J 3 Replies Last reply
                            0
                            • S Stefan_Lang

                              I've heard that argument over and over again. While I can perfectly understand that notion when I look at certain pieces of code, the fact that the code is so convoluted that goto is considered the best way to get out of it, is a very strong indication that you should refactor that code, not use goto. goto is a short circuit. That's the kind of thing a good programmer strives to avoid. Using it intentionally is reserved for dubious causes such as stealing a car. ;) P.S.: saying it may be 'the best thing to do' implies that there are other options. In my experience, programmers telling me 'that it's the best' judge it to be the best for all the wrong reasons. But anyway, it's at least partially subjective. In 26 years of C++ programming I've yet to see a piece of code that convinces me of using goto, but that's just me. Others may have different preferences.

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

                              I agree. But the fact is there is code that you can't refactor for one reason or another: time is the most common. Or efficiency in a time critical segment. It's there. But don't use it until you are experienced enough to understand why it is a bad idea to do so...

                              Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                              "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

                              S 1 Reply Last reply
                              0
                              • OriginalGriffO OriginalGriff

                                I agree. But the fact is there is code that you can't refactor for one reason or another: time is the most common. Or efficiency in a time critical segment. It's there. But don't use it until you are experienced enough to understand why it is a bad idea to do so...

                                Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

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

                                :sigh: Yes, indeed. You don't always get the time required to get your code clean. I can in fact understand that in such circumstances you may feel forced to stick with goto. That however doesn't justify to make it available as part of a new language. Regarding efficiency I disagree though: you can always store the condition that you would use to trigger a goto in a boolean variale and then just skip over the remaining blocks of code. That takes virtually no time at all. That's what I usually do.

                                OriginalGriffO K J 3 Replies Last reply
                                0
                                • S Stefan_Lang

                                  :sigh: Yes, indeed. You don't always get the time required to get your code clean. I can in fact understand that in such circumstances you may feel forced to stick with goto. That however doesn't justify to make it available as part of a new language. Regarding efficiency I disagree though: you can always store the condition that you would use to trigger a goto in a boolean variale and then just skip over the remaining blocks of code. That takes virtually no time at all. That's what I usually do.

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

                                  Sometimes, "virtually no time at all" is still too much! :laugh: You can tell I grew up in an Embedded environment, can't you? :-D

                                  Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                                  "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

                                  S 1 Reply Last reply
                                  0
                                  • OriginalGriffO OriginalGriff

                                    Sometimes, "virtually no time at all" is still too much! :laugh: You can tell I grew up in an Embedded environment, can't you? :-D

                                    Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

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

                                    Been there, done that. ;)

                                    1 Reply Last reply
                                    0
                                    • G gggustafson

                                      Over the many years that I have been programmer, I have detected a growing arrogance on the part of Microsoft employees. I find this strange because Microsoft depends so much upon its customer base. Yet, whenever some flaw is found in its software, Redmond is quick to argue that the bug is really a feature. This has occurred to me, personally, since Visual Studio 4. This arrogance spiked with the release of the C# programming language and its associated multiple .Net frameworks. Having been a member of the X3J9 Pascal technical committee (circa 1978), I am aware of what makes a “good” programming language. We teach these attributes to serious students of language design. Unfortunately, Redmond either didn’t take the classes or neglected their import. As a result, we have C# in its fourth generation (surprisingly not called "C#-4GL"). Generics, LINQ, and so forth have been added. Unfortunately, they were not part of the original C# language. They are "corrections" to missteps taken by Redmond in its attempt to be all things to all people. And they make my programming job much more difficult. I truly would like to see a new, simple, stripped-down version of C#. What I liked the most with the original C# language were the ArrayList and garbage collection. I believe that all the rest is unnecessary object oriented revenge. Peace.

                                      Gus Gustafson

                                      T Offline
                                      T Offline
                                      Thornik
                                      wrote on last edited by
                                      #33

                                      Agree completely. MS just makes money, they don't care how ugly their design is - worse design they make, more money they get on "bug fixes" (named "service packs"). This is why there is a big reason to leave M$ with their hindu gang of diletants and gays and move to the D language - also with GC, lot of collection classes, but w/o those slow monster ".NET".

                                      1 Reply Last reply
                                      0
                                      • B BobJanova

                                        Generics are awesome and were a fairly bad omission from the original release, imo. The C# implementation is very good and they make it much easier to write type safe, efficient, clean code. LINQ, lambdas etc are just syntactic sugar and as long as you can read them, you don't have to bother learning how to write them, but they can increase elegance markedly when used appropriately. I don't agree with you at all, really, I think that the evolution of C# has been positive and made it an easier language to use.

                                        T Offline
                                        T Offline
                                        Thornik
                                        wrote on last edited by
                                        #34

                                        Problem is if you start building a home on a sh*t mountain, soon or later your building goes down under features. Same with C#: either you add _valuable_ feature and have to rebuild a whole .NET to support it, or you make trivial syntactic sugar just to keep bad designed .NET on the surface. What you named "positive" doesn't mean "valuably positive". Moreover - a lot of stuff in .NET is written based on ugly .NET 1.1 classes. Having modern C# it's ridiculous to see old rubbish we have to use. At least generics are absolutely unavoidable in any proper language (like D) - it's "base" for so many algorithms, that missing this feature like reinventing BASIC language! Same rubbish, but with C-syntax.

                                        1 Reply Last reply
                                        0
                                        • G gggustafson

                                          Over the many years that I have been programmer, I have detected a growing arrogance on the part of Microsoft employees. I find this strange because Microsoft depends so much upon its customer base. Yet, whenever some flaw is found in its software, Redmond is quick to argue that the bug is really a feature. This has occurred to me, personally, since Visual Studio 4. This arrogance spiked with the release of the C# programming language and its associated multiple .Net frameworks. Having been a member of the X3J9 Pascal technical committee (circa 1978), I am aware of what makes a “good” programming language. We teach these attributes to serious students of language design. Unfortunately, Redmond either didn’t take the classes or neglected their import. As a result, we have C# in its fourth generation (surprisingly not called "C#-4GL"). Generics, LINQ, and so forth have been added. Unfortunately, they were not part of the original C# language. They are "corrections" to missteps taken by Redmond in its attempt to be all things to all people. And they make my programming job much more difficult. I truly would like to see a new, simple, stripped-down version of C#. What I liked the most with the original C# language were the ArrayList and garbage collection. I believe that all the rest is unnecessary object oriented revenge. Peace.

                                          Gus Gustafson

                                          F Offline
                                          F Offline
                                          Fran Porretto
                                          wrote on last edited by
                                          #35

                                          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.)

                                          R J C S 4 Replies 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