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. 10 ways to suck at programming

10 ways to suck at programming

Scheduled Pinned Locked Moved The Lounge
comquestion
31 Posts 21 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.
  • J J Dunlap

    I've dealt with a lot of those in inherited codebases. Some other ones:

    • Store the customer's entire selections and orders in the Session object, against numerous, sometimes arcanely-named keys. This way, the customer gets the surprise gift of having their whole order disappear shortly before they are ready to submit it.
    • You have direct access to the database, but why would you want to make it that simple? To properly express your genius, translate all of the data into an XML hierarchy that looks very little like the original data, and then make your code use that.
    • When accessing XML like the above, avoid using element names or XPath, and instead access XML nodes based on their indexes. That way every slight change that is made to the XML breaks the app horribly. Bonus points if you access the root node using XmlDocument.FirstChild so that it breaks inexplicably when an XML declaration is added.
    • Make as much use of tables as possible, and generate each individual table node manually using new TableRow() and new TableCell() and using a variable for each.
    • Generate as much Javascript in the codebehind as possible, including unrolling all of your loops when you could just enumerate a dataset.
    • To further make use of the CPU on your database server, create your data schema in such a way that even some of the smallest operations require stored procedures with expensive joins, cursor loops, lookups, and temporary tables. Then use more of these than necessary.
    B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #8

    J. Dunlap wrote:

    Generate as much Javascript in the codebehind as possible, including unrolling all of your loops when you could just enumerate a dataset.

    From my current inherited, registered in code nearly all forms, is OMGSCript[^] I think I'm still recovering, weeks after removing all traces of that from the codebase.

    J 1 Reply Last reply
    0
    • A Abhinav S

      Ravi Bhavnani wrote:

      author's misspelling of "rein"

      Nope. Could not find this wrong spelling. Maybe the author read your comment and fixed it. :)

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #9

      No he didn't.  The author misspelled "rein" as "reign". /ravi

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

      R M 2 Replies Last reply
      0
      • R Ravi Bhavnani

        No he didn't.  The author misspelled "rein" as "reign". /ravi

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

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #10

        A lot of people make that mistake, Ravi - even here. A lot of very bright people are complete morons when it comes to communicating in their native languages, too - including here. I try to overlook those little flaws and read the message hidden inside the misstatements. :-D Recipe for a happy life: Approach every article and conversation as you would a fortune cookie. Though the English will surely be bad, there just might be something in there you need to hear.

        "A Journey of a Thousand Rest Stops Begins with a Single Movement"

        R A 2 Replies Last reply
        0
        • R Ravi Bhavnani

          No he didn't.  The author misspelled "rein" as "reign". /ravi

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

          M Offline
          M Offline
          Mark_Wallace
          wrote on last edited by
          #11

          What's one little spelling mistake between coders? Anyway, I can't stop to chat; I have to decide whether to update the variable "NumberOfMillions" or "NumberOfBillions".

          I wanna be a eunuchs developer! Pass me a bread knife!

          R S 2 Replies Last reply
          0
          • B Brady Kelly

            J. Dunlap wrote:

            Generate as much Javascript in the codebehind as possible, including unrolling all of your loops when you could just enumerate a dataset.

            From my current inherited, registered in code nearly all forms, is OMGSCript[^] I think I'm still recovering, weeks after removing all traces of that from the codebase.

            J Offline
            J Offline
            J Dunlap
            wrote on last edited by
            #12

            My eyes! :eek:

            1 Reply Last reply
            0
            • M Mark_Wallace

              What's one little spelling mistake between coders? Anyway, I can't stop to chat; I have to decide whether to update the variable "NumberOfMillions" or "NumberOfBillions".

              I wanna be a eunuchs developer! Pass me a bread knife!

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #13

              It's no big deal - I was just pointing out the error, not judging the content of the blog post.  Btw, I agree with the author's sentiments, which is why I :thumbsup:'d Henry's original post. /ravi

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

              1 Reply Last reply
              0
              • R Roger Wright

                A lot of people make that mistake, Ravi - even here. A lot of very bright people are complete morons when it comes to communicating in their native languages, too - including here. I try to overlook those little flaws and read the message hidden inside the misstatements. :-D Recipe for a happy life: Approach every article and conversation as you would a fortune cookie. Though the English will surely be bad, there just might be something in there you need to hear.

                "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                R Offline
                R Offline
                Ravi Bhavnani
                wrote on last edited by
                #14

                Roger Wright wrote:

                Though the English will surely be bad, there just might be something in there you need to hear.

                Absolutely!  Which is why I :thumbsup:'d Henry's original post.  :) /ravi

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

                1 Reply Last reply
                0
                • H Henry Minute

                  I just found this[^]. A bitter, bitter man. With justification.

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  D Offline
                  D Offline
                  duwkes
                  wrote on last edited by
                  #15

                  I believe we've successfully slashdotted his server. We are now a force (of clickers) to be reckoned with! (his page finally returned after 2 minutes).

                  1 Reply Last reply
                  0
                  • H Henry Minute

                    I just found this[^]. A bitter, bitter man. With justification.

                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                    C Offline
                    C Offline
                    Chris Mankowski
                    wrote on last edited by
                    #16

                    I get page not found, so here is the cache http://webcache.googleusercontent.com/search?q=cache:uU9oWSy88q4J:www.finalint.com/2010/05/04/10-ways-to-suck-at-programming/+10-ways-to-suck-at-programming&cd=1&hl=en&ct=clnk&gl=us[^]

                    1 Reply Last reply
                    0
                    • H Henry Minute

                      I just found this[^]. A bitter, bitter man. With justification.

                      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                      T Offline
                      T Offline
                      turnkey commerce
                      wrote on last edited by
                      #17

                      You can view the cached copy here: Cached Copy at Google

                      1 Reply Last reply
                      0
                      • H Henry Minute

                        I just found this[^]. A bitter, bitter man. With justification.

                        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                        E Offline
                        E Offline
                        El Corazon
                        wrote on last edited by
                        #18

                        Every now and then the Daily News drags me back here... :-D (obviously not kicking and screaming - I didn't even scare the hamsters) I groaned, I laughed, I hung my head in pain.... oh the memories of 30 years of programming with other people's code (I debugged the high school's grading program because the business teacher said he knew more than me about programming, and he couldn't find out why GPA's were all zero (I was grounded before my Mother saw the actual grades -- luckily retracted)... I couldn't walk away from a challenge, even then... oh the current existence... I am working on the "I write self-documenting code, so I don't ever need to comment anything" guy... outside of taking forever to say his name that way, he's returned to 2-5 year old code and had to come to me for help understanding it. That has helped the very old argument in my favor, unfortunately it is still a pain... and I may be taking over some of his code-base soon X| I think #8 and #2 are the only two I don't have to deal with on a daily basis.... And that is because #2, almost no one in the group is checking for errors. :omg: Maybe I can eventually get that fixed.... :sigh:

                        _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                        H 1 Reply Last reply
                        0
                        • H Henry Minute

                          I just found this[^]. A bitter, bitter man. With justification.

                          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                          S Offline
                          S Offline
                          soyka
                          wrote on last edited by
                          #19

                          Well, inheriting such an app is bad. What's worse is when the culprit was you a few years ago. (I'm just rewriting my own intranet web app which I rolled out 2 years ago. When I look at the code I could throw up).

                          H 1 Reply Last reply
                          0
                          • H Henry Minute

                            I just found this[^]. A bitter, bitter man. With justification.

                            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                            S Offline
                            S Offline
                            starmerak
                            wrote on last edited by
                            #20

                            I miss the one about the not so lousy programmer who actually DO comment... sortof..

                            int i = 1; // sets i to 1

                            Nothing exists, everything is opinions..

                            1 Reply Last reply
                            0
                            • E El Corazon

                              Every now and then the Daily News drags me back here... :-D (obviously not kicking and screaming - I didn't even scare the hamsters) I groaned, I laughed, I hung my head in pain.... oh the memories of 30 years of programming with other people's code (I debugged the high school's grading program because the business teacher said he knew more than me about programming, and he couldn't find out why GPA's were all zero (I was grounded before my Mother saw the actual grades -- luckily retracted)... I couldn't walk away from a challenge, even then... oh the current existence... I am working on the "I write self-documenting code, so I don't ever need to comment anything" guy... outside of taking forever to say his name that way, he's returned to 2-5 year old code and had to come to me for help understanding it. That has helped the very old argument in my favor, unfortunately it is still a pain... and I may be taking over some of his code-base soon X| I think #8 and #2 are the only two I don't have to deal with on a daily basis.... And that is because #2, almost no one in the group is checking for errors. :omg: Maybe I can eventually get that fixed.... :sigh:

                              _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                              H Offline
                              H Offline
                              Henry Minute
                              wrote on last edited by
                              #21

                              El Corazon wrote:

                              Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                              I haven't seen you. OK? Nice to hear from you again tho'. Keep well!! :)

                              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                              E 1 Reply Last reply
                              0
                              • S soyka

                                Well, inheriting such an app is bad. What's worse is when the culprit was you a few years ago. (I'm just rewriting my own intranet web app which I rolled out 2 years ago. When I look at the code I could throw up).

                                H Offline
                                H Offline
                                Henry Minute
                                wrote on last edited by
                                #22

                                soyka wrote:

                                What's worse is when the culprit was you a few years ago.

                                I have just gone red with embarassment! :-D

                                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                1 Reply Last reply
                                0
                                • H Henry Minute

                                  I just found this[^]. A bitter, bitter man. With justification.

                                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                  P Offline
                                  P Offline
                                  Peter Laman
                                  wrote on last edited by
                                  #23

                                  Oh, there are many things to add to this list, like: -use exceptions for ALL conditions, not just the exceptional ones. It will kill performance even more. -Don't ever refactor code. -Make large, complex nested if/else structures, and initialize variables in almost every branch of it, so the reader will never now if variables have been initialized after that structures. -If a function requires more input, don't add parameters. It will require you to change all calls to it. Rather add a global variable... -Put many classes in a single source file and avoid the file name of that source file to make sure nobody will ever find your classes. And much more, sigh... And all of this really happens...

                                  1 Reply Last reply
                                  0
                                  • H Henry Minute

                                    El Corazon wrote:

                                    Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                                    I haven't seen you. OK? Nice to hear from you again tho'. Keep well!! :)

                                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                    E Offline
                                    E Offline
                                    El Corazon
                                    wrote on last edited by
                                    #24

                                    Henry Minute wrote:

                                    I haven't seen you. OK?

                                    :cool:

                                    Henry Minute wrote:

                                    Nice to hear from you again tho'.

                                    :cool:

                                    Henry Minute wrote:

                                    Keep well!!

                                    :jig: I am trying. :) Hope you are too. How's the lounge been?

                                    _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                                    H 1 Reply Last reply
                                    0
                                    • E El Corazon

                                      Henry Minute wrote:

                                      I haven't seen you. OK?

                                      :cool:

                                      Henry Minute wrote:

                                      Nice to hear from you again tho'.

                                      :cool:

                                      Henry Minute wrote:

                                      Keep well!!

                                      :jig: I am trying. :) Hope you are too. How's the lounge been?

                                      _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                                      H Offline
                                      H Offline
                                      Henry Minute
                                      wrote on last edited by
                                      #25

                                      El Corazon wrote:

                                      How's the lounge been?

                                      I've only just returned after a 4 month absence. I was out in the wilds with no internet access. It does seem for the most part to be up to its usual high standard though. Most of the regulars are still there (mostly laughing at Graus's inability to deal with anything technical) and a few good newcomers. Keeps me off the streets, anyway. :-D

                                      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                      1 Reply Last reply
                                      0
                                      • J J Dunlap

                                        I've dealt with a lot of those in inherited codebases. Some other ones:

                                        • Store the customer's entire selections and orders in the Session object, against numerous, sometimes arcanely-named keys. This way, the customer gets the surprise gift of having their whole order disappear shortly before they are ready to submit it.
                                        • You have direct access to the database, but why would you want to make it that simple? To properly express your genius, translate all of the data into an XML hierarchy that looks very little like the original data, and then make your code use that.
                                        • When accessing XML like the above, avoid using element names or XPath, and instead access XML nodes based on their indexes. That way every slight change that is made to the XML breaks the app horribly. Bonus points if you access the root node using XmlDocument.FirstChild so that it breaks inexplicably when an XML declaration is added.
                                        • Make as much use of tables as possible, and generate each individual table node manually using new TableRow() and new TableCell() and using a variable for each.
                                        • Generate as much Javascript in the codebehind as possible, including unrolling all of your loops when you could just enumerate a dataset.
                                        • To further make use of the CPU on your database server, create your data schema in such a way that even some of the smallest operations require stored procedures with expensive joins, cursor loops, lookups, and temporary tables. Then use more of these than necessary.
                                        E Offline
                                        E Offline
                                        ericfw
                                        wrote on last edited by
                                        #26

                                        Also use many global variables. Do not pass anything except flags as arguments to functions. When adding new functions just make new globals for them to reference. When using the flags, overload the bits as much as possible to avoid making new functions. For example, start with a simple boolean flag and then extend it by using negative numbers to mean 'more false-ness' and greater positive number to mean 'more true-ness'. Shortly you will no longer be able to tell chat the function does. Of course, that has its own solution. Just copy the function to a _v2 version and change that. Whatever you do, do not think the problem through from the beginning. Do not refactor the code. Never generalize a solution, or parameterize a function to make flexible.

                                        1 Reply Last reply
                                        0
                                        • R Roger Wright

                                          A lot of people make that mistake, Ravi - even here. A lot of very bright people are complete morons when it comes to communicating in their native languages, too - including here. I try to overlook those little flaws and read the message hidden inside the misstatements. :-D Recipe for a happy life: Approach every article and conversation as you would a fortune cookie. Though the English will surely be bad, there just might be something in there you need to hear.

                                          "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                                          A Offline
                                          A Offline
                                          Andre Sanches alvs
                                          wrote on last edited by
                                          #27

                                          Recipe for a happy life: Approach every article and conversation as you would a fortune cookie. Though the English will surely be bad, there just might be something in there you need to hear.

                                          Dude, THAT was inspiring! :)

                                          --------- Andre Sanches "UNIX is friendly, it's just picky about its friends"

                                          R 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