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. Thats why i hate c++

Thats why i hate c++

Scheduled Pinned Locked Moved The Weird and The Wonderful
c++helplearning
77 Posts 32 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.
  • V Vasily Tserekh

    When i was beggining to make some programs i had to make a small ellectronic book in c++. It started ok, i managed to make a reader and an editor and then came the worst error a programmer can have. When I compiled the program it went smoothly but when i openned it from windows it showed and internal error message whit no message. I suspected it was an I/O error because when i copied the program to c: or d: didnt showed the error but when i placed in other folder that wasnt the root it showed the error message

    V Offline
    V Offline
    Vasily Tserekh
    wrote on last edited by
    #2

    the ide was c++ builder 6

    G U S K 4 Replies Last reply
    0
    • V Vasily Tserekh

      When i was beggining to make some programs i had to make a small ellectronic book in c++. It started ok, i managed to make a reader and an editor and then came the worst error a programmer can have. When I compiled the program it went smoothly but when i openned it from windows it showed and internal error message whit no message. I suspected it was an I/O error because when i copied the program to c: or d: didnt showed the error but when i placed in other folder that wasnt the root it showed the error message

      J Offline
      J Offline
      jeron1
      wrote on last edited by
      #3

      Not sure what you're saying exactly, but one of the worst things IMHO, that a programmer can think is that program compilation has anything to do with program operation.

      V 1 Reply Last reply
      0
      • J jeron1

        Not sure what you're saying exactly, but one of the worst things IMHO, that a programmer can think is that program compilation has anything to do with program operation.

        V Offline
        V Offline
        Vasily Tserekh
        wrote on last edited by
        #4

        yes i know that but imagine that you cant trace an error because when you debug the executable it doesnt show up, what would you do?

        C OriginalGriffO M M 4 Replies Last reply
        0
        • V Vasily Tserekh

          yes i know that but imagine that you cant trace an error because when you debug the executable it doesnt show up, what would you do?

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #5

          Usually that means that there are environmental differences between your DEBUG running and the running that produces the errors. You need to figure out how to isolate these differences and determine why they are the cause of the error. Sometimes the addition of a logfile to write entries to, can help you narrow down the code that is failing. Oh and this isn't something that just happens to C++. It can happen with other languages too. :)

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

          V 1 Reply Last reply
          0
          • V Vasily Tserekh

            yes i know that but imagine that you cant trace an error because when you debug the executable it doesnt show up, what would you do?

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

            Chris is right - and it isn't even just software. A couple of times I have had problems with complex hardware prototypes not working - until you put an oscilloscope probe in the right place to monitor what the software is doing to it, and the problem goes away... That, my friend is when the nightmares start.

            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

            J L J M 4 Replies Last reply
            0
            • C Chris Meech

              Usually that means that there are environmental differences between your DEBUG running and the running that produces the errors. You need to figure out how to isolate these differences and determine why they are the cause of the error. Sometimes the addition of a logfile to write entries to, can help you narrow down the code that is failing. Oh and this isn't something that just happens to C++. It can happen with other languages too. :)

              Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

              V Offline
              V Offline
              Vasily Tserekh
              wrote on last edited by
              #7

              yes I know but at least in managed languages you get a nice error message not a blank error messsage, thats why I hate c++

              L C 2 Replies Last reply
              0
              • OriginalGriffO OriginalGriff

                Chris is right - and it isn't even just software. A couple of times I have had problems with complex hardware prototypes not working - until you put an oscilloscope probe in the right place to monitor what the software is doing to it, and the problem goes away... That, my friend is when the nightmares start.

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

                J Offline
                J Offline
                jeron1
                wrote on last edited by
                #8

                OriginalGriff wrote:

                That, my friend is when the nightmares start.

                [grimmace] Ahh, many a time in frustration have I yelled in agony suggested we ship a scope with each piece of hardware when god awful delightful scenario occurs. [/grimmace]

                1 Reply Last reply
                0
                • V Vasily Tserekh

                  yes I know but at least in managed languages you get a nice error message not a blank error messsage, thats why I hate c++

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

                  And what if that useless message comes out of some library or DLL you are using? How is C++ responsible for that? One thing is almost certain: You have some unclean code somewhere in there which you get away with in a debug build, but not in a release build. Like it or not, but you are going to have to find that code and then fix it.

                  At least artificial intelligence already is superior to natural stupidity

                  V 1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    Chris is right - and it isn't even just software. A couple of times I have had problems with complex hardware prototypes not working - until you put an oscilloscope probe in the right place to monitor what the software is doing to it, and the problem goes away... That, my friend is when the nightmares start.

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

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

                    Ahh, a Heisenbug :) Another good one is a race condition between threads where sometimes one and sometimes the other thread 'wins' the race.

                    At least artificial intelligence already is superior to natural stupidity

                    K 1 Reply Last reply
                    0
                    • OriginalGriffO OriginalGriff

                      Chris is right - and it isn't even just software. A couple of times I have had problems with complex hardware prototypes not working - until you put an oscilloscope probe in the right place to monitor what the software is doing to it, and the problem goes away... That, my friend is when the nightmares start.

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

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

                      I remember fixing unstable hardware by putting a probe onto the right place.

                      Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                      G 1 Reply Last reply
                      0
                      • L Lost User

                        And what if that useless message comes out of some library or DLL you are using? How is C++ responsible for that? One thing is almost certain: You have some unclean code somewhere in there which you get away with in a debug build, but not in a release build. Like it or not, but you are going to have to find that code and then fix it.

                        At least artificial intelligence already is superior to natural stupidity

                        V Offline
                        V Offline
                        Vasily Tserekh
                        wrote on last edited by
                        #12

                        there is no release and no debug, just a regular .exe that when is run from the IDE to debug it goes fine, but when you click it on windows it goes wrong

                        M 1 Reply Last reply
                        0
                        • V Vasily Tserekh

                          there is no release and no debug, just a regular .exe that when is run from the IDE to debug it goes fine, but when you click it on windows it goes wrong

                          M Offline
                          M Offline
                          Mohibur Rashid
                          wrote on last edited by
                          #13

                          Ouch buddy, you don't even know what are you talking about :doh: It must have to be either debug version or release version. as CDP1802 says, clean your code and stop complaining. and also try to figure out what is the differences and what is missing.

                          V 1 Reply Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            Chris is right - and it isn't even just software. A couple of times I have had problems with complex hardware prototypes not working - until you put an oscilloscope probe in the right place to monitor what the software is doing to it, and the problem goes away... That, my friend is when the nightmares start.

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

                            M Offline
                            M Offline
                            Mohibur Rashid
                            wrote on last edited by
                            #14

                            The boy is already trouble with CPP and you are threatening him with oscilloscope :laugh: How about forgetting to connect your circuit board with ground and your embedded device is not running at all :sigh:

                            L 1 Reply Last reply
                            0
                            • M Mohibur Rashid

                              Ouch buddy, you don't even know what are you talking about :doh: It must have to be either debug version or release version. as CDP1802 says, clean your code and stop complaining. and also try to figure out what is the differences and what is missing.

                              V Offline
                              V Offline
                              Vasily Tserekh
                              wrote on last edited by
                              #15

                              I surely know what i am talking about, HOW TO CLEAN A CODE THAT YOU CANT DEBUG. and surely you have ever worked with c++ builder 6, c++ builder doesnt have a debug and release version it only has a single output, instead of giving new ideas you talk about how good you are and how ignorant i am. I will make it simple so your mind can understand!!! step one -you write code step two -you compile that code step tree your ide launches the .exe and you try it step four you test your program and i does just fine step five you go to the application folder and make double click on the executable step six the application show and erro message with no error at all now you get it, how CAN YOU ISOLATE THE PROBLEM and when you isolate it what will you do if you can trace what is wrong

                              L B K P K 7 Replies Last reply
                              0
                              • V Vasily Tserekh

                                I surely know what i am talking about, HOW TO CLEAN A CODE THAT YOU CANT DEBUG. and surely you have ever worked with c++ builder 6, c++ builder doesnt have a debug and release version it only has a single output, instead of giving new ideas you talk about how good you are and how ignorant i am. I will make it simple so your mind can understand!!! step one -you write code step two -you compile that code step tree your ide launches the .exe and you try it step four you test your program and i does just fine step five you go to the application folder and make double click on the executable step six the application show and erro message with no error at all now you get it, how CAN YOU ISOLATE THE PROBLEM and when you isolate it what will you do if you can trace what is wrong

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

                                Step 7a: Read the code and try to locate the problem by analysis Step 7b: (only if 7a fails) Try to shorten the code to rule out as much of it as possible as source of the problem Step 7c: Identify potentially problematic code in what is left over and monitor it by logging Step 7d: Draw conclusions from the logged values, go back to 7b if the results are not conclusive Step 8: Fix the problem Step 9: Restore all the code that has been commented out during troubleshooting And now repeat 500 times 'I WILL NOT SHOUT AT THOSE WHO TRY TO HELP ME'. Edit: And there is also the tiny possibility that the compiler is a little antiquated and has a little problem with newer windows versions. Edit^2: Borland C++ Builder is from 2002. 10 years old, meaning it's probably a rare item in computer museums :)

                                At least artificial intelligence already is superior to natural stupidity

                                G E V 3 Replies Last reply
                                0
                                • M Mohibur Rashid

                                  The boy is already trouble with CPP and you are threatening him with oscilloscope :laugh: How about forgetting to connect your circuit board with ground and your embedded device is not running at all :sigh:

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

                                  Too simple. How can you overlook that you have no power at all?

                                  At least artificial intelligence already is superior to natural stupidity

                                  M 1 Reply Last reply
                                  0
                                  • V Vasily Tserekh

                                    I surely know what i am talking about, HOW TO CLEAN A CODE THAT YOU CANT DEBUG. and surely you have ever worked with c++ builder 6, c++ builder doesnt have a debug and release version it only has a single output, instead of giving new ideas you talk about how good you are and how ignorant i am. I will make it simple so your mind can understand!!! step one -you write code step two -you compile that code step tree your ide launches the .exe and you try it step four you test your program and i does just fine step five you go to the application folder and make double click on the executable step six the application show and erro message with no error at all now you get it, how CAN YOU ISOLATE THE PROBLEM and when you isolate it what will you do if you can trace what is wrong

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

                                    C compilers have had release/debug, or flags you can set with the same effect (e.g. optimise on/off, inlining, etc) for a very long time. You are not talking to people in a way that will get answers, particularly after posting in the wrong forum (the HoS is explicitly not for asking questions). When I have fun like this I usually put lots of debug-to-console (or, if you are not running somewhere you can see that, to file) statements in and play divide-and-conquer to pin down where the problem is.

                                    L 1 Reply Last reply
                                    0
                                    • B BobJanova

                                      C compilers have had release/debug, or flags you can set with the same effect (e.g. optimise on/off, inlining, etc) for a very long time. You are not talking to people in a way that will get answers, particularly after posting in the wrong forum (the HoS is explicitly not for asking questions). When I have fun like this I usually put lots of debug-to-console (or, if you are not running somewhere you can see that, to file) statements in and play divide-and-conquer to pin down where the problem is.

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

                                      He mentioned using C++ Builder 6, which is 10 years old. It may very well be that its runtime libraries or the Platform SDK are simply antiquated.

                                      At least artificial intelligence already is superior to natural stupidity

                                      V 1 Reply Last reply
                                      0
                                      • L Lost User

                                        Too simple. How can you overlook that you have no power at all?

                                        At least artificial intelligence already is superior to natural stupidity

                                        M Offline
                                        M Offline
                                        Mohibur Rashid
                                        wrote on last edited by
                                        #20

                                        do you think i spent all day? not at all, i found it right away. but can i blame micro-controller for this?

                                        L 1 Reply Last reply
                                        0
                                        • L Lost User

                                          He mentioned using C++ Builder 6, which is 10 years old. It may very well be that its runtime libraries or the Platform SDK are simply antiquated.

                                          At least artificial intelligence already is superior to natural stupidity

                                          V Offline
                                          V Offline
                                          Vasily Tserekh
                                          wrote on last edited by
                                          #21

                                          hello, thanks for the help but that was five years ago that was the ultimate reason to select C# as main language, I have not any plans to fix that code i dont need it. Now i remember the error message: a popup window with this: external exception and no more, somewhat i located the error message in a simply i/o read but i couldnt do anything because the SAME code worked in other projects and I wasnt able to tell what was wrong i had to drop the project. now c++ fans how many times where you stucked because an error that have you haunted for weeks- a LOT since i use c# i never ever had an uncomprehensive stupid error again and please this is not a question forum i post it here to see if anyone had that kind of error once in their lives to feel that i am not alone

                                          L R K 3 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