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. I don't see sharp anymore, ...

I don't see sharp anymore, ...

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpquestioncareer
7 Posts 5 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.
  • B Offline
    B Offline
    Bernhard Hiller
    wrote on last edited by
    #1

    ... but the C# compiler doesn't complain, so it's likely valid code:

    Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> MyTypes = new Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>>();

    Why should you define a class when you can do the job with built-in types? :^)

    J L N P 4 Replies Last reply
    0
    • B Bernhard Hiller

      ... but the C# compiler doesn't complain, so it's likely valid code:

      Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> MyTypes = new Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>>();

      Why should you define a class when you can do the job with built-in types? :^)

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

      Quick, get him back to front end.

      Wrong is evil and must be defeated. - Jeff Ello

      1 Reply Last reply
      0
      • B Bernhard Hiller

        ... but the C# compiler doesn't complain, so it's likely valid code:

        Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> MyTypes = new Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>>();

        Why should you define a class when you can do the job with built-in types? :^)

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

        MyType isn't a built-in type, so he defined a class.

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

        B 1 Reply Last reply
        0
        • B Bernhard Hiller

          ... but the C# compiler doesn't complain, so it's likely valid code:

          Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> MyTypes = new Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>>();

          Why should you define a class when you can do the job with built-in types? :^)

          N Offline
          N Offline
          Nathan Minier
          wrote on last edited by
          #4

          I've...err....done something like that before. I'm not proud of it, and in my defense I was about 10 min from presentation and found a bug, but still....

          "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

          1 Reply Last reply
          0
          • L Lost User

            MyType isn't a built-in type, so he defined a class.

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

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            Oh dear, shame on me! What prevented me from seeing that - the code or my presbyopia? :-\

            L 1 Reply Last reply
            0
            • B Bernhard Hiller

              Oh dear, shame on me! What prevented me from seeing that - the code or my presbyopia? :-\

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

              public class MyComplexType: Dictionary>>>
              {
              }

              So, a new MyComplexType would make this more "readable"? :p

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

              1 Reply Last reply
              0
              • B Bernhard Hiller

                ... but the C# compiler doesn't complain, so it's likely valid code:

                Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> MyTypes = new Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>>();

                Why should you define a class when you can do the job with built-in types? :^)

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

                Nothing wrong with that, but maybe use an alias instead. Would you prefer:

                class MyTypeCollection : Dictionary<string, List<Tuple<string, DateTime, List<MyType>>>> {}

                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