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. C is better !!!!

C is better !!!!

Scheduled Pinned Locked Moved The Lounge
csharpc++hardware
56 Posts 28 Posters 2 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.
  • L Lost User

    I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste?

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

    harold aptroot wrote:

    who needs inheritance when you have copy and paste?

    If you are going to steal my quotes at least have the decency to attribute the m to me. ;P

    Morality is indistinguishable from social proscription

    L 1 Reply Last reply
    0
    • B Behzad Sedighzadeh

      I have written applications in C/C++ for embedded and C#/VB for enterprises.When it comes to choosing between C and C++ for an application i always go to C, no matter how much much much features C++ has

      Behzad

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

      Horses for courses. I use a lot of both. STL is very usefull, MFC a godsend, and direct memory referencing in C very powerfull. I am not such a fan of virtual classes, so called reference variables (its just a damn pointer OK!), but function overriding can be usefull if used wisely.

      Morality is indistinguishable from social proscription

      1 Reply Last reply
      0
      • L Lost User

        harold aptroot wrote:

        who needs inheritance when you have copy and paste?

        If you are going to steal my quotes at least have the decency to attribute the m to me. ;P

        Morality is indistinguishable from social proscription

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

        Sorry :) Epic quote though

        1 Reply Last reply
        0
        • T TheGreatAndPowerfulOz

          Well, you could use the C++ compiler as a better "C" (i.e. only use the "C" features). That fixes many of the holes of "C". I'm interested to understand your reasons for excluding "C++" from consideration though.

          Fight Big Government:
          http://obamacareclassaction.com/
          http://obamacaretruth.org/

          R Offline
          R Offline
          Rob12345654321
          wrote on last edited by
          #37

          C is limited in its support for complexity management in my opinion. For a very large project, C++ provides the kind of OO facilities necessary to make the project understandable at any level of abstraction.

          Fight Big Government!! Big Business Needs Less Competition And Is Not Capable Of Constituting An Oligarchy!

          1 Reply Last reply
          0
          • K Kevin McFarlane

            Nemanja Trifunovic wrote:

            first of all it is build on foundation of a really bad language (C) and it really can't go too far in fixing its flaws without breaking the compatibility. It is hard to learn, full of surprises, and the syntax is so complex that it is very hard to make good tools.

            Have you read Ian Joyner's C++ Critique 3rd Edition[^]? It's rather old now (1996) but worth a skim.

            Nemanja Trifunovic wrote:

            If a job needs to be done I always end up with ugly languages: C++, Perl, JavaScript, C#, VBA

            The only one I really hate in that list is Perl. My first experience of it was having to maintain the code of a developer who had left. I would always leave for home at the end of the day in a foul mood. It was quite common to identify a bug, know algorithmically how to fix it but then struggle with the actual Perl implementation! :mad: I'm not especially fond of JavaScript. I like C#. Of the languages I've actually used to at least "Hello World" level the one I've liked most is Eiffel (for which Ada is one influence). I've played with F# a little but find it quite tough. It's not as accessible as Scala. It might just be a superficial syntax thing, and I've not tried either seriously, so maybe Scala becomes equally scary once you get into realistic usages.

            Kevin

            N Offline
            N Offline
            Nemanja Trifunovic
            wrote on last edited by
            #38

            Kevin McFarlane wrote:

            Have you read Ian Joyner's C++ Critique 3rd Edition[^]? It's rather old now (1996) but worth a skim.

            Yep - that's one of the best texts on the topic (much better than the popular "FQA"). However, I still disagree with many of the points he makes - he is comparing C++ with high-level OO languages like Java and Eiffel, but that's not where it belongs; pretty much the only real competition to C++ today is (unfortunatelly) C. At the time this text was written, Ada was still a major player so maybe it would have been better to compare C++ with Ada.

            utf8-cpp

            1 Reply Last reply
            0
            • L Lost User

              I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste?

              C Offline
              C Offline
              chiwheels
              wrote on last edited by
              #39

              Why talk about the OO advantages and so on with respect to languages; OO is a methodology not a language. You can write NON-OO (random function) programs with C++ just as much as you can write OO programs including full inheritance (single and multiple) using C (with not overwhelmingly more effort). The main reason for using C++ over C for OO programs is that your OO structures are syntactically checked by the compiler whereas they are not for C and, of course, you have the battle hardened STL library to use. I've only used C recently once, for a DSP project, where the C++ compiler turned out to be useless.

              L 1 Reply Last reply
              0
              • C chiwheels

                Why talk about the OO advantages and so on with respect to languages; OO is a methodology not a language. You can write NON-OO (random function) programs with C++ just as much as you can write OO programs including full inheritance (single and multiple) using C (with not overwhelmingly more effort). The main reason for using C++ over C for OO programs is that your OO structures are syntactically checked by the compiler whereas they are not for C and, of course, you have the battle hardened STL library to use. I've only used C recently once, for a DSP project, where the C++ compiler turned out to be useless.

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

                Yea I know but it's just a quote..

                1 Reply Last reply
                0
                • L Lost User

                  I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste?

                  P Offline
                  P Offline
                  parkzone
                  wrote on last edited by
                  #41

                  If you are writing code, there is no difference between copy paste and inheritance. If that code has to be maintained then there is a huge difference. It is n times worse where n equals the number of copy pastes. That assumes you know where all of the instances are. Single source is always better.

                  L 1 Reply Last reply
                  0
                  • P parkzone

                    If you are writing code, there is no difference between copy paste and inheritance. If that code has to be maintained then there is a huge difference. It is n times worse where n equals the number of copy pastes. That assumes you know where all of the instances are. Single source is always better.

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

                    I know - this was just a quote. And see the joke icon.

                    1 Reply Last reply
                    0
                    • L Lost User

                      Its also a quote from me. Let me remind the person that plagarism deserves and original source quote.

                      Morality is indistinguishable from social proscription

                      U Offline
                      U Offline
                      uvatbc
                      wrote on last edited by
                      #43

                      I love where this is going. Let me summarize: Copy paste must be cited with sources, whereas inheritance is in itself a citation of the original source. Plagiarism at its best! Love the irony! ;P

                      1 Reply Last reply
                      0
                      • B Behzad Sedighzadeh

                        I have written applications in C/C++ for embedded and C#/VB for enterprises.When it comes to choosing between C and C++ for an application i always go to C, no matter how much much much features C++ has

                        Behzad

                        S Offline
                        S Offline
                        Stephen Hewitt
                        wrote on last edited by
                        #44

                        Why not be a real man and use machine code?

                        Steve

                        1 Reply Last reply
                        0
                        • B Behzad Sedighzadeh

                          Can you please tell me some of holes? I have done embedded coding in C and C++. In C you can use files in which source codes can act as classes and you can write application and do not use OOP features. Once upon a time, i heard from a guy " C++ is C with another syntax!".At the time,for the desktop i was using C# and for a embedded application C++. Now Iam using C in linux and altough IDEs are not as good as VS, i think that guy's opnoin was correct.I love coding in C which i think simplifies thinking; All in all There are some rules you must obey, no matter you use OOP or structured programming, etc.

                          Behzad

                          K Offline
                          K Offline
                          kgrunwald
                          wrote on last edited by
                          #45

                          It depends on the compiler. Most compilers on embedded system don't have good warnings in C++, so you are on your own anyway. You need good optimization on embedded systems, since poorely optimized C++ tends to eat up all the space you have. The STL is useful some times, but if it comes to predictable timing, you cannot rely on it. So using C for embedded projects looks not that bad.

                          G 1 Reply Last reply
                          0
                          • T TheGreatAndPowerfulOz

                            i see from someone else's post that you were "quoting" fat_boy. understood. LOL...

                            Fight Big Government:
                            http://obamacareclassaction.com/
                            http://obamacaretruth.org/

                            Y Offline
                            Y Offline
                            yp wong
                            wrote on last edited by
                            #46

                            This question is very much like asking whether a speedboat is better or a ship is better. Many people argue that C is faster, that is just like saying speedboat is faster. I have no experience in embedded system but my guess is C would be better for it. C++ is designed for big system and you simply won't get the real benefit if the system you are developing is small. For big project, C++ is always a better choice, once you know C++, it's not difficult to switch to C if you need to, the other way round would not be so easy. So, a speedboat is certainly faster than a ship for short distance, if you have to travel far, you would probably need to tie a really huge petrol tank behind the speedboat in order to travel long distance, and it sure will get really slow.

                            1 Reply Last reply
                            0
                            • N Nemanja Trifunovic

                              Kevin McFarlane wrote:

                              I thought you were a C++ worshipper?

                              Wow! I don't worship programming languages. C++ lets me do my job, but I wouldn't call it a good language: first of all it is build on foundation of a really bad language (C) and it really can't go too far in fixing its flaws without breaking the compatibility. It is hard to learn, full of surprises, and the syntax is so complex that it is very hard to make good tools.

                              Kevin McFarlane wrote:

                              So what's your definition of a very good language then?

                              Don't know the definition, but some of the languages I like (low-level to high-level) are: Ada, Modula-2, OCaml/F#, Haskell, Dylan, Scheme. Mind you, I've never done anything serious with any of them, and I wouldn't pick any of them for any serious project. If a job needs to be done I always end up with ugly languages: C++, Perl, JavaScript, C#, VBA.

                              utf8-cpp

                              R Offline
                              R Offline
                              Rick Shaub
                              wrote on last edited by
                              #47

                              "There are only two kinds of languages: the ones people complain about and the ones nobody uses" -Bjarne Stroustrup

                              1 Reply Last reply
                              0
                              • B Behzad Sedighzadeh

                                I have written applications in C/C++ for embedded and C#/VB for enterprises.When it comes to choosing between C and C++ for an application i always go to C, no matter how much much much features C++ has

                                Behzad

                                P Offline
                                P Offline
                                Peter N Godino
                                wrote on last edited by
                                #48

                                I taught C++ for several years. One of the things I stressed was that you don't write code for yourself, you write code for the guy who will add to it and maintain it. Many of my students were C programmers. The remainder were mostly first time programmers. By the end of each semester about half of the C programmers were still writing C code and struggling. The first time programmers were writing simpler more compact code than the C programmers. A multi-week project final always showed the difference between those that persisted with C and the C++ programmers. On average what a C++ programmer did in one page of code a C programmer did in over four pages.

                                peterg

                                1 Reply Last reply
                                0
                                • B Behzad Sedighzadeh

                                  I have written applications in C/C++ for embedded and C#/VB for enterprises.When it comes to choosing between C and C++ for an application i always go to C, no matter how much much much features C++ has

                                  Behzad

                                  C Offline
                                  C Offline
                                  CDMTJX
                                  wrote on last edited by
                                  #49

                                  One example where C++ is better - parsing string data. Old app I have to maintain is using char*. Ugh. Yes, I can figure it out, but using the string class is so much easier to code and ensure I'm getting the correct columns for the data. Assign from existing char* to string object, and use string methods to access...

                                  1 Reply Last reply
                                  0
                                  • B Behzad Sedighzadeh

                                    I have written applications in C/C++ for embedded and C#/VB for enterprises.When it comes to choosing between C and C++ for an application i always go to C, no matter how much much much features C++ has

                                    Behzad

                                    W Offline
                                    W Offline
                                    W Balboos GHB
                                    wrote on last edited by
                                    #50

                                    Yup. When I coded in C it was always fun. I did what I wanted to do. These other johnny-come-lately languages - like the TV shows designed for short attention spans, they're for coders who don't want to take responsibility for having absolute power. Power. Power! Power !!

                                    /xml>

                                    "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                                    "As far as we know, our computer has never had an undetected error." - Weisert

                                    "If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010

                                    G 1 Reply Last reply
                                    0
                                    • K kgrunwald

                                      It depends on the compiler. Most compilers on embedded system don't have good warnings in C++, so you are on your own anyway. You need good optimization on embedded systems, since poorely optimized C++ tends to eat up all the space you have. The STL is useful some times, but if it comes to predictable timing, you cannot rely on it. So using C for embedded projects looks not that bad.

                                      G Offline
                                      G Offline
                                      ghle
                                      wrote on last edited by
                                      #51

                                      kgrunwald wrote:

                                      on embedded systems, since poorely optimized C++ tends to eat up all the space you have.

                                      I like "Let's use 2 bytes to represent one byte of character data" on a memory-limited, slower CPU device. Gotta love that "optimization". :mad:

                                      Gary

                                      1 Reply Last reply
                                      0
                                      • J Jeremy Falcon

                                        C is my favorite programming language in existence - bar none. However, there are plenty of times I'd choose C++ over C. I wouldn't want to write a n-tier business app in C for instance.

                                        Jeremy Falcon

                                        G Offline
                                        G Offline
                                        ghle
                                        wrote on last edited by
                                        #52

                                        x2

                                        Gary

                                        1 Reply Last reply
                                        0
                                        • W W Balboos GHB

                                          Yup. When I coded in C it was always fun. I did what I wanted to do. These other johnny-come-lately languages - like the TV shows designed for short attention spans, they're for coders who don't want to take responsibility for having absolute power. Power. Power! Power !!

                                          /xml>

                                          "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                                          "As far as we know, our computer has never had an undetected error." - Weisert

                                          "If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010

                                          G Offline
                                          G Offline
                                          ghle
                                          wrote on last edited by
                                          #53

                                          Balboos wrote:

                                          Yup. When I coded in C it was always fun. I did what I wanted to do.

                                          Agree 100%. C was always fun. If it didn't do everything you wanted, you easily slip down into ASM and git er done. Above all, it was fun. Fun to write, fun to tweak, fun to make faster. Anyone read the book "The C Puzzle Book Puzzles for the C Programming Language" by Alan Feuer? Now THAT was a thought-provoking book.

                                          Gary

                                          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