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.
  • E exegetor

    Everybody hold on one minute and take a deep breath. True: the HoS is not for questions. So look closely at the title of this thread and the original post. Vasily did not ask a question, he told a story from long ago (C++ builder 6 came out in 2002) when he was "beginning to make some programs" and ended up hating C++. He was not asking for help, and he reasonably responded to unsolicited advice by reasserting his reasons for hating C++. You may not share or understand the bad taste the experience left in his mouth, but do not slam his competence (he was a beginner ten years ago, remember?) and drag him into a screaming match then bitch-slap him for getting frusterated. Get a GRIP. Now... I learned to program as a kid in the early 80's and was good at it until I tried to learn OOP and windows programming simultaneously without a teacher, using Borland OWL on Win3.1. With no internet. The documentation was...terse. My code was corrupting the bitmaps used for drawing the minimize/maximize/close buttons. My code crashed. Then my code crashed WINDOWS and dumped out to the command prompt. Not kidding. Bad taste in mouth. For Windows, lParam, wParam, C++, Borland, the whole mess. It was definately HoS experience. I still hate C++ on a deep emotional level that will not be mollified by any appeal to reason. Today I program command line apps in ANSI C and couldn't be happier.

    S Offline
    S Offline
    SlingBlade
    wrote on last edited by
    #67

    You're a good person! :-D

    1 Reply Last reply
    0
    • L Lost User

      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 Offline
      K Offline
      KP Lee
      wrote on last edited by
      #68

      That “uncertainty” sure shows up in a lot of places. One time I didn't have an IDE, and I'm getting duplicates. Comb over the code, can't find the logic problem. Insert write statements. Problem disappears. I'd had this happen in the past and the problem reappeared when I took out the write statements. This time, the problem remained gone and has stayed gone since. It's frustrating I'll never know what caused the problem or exactly what I did that fixed it. When it reappeared that earlier time, I think it took a week to find the single line of code that was a problem, and about the 20'th time re-reading that line.

      1 Reply Last reply
      0
      • L Lost User

        So, you're saying you can still "do" PL1? (Actually, it was PL/I; which I "did"). What you "did" and what you can "do" (expertly) today are two different things. While I may have been an "expert" 1401/7010 Autocoder at one time, mentioning it today is meaningless.

        K Offline
        K Offline
        krsmichael
        wrote on last edited by
        #69

        I would not be be able to code PL/I at the level I was doing it in the 80's. Although I still remember segments of PL/I, JCL and ISPF. I wrote channel drivers. I wrote an implementation of Kermit in PL/I. Yeah, I think I had it wired. Today, I'd have to get reacquainted with it again. I was definitely an expert and was made the IBM mainframe advisor for General Dynamics Western Division. As far as meaningless, I disagree. One of the strengths I bring to a job is the vast diversity of languages I've used. There is nothing new under the sun and I've reverted to ideas that I was exposed to, to implement "novel" things today. I am not familiar with Autocoder but I'm certain there were novel constructs that would be applicable to solving problems today. I started C++ with CFront on MPW. I've been with it to the present. However, it isn't a one tool fits all. I use other tools when they make sense. The aversion to the "I hate C++" post is due to the history of seeing this posted and then accepted as fact. I work for Qualcomm. I use C and C++ a lot. When I recruit at local technical colleges and the hardest thing they have had to develop with is Java, I find it hard to take the student's education seriously. I want to see students who know assembly. Not so that they can code in it, but to demonstrate they have some knowledge of what is going on underneath the covers. We want to know that the person has the ability to resolve issue not only at the software level, but at the hardware level as well. But to answer your question, I do a lot of things expertly. I've worked on many projects that has personally affected you or those around you.

        1 Reply Last reply
        0
        • L Lost User

          There is nothing to hate about C++. C++ doesn't written for winning prize for "Standards". It came to solve real world problem and solving it very well, since long time.

          Happy Programming

          W Offline
          W Offline
          wcsystems
          wrote on last edited by
          #70

          As a C/C++ coder who started as a .NET coder, I hated C++ to start with. I can honestly say that over the last few years it has really grown on me. I am forced to agree that a well-done c++ application is a thing of beauty. I am still more productive using .Net though, as it generally requires less code to get stuff done.

          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

            M Offline
            M Offline
            Member 8697068
            wrote on last edited by
            #71

            Your environment may be different when you run the debugger verses just launching the exe file. Check "PATH" when executing both. Also, as I use to do, kill the program with print statements. You can do a "binary search" with print statements. One at the beginning, one in the middle and one at the end of the program. See which one prints and move them around accordingly. THE OLE HACK ;P

            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

              M Offline
              M Offline
              mandyedi
              wrote on last edited by
              #72

              Did you try compile your code with other IDE?

              1 Reply Last reply
              0
              • V Vasily Tserekh

                the ide was c++ builder 6

                S Offline
                S Offline
                StephenPhillips
                wrote on last edited by
                #73

                It's just as well you've had an error like this - hopefully if/when you fix it, you'll have a more structured method for debugging in the future. It is not a good idea to write code with the approach of build and run it hoping it works; you have no idea what could be going wrong under the surface. If I was faced with an empty error dialog, I think my approach would be as follows (Apologies in advance, I'm not familiar with C++ Builder 6)

                - Track down 'when' the error occurs. We know it happens as you open the program, so try building some more useful output into the program. It sounds like you're unable to debug line-by-line, so I'd try bringing up an output dialog each time something works properly - print some useful text to say what was done, etc. - Find the offending operation/function that is causing the issue. With the information you've provided, I'd keep an eye out for any file loading stuff that may be involved; perhaps your file loader can only handle absolute paths and it's being fed relative ones. - Replace the suspect code with a simple test - instead of trying to load a file, perhaps output a "Loading file [path+filename]" message. If it doesn't come up with the blank dialog anymore, you know which line causes the issue. I'm far more used to debugging by pressing F10 until it breaks in Visual Studio, so this is effectively a more long-winded approach to doing the same thing. - Fix the offending code. Naturally, you still need to be able to load the file; I'm unfamiliar with your program's requirements, but if it's plain C++ loading a data file (binary or text, usually) then you should have no problems using an input stream[^]. I can promise you that this definitely works, and won't give you blank error messages.

                If you find errors in your code, it shouldn't matter if you get nonsensical or unhelpful messages - that's often the flavour of the day when it comes to programming. You need to break it down into each step to find out what's wrong, which inherently helps you understand your own code (or other people's code) better. Happy hunting!

                Sometimes a fist in the face says more than a thousand honeyed words.

                1 Reply Last reply
                0
                • V Vasily Tserekh

                  the ide was c++ builder 6

                  K Offline
                  K Offline
                  Keith Badeau
                  wrote on last edited by
                  #74

                  I started C programming in Borland's Turbo C/C++ compiler :wtf:. I didn't reall start C++ until Microsoft's Visual C++ v4.0 :confused: :wtf: :mad:. I love C++:rose: but after learning other languages and delving into functional programming, I can see why some people might hate it. Interesting post, by the way.

                  1 Reply 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

                    G Offline
                    G Offline
                    giuchici
                    wrote on last edited by
                    #75

                    When 19 people (at least until now) vote you 1 it's time to accept you are either mistaken or plain different. What you are doing is to blame a language for problems that are caused maybe by a compiler, the way you wrote the code, 3rd party library, ... . I bet you don't hate C++ but the whole set of tools that you are using to write code in C++. Then to talk back to people when you don't seem to know about release and debug versions it doesn't look well. I hate a tiny bit C++ but I hate it for what really belongs to it: the "*", the "&" and the "->". It is brutal to understand C++ code sometimes. That's why C# came as a blessing for me. Stop being frustrated and revisit your code, you'll make it better and learn in the process. Cheers.

                    giuchici

                    1 Reply Last reply
                    0
                    • V Vasily Tserekh

                      http://fbe.am/5JO[^] if you are so clever why dont you tell me whats wrong here!!!!

                      CDP1802 wrote:

                      With real primitive data types (which are not classes) I can construct data structures that take not a byte more or less than intende

                      Have you ever studied .NET interop namespace and marshalling, read a little bit an then post a clever answer

                      A Offline
                      A Offline
                      Al_Brown
                      wrote on last edited by
                      #76

                      (from the code in your link)

                      void TfrmMain::GetDir()
                      {
                      TFileListBox * ListBox = new TFileListBox(this);
                      frmMain->InsertControl(ListBox);
                      AnsiString way = ListBox->Directory;
                      way=way+" audio";
                      way[way.Length()-5]=92;
                      dir=way;
                      way=way.SubString(0,way.Length()-6);
                      ListBox->Directory=way;
                      frmMain->RemoveControl(ListBox);
                      }

                      If it's your code, I think you may want to learn a little more before complaining about C++. One thing you certainly should take into account is that C++ is not a managed language and constructing objects and never deleting them will lead to memory leaks.

                      1 Reply Last reply
                      0
                      • V Vasily Tserekh

                        http://fbe.am/5JO[^] here is the software i found it i will give a million dollar to the brainy to tell me whats wrong

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

                        "here is the software" file has a virus

                        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