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. We need more keys!

We need more keys!

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasesalesannouncement
13 Posts 7 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.
  • F fjdiewornncalwe

    Take a peek at some VB. That should at least replace the horror with one that is at least expected.

    I wasn't, now I am, then I won't be anymore.

    Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #3

    As a VB programmer I see my share of VB... Seen many horrors as well (VB6 and even pre-VB4 practices in .NET) ;) I have no doubt there is legacy C# code that is as bad as legacy VB code or even worse though. In the end code is as good as the programmer writes it, independent of the language ;)

    It's an OO world.

    public class Naerling : Lazy<Person>{}

    F B 2 Replies Last reply
    0
    • Sander RosselS Sander Rossel

      As a VB programmer I see my share of VB... Seen many horrors as well (VB6 and even pre-VB4 practices in .NET) ;) I have no doubt there is legacy C# code that is as bad as legacy VB code or even worse though. In the end code is as good as the programmer writes it, independent of the language ;)

      It's an OO world.

      public class Naerling : Lazy<Person>{}

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #4

      touche.... There is definitely some horrible C# code out there. For that matter, horrible code exists in every language. I equate that to people of any given language who have no understanding of grammar, syntax or punctuation. I have a lot of vb and vb.net systems that I work with daily as well. I tend to find that vb lends itself to being ugly by nature which is why I prefer C# and C++ to vb.

      I wasn't, now I am, then I won't be anymore.

      Sander RosselS 1 Reply Last reply
      0
      • F fjdiewornncalwe

        touche.... There is definitely some horrible C# code out there. For that matter, horrible code exists in every language. I equate that to people of any given language who have no understanding of grammar, syntax or punctuation. I have a lot of vb and vb.net systems that I work with daily as well. I tend to find that vb lends itself to being ugly by nature which is why I prefer C# and C++ to vb.

        I wasn't, now I am, then I won't be anymore.

        Sander RosselS Offline
        Sander RosselS Offline
        Sander Rossel
        wrote on last edited by
        #5

        When programming VB just make sure to uncheck the VisualBasic Namespace reference and put Option Strict on. That's the first step in the right direction! :thumbsup:

        It's an OO world.

        public class Naerling : Lazy<Person>{}

        1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          As a VB programmer I see my share of VB... Seen many horrors as well (VB6 and even pre-VB4 practices in .NET) ;) I have no doubt there is legacy C# code that is as bad as legacy VB code or even worse though. In the end code is as good as the programmer writes it, independent of the language ;)

          It's an OO world.

          public class Naerling : Lazy<Person>{}

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

          Some languages make it easier or harder than others to write good/bad code, though.

          Sander RosselS 1 Reply Last reply
          0
          • Sander RosselS Sander Rossel

            I just came across an SQL table with 10 columns of which 7 formed the Primary Key... :wtf: No further indexing/unique contraints applied. No Foreign Key Relationships (at all) where they were very obviously necessary. Redundant information that was already stored in the table that this table should have related too (and almost inevitably were part of the PK)... This was just a small table that held some additional information on invoices (the table which it should have related to) :sigh: Appearently this is how the table was described in the specifications of the customer... Well, I've got news for them! We don't work that way! A shame this table came to be at all... :(( What has been seen can't be unseen. I will undoubtedly have some nightmares about this :( Edit: To give a small indication of how bad things really are, one of the PK columns was a varchar(50) X|

            It's an OO world.

            public class Naerling : Lazy<Person>{}

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #7

            Any chance at getting to normalize the table? If met with resistance from the customer about normalizing, sell the idea of performance benefits.

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

            Sander RosselS 1 Reply Last reply
            0
            • B BobJanova

              Some languages make it easier or harder than others to write good/bad code, though.

              Sander RosselS Offline
              Sander RosselS Offline
              Sander Rossel
              wrote on last edited by
              #8

              True, but neither VB nor C# prevents you from writing code as it should be :) I'm a VB programmer most of the time, but you don't see me using OnErrorResumeNext or GoTo. And an empty try catch block is just as easy to write in C# as in VB.

              It's an OO world.

              public class Naerling : Lazy<Person>{}

              F 1 Reply Last reply
              0
              • P Paul Conrad

                Any chance at getting to normalize the table? If met with resistance from the customer about normalizing, sell the idea of performance benefits.

                "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #9

                Yeah, it's going to be okay. Luckily. I found another table like that today (it's all the same schema, so we know where it's wrong). Seriously, no table in the schema has any FK's. A few tables are like the one I described. And this is a vital part of our system! X|

                It's an OO world.

                public class Naerling : Lazy<Person>{}

                P 1 Reply Last reply
                0
                • Sander RosselS Sander Rossel

                  True, but neither VB nor C# prevents you from writing code as it should be :) I'm a VB programmer most of the time, but you don't see me using OnErrorResumeNext or GoTo. And an empty try catch block is just as easy to write in C# as in VB.

                  It's an OO world.

                  public class Naerling : Lazy<Person>{}

                  F Offline
                  F Offline
                  fjdiewornncalwe
                  wrote on last edited by
                  #10

                  Naerling wrote:

                  but you don't see me using OnErrorResumeNext or GoTo

                  If you did and I found out, you's get a virtual slap through the monitor from me... :)

                  I wasn't, now I am, then I won't be anymore.

                  1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    I just came across an SQL table with 10 columns of which 7 formed the Primary Key... :wtf: No further indexing/unique contraints applied. No Foreign Key Relationships (at all) where they were very obviously necessary. Redundant information that was already stored in the table that this table should have related too (and almost inevitably were part of the PK)... This was just a small table that held some additional information on invoices (the table which it should have related to) :sigh: Appearently this is how the table was described in the specifications of the customer... Well, I've got news for them! We don't work that way! A shame this table came to be at all... :(( What has been seen can't be unseen. I will undoubtedly have some nightmares about this :( Edit: To give a small indication of how bad things really are, one of the PK columns was a varchar(50) X|

                    It's an OO world.

                    public class Naerling : Lazy<Person>{}

                    S Offline
                    S Offline
                    Super Lloyd
                    wrote on last edited by
                    #11

                    You're right, it's not how we do things here, following procedure would require at least 10 primary key column! :P Remember, it's more important to follow procedure than being actually productive! ;)

                    A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                    1 Reply Last reply
                    0
                    • F fjdiewornncalwe

                      Take a peek at some VB. That should at least replace the horror with one that is at least expected.

                      I wasn't, now I am, then I won't be anymore.

                      H Offline
                      H Offline
                      Hermanito72
                      wrote on last edited by
                      #12

                      A truly talented programmer can mess things up in any language, not only VB :-D

                      1 Reply Last reply
                      0
                      • Sander RosselS Sander Rossel

                        Yeah, it's going to be okay. Luckily. I found another table like that today (it's all the same schema, so we know where it's wrong). Seriously, no table in the schema has any FK's. A few tables are like the one I described. And this is a vital part of our system! X|

                        It's an OO world.

                        public class Naerling : Lazy<Person>{}

                        P Offline
                        P Offline
                        prasun r
                        wrote on last edited by
                        #13

                        I have once worked with a customer database that had tables with 40 columns, no FK and PK of type varchar(50). Heck the Names column was primary key, when I asked the client what'll happen if another guy joins the Org with same name as his, he was shell shocked. :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