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 Weird and The Wonderful
  4. Convert.ToInt32

Convert.ToInt32

Scheduled Pinned Locked Moved The Weird and The Wonderful
visual-studiocom
29 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.
  • R robocodeboy

    Oh, and BTW KeyValuePair is not a vector. It's only a Dictionary item. You could use it to store two strings, but you probably would be better set implementing a class with two members, x and y.

    A Offline
    A Offline
    Argonia
    wrote on last edited by
    #20

    My point was that i needed List> somesh*t = new List>(); for my vector. There is a Pair structure defined in System.Web.UI.Pair namespace. Who the hell does that. Define the same thing under different name in different namespace, oh, wait M$ Now you have 3 things for pair -Tuple - up to 7 items cuz you never know if the programmer can make 7 items list with Pair alone -KeyValuePair -Pair When the last 2 are basically the same.

    Microsoft ... the only place where VARIANT_TRUE != true

    R 1 Reply Last reply
    0
    • A Argonia

      robocodeboy wrote:

      And an elegance in C# that is unknown to Java.

      You are mistaken c# doesn't have any elegance. The elegance you see is only part of the beauties of c and c++. But ofcouse M$ decided that not all is needed and they decided to leave some things (templates, pointers, friend, and so on) and call it a new language because they added few libraries.

      Microsoft ... the only place where VARIANT_TRUE != true

      R Offline
      R Offline
      robocodeboy
      wrote on last edited by
      #21

      Yes, of course. C++ is so elegant that his grammar is undecidable, and no IDE in the world can give you a decent code completion. But maybe you're Klingon and you remember variable names by heart. C is elegant, yes. Just as an haiku. I completely enjoyed writing really quick, incomprehensible code that did simple stuff in clever ways, but designing UIs in C or C++ is an exercise in pain. Not mentioning organizing and building complex projects. C++ templates can do some clever stuff, but generics are pretty similar and less prone to breaking apart your build time. The only thing I miss in C# are mixins, but they are hard to manage even in C++. Pointers are in C# too, but you don't need to use them, usually. You can, but only if you have tight loops to be optimized. Friend is useless if you have internal members and friend assemblies. And private is considered more valuable than it is and not unit testable. Oh, and if "few libraries" means the single most extended library in existence yes, you are right. To one that makes this kind of statements, I can only suggest to (choose one in three): - RTFM and stop blaming others for what you get in the toolkit, instead of having to roll your own. - change language. Maybe the kind of stuff you're doing is not best suited for C# (I doubt, but...) - write your own language. You seem to be a world class language guru. Way better than that M$ scum. For sure you can tackle that task. A language is a tool, if you can't do stuff and blame the tool, either you change it or learn to use it. Blaming is easier (I remember people complaining about that stupid C compiler that was continually raising segmentation faults). Good luck!

      1 Reply Last reply
      0
      • A Argonia

        My point was that i needed List> somesh*t = new List>(); for my vector. There is a Pair structure defined in System.Web.UI.Pair namespace. Who the hell does that. Define the same thing under different name in different namespace, oh, wait M$ Now you have 3 things for pair -Tuple - up to 7 items cuz you never know if the programmer can make 7 items list with Pair alone -KeyValuePair -Pair When the last 2 are basically the same.

        Microsoft ... the only place where VARIANT_TRUE != true

        R Offline
        R Offline
        robocodeboy
        wrote on last edited by
        #22

        There is no point in what you're saying. There wasn't before and for sure there isn't in this. What do you have to do with that data? It's an x and y coordinates (like a vector) or it's simply two strings? Why an array string[2] is not ok? What you need to accomplish? And why aren't you creating a simple, 5 lines class to do that? With 2 properties x and y? Do I have to explain you the difference between those 3? It seems you cannot read the documentation... Don't blame the language, blame the programmer. Stop whining and read a book.

        A 1 Reply Last reply
        0
        • R robocodeboy

          There is no point in what you're saying. There wasn't before and for sure there isn't in this. What do you have to do with that data? It's an x and y coordinates (like a vector) or it's simply two strings? Why an array string[2] is not ok? What you need to accomplish? And why aren't you creating a simple, 5 lines class to do that? With 2 properties x and y? Do I have to explain you the difference between those 3? It seems you cannot read the documentation... Don't blame the language, blame the programmer. Stop whining and read a book.

          A Offline
          A Offline
          Argonia
          wrote on last edited by
          #23

          I was talking about this vector.

          Microsoft ... the only place where VARIANT_TRUE != true

          R 1 Reply Last reply
          0
          • A Argonia

            I was talking about this vector.

            Microsoft ... the only place where VARIANT_TRUE != true

            R Offline
            R Offline
            robocodeboy
            wrote on last edited by
            #24

            Hello? You there? You want a C++ style vector to store 2 values? Why should it change in size? You didn't studied even the stl, did you? This just proves that you don't know anything about the things you're writing and just keep whining about everything you don't get right in the first place (by pure chance). Why List<string> isn't fit? Or ArrayString, if you need not type checking? Why string[2] is not ok? If the 2 elements are really different things, why not write down a class with 2 properties? Noooo, let's just pretend you already know everything you need and bash the framework on the internet. I hope I'll never have to maintain your code.

            A 1 Reply Last reply
            0
            • R robocodeboy

              Hello? You there? You want a C++ style vector to store 2 values? Why should it change in size? You didn't studied even the stl, did you? This just proves that you don't know anything about the things you're writing and just keep whining about everything you don't get right in the first place (by pure chance). Why List<string> isn't fit? Or ArrayString, if you need not type checking? Why string[2] is not ok? If the 2 elements are really different things, why not write down a class with 2 properties? Noooo, let's just pretend you already know everything you need and bash the framework on the internet. I hope I'll never have to maintain your code.

              A Offline
              A Offline
              Argonia
              wrote on last edited by
              #25

              robocodeboy wrote:

              Why List<string> isn't fit? Or ArrayString, if you need not type checking?
              Why string[2] is not ok?
              If the 2 elements are really different things, why not write down a class with 2 properties?

              Because i have a pairs of 2 strings which i have to store and modify. Did you try making List type value ? I don't need a new class i have a structure defined already in c# (even 3 stuctures)

              Microsoft ... the only place where VARIANT_TRUE != true

              R 1 Reply Last reply
              0
              • A Argonia

                robocodeboy wrote:

                Why List<string> isn't fit? Or ArrayString, if you need not type checking?
                Why string[2] is not ok?
                If the 2 elements are really different things, why not write down a class with 2 properties?

                Because i have a pairs of 2 strings which i have to store and modify. Did you try making List type value ? I don't need a new class i have a structure defined already in c# (even 3 stuctures)

                Microsoft ... the only place where VARIANT_TRUE != true

                R Offline
                R Offline
                robocodeboy
                wrote on last edited by
                #26

                Either you're a troll or you don't know what you're talking about. Strings in C# are immutable anyway. But you can assign to List and array in which way you want.

                List<string> list = new List<string>() { "a", "b" };
                list\[0\] = "I";
                list\[1\] = "work";
                
                string\[\] array = new string\[2\] { "1", "2" };
                array\[0\] = "Me";
                array\[1\] = "too";
                
                1 Reply Last reply
                0
                • A Argonia

                  By M$ logic the point of using that kind of "useful" methods is when you call Convert.ToInt32 with object, dynamic or var variable you will always get Int32 as a result. P.S. Today i found one more reason to dislike c#. Who the hell had the brilliant idea to make Tuples read only ? And why the elephant ?

                  Microsoft ... the only place where VARIANT_TRUE != true

                  J Offline
                  J Offline
                  JMK89
                  wrote on last edited by
                  #27

                  Argonia wrote:

                  Who the hell had the brilliant idea to make Tuples read only?

                  er Eric Lippert[^]...but what does he know anyway!

                  1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    He doesn't want it to sink without trace...

                    L Offline
                    L Offline
                    Lutoslaw
                    wrote on last edited by
                    #28

                    OriginalGriff wrote:

                    He doesn't want it to sink without trace...

                    ...into the void.

                    Greetings - Jacek

                    1 Reply Last reply
                    0
                    • R Ravi Bhavnani

                      Wait - it gets weirder:  Convert.ToDouble (Double)[^] does the same thing! :) /ravi

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

                      L Offline
                      L Offline
                      Lutoslaw
                      wrote on last edited by
                      #29

                      Btw. a method Convert.ToSingle(Double) always makes me feel sad.

                      Greetings - Jacek

                      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