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. Are there reasons for beginner programmers to learn C ?

Are there reasons for beginner programmers to learn C ?

Scheduled Pinned Locked Moved The Lounge
learningc++oopperformance
100 Posts 44 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.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

    Watched code never compiles.

    L W P K C 31 Replies Last reply
    0
    • M Maximilien

      Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

      Watched code never compiles.

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

      Imagine a c++ programmer armed with a few smart pointer classes from boost and the stl and no understanding of the underlying issues each is designed to address.

      L M K 3 Replies Last reply
      0
      • M Maximilien

        Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

        Watched code never compiles.

        W Offline
        W Offline
        wizardzz
        wrote on last edited by
        #3

        I think the surge of C questions is underqualified people being contracted or hired to build apps.

        "I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson

        1 Reply Last reply
        0
        • M Maximilien

          Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

          Watched code never compiles.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Not as a first language. Nor should an OOP-only language (VB, C#, etc.) be the first language. In my opinion BASIC and Pascal (and maybe Perl?) are still good first languages even though they won't apply very well to modern business. Professional developers still to be smacked with C.

          L E O B S 5 Replies Last reply
          0
          • L Lost User

            Imagine a c++ programmer armed with a few smart pointer classes from boost and the stl and no understanding of the underlying issues each is designed to address.

            L Offline
            L Offline
            lewax00
            wrote on last edited by
            #5

            So a Java programmer? ;P

            K 1 Reply Last reply
            0
            • P PIEBALDconsult

              Not as a first language. Nor should an OOP-only language (VB, C#, etc.) be the first language. In my opinion BASIC and Pascal (and maybe Perl?) are still good first languages even though they won't apply very well to modern business. Professional developers still to be smacked with C.

              L Offline
              L Offline
              lewax00
              wrote on last edited by
              #6

              Python's a good starting language, the syntax is simple and it's easy to read, plus it enforces code indentation practices.

              P 1 Reply Last reply
              0
              • L lewax00

                So a Java programmer? ;P

                K Offline
                K Offline
                killabyte
                wrote on last edited by
                #7

                the truth!

                1 Reply Last reply
                0
                • M Maximilien

                  Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                  Watched code never compiles.

                  K Offline
                  K Offline
                  killabyte
                  wrote on last edited by
                  #8

                  C is very important and a great way to learn exactly how a computer works, which is a double edged sword but if you push on through and gain a good understanding of C all other languages are a piece of cake.

                  M L 2 Replies Last reply
                  0
                  • M Maximilien

                    Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                    Watched code never compiles.

                    C Offline
                    C Offline
                    Chris Losinger
                    wrote on last edited by
                    #9

                    No! leave some jobs for us old-timers!

                    image processing toolkits | batch image processing

                    1 Reply Last reply
                    0
                    • M Maximilien

                      Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                      Watched code never compiles.

                      J Offline
                      J Offline
                      jschell
                      wrote on last edited by
                      #10

                      Maximilien wrote:

                      Are there reasons for beginner programmers to be taught C instead of C++?

                      I would say not really however...

                      Maximilien wrote:

                      I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education.

                      Huh? I suspect there is quite a bit of new development in C. In the following it is the second highest language. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html[^] In terms of "education" it might be relevant to at least introduce students to a variety of languages like assembly, lisp and C.

                      1 Reply Last reply
                      0
                      • K killabyte

                        C is very important and a great way to learn exactly how a computer works, which is a double edged sword but if you push on through and gain a good understanding of C all other languages are a piece of cake.

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

                        Shouldn't code be as machine/hardware independent as possible ? If you really want to go down on your knees and look under the hood, it is still possible with C++ and C, but that is not a beginner topic.

                        Watched code never compiles.

                        J K 2 Replies Last reply
                        0
                        • L Lost User

                          Imagine a c++ programmer armed with a few smart pointer classes from boost and the stl and no understanding of the underlying issues each is designed to address.

                          M Offline
                          M Offline
                          Maximilien
                          wrote on last edited by
                          #12

                          Well, I don't care (one example of many) how std::string internally manages the string, I just want to do std::string s("hello world");. it is safe, it is efficient.

                          Watched code never compiles.

                          L M B 3 Replies Last reply
                          0
                          • M Maximilien

                            Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                            Watched code never compiles.

                            J Offline
                            J Offline
                            Joe Woodbury
                            wrote on last edited by
                            #13

                            Yes, C is very good at teaching you HOW computers work. Think of C as super-assembly. (And if you learn assembly language first, C is a walk in the park.) I run across too much C++ code that would be much more stable if more C-type constructs were used. On the other hand, I've also dealt with too much C++ code that is nothing but C with classes and misses out on some truly great features of C++. I've also observed that C programmers who start thinking about encapsulation end up with many of the basics of C++. I remember when I very first learned C++ and realized that the this pointer is what I'd already been doing in a lot of my code, though having it built in was quite nice. Final point and a narrow observation; I've worked with several people whose first language was C#. Not one of them understood memory management. I've also found that they had a hard time moving "down" toward C or even C# code that had to be very hardware aware.

                            L Sander RosselS E 3 Replies Last reply
                            0
                            • M Maximilien

                              Well, I don't care (one example of many) how std::string internally manages the string, I just want to do std::string s("hello world");. it is safe, it is efficient.

                              Watched code never compiles.

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

                              Until you want to pass it to an api that takes LPTSTR

                              D 1 Reply Last reply
                              0
                              • M Maximilien

                                Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                                Watched code never compiles.

                                K Offline
                                K Offline
                                Kevin McFarlane
                                wrote on last edited by
                                #15

                                Maximilien wrote:

                                Are there reasons for beginner programmers to be taught C instead of C++?

                                No.

                                Maximilien wrote:

                                I'm not even thinking about Object Oriented programming, but simple declarative programming.

                                It would be better to learn procedural C++ followed by C if the end is eventually to learn C. If the end is just to learn to program then there are easier choices.

                                Kevin

                                1 Reply Last reply
                                0
                                • M Maximilien

                                  Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:

                                  Watched code never compiles.

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

                                  I can't think of any. Neither of those languages can teach a low enough level that they help to take the "magic" out of programming, so if the choice is just between those two they might as well learn the more useful one.

                                  1 Reply Last reply
                                  0
                                  • L Lost User

                                    Imagine a c++ programmer armed with a few smart pointer classes from boost and the stl and no understanding of the underlying issues each is designed to address.

                                    K Offline
                                    K Offline
                                    Kevin McFarlane
                                    wrote on last edited by
                                    #17

                                    _Josh_ wrote:

                                    Imagine a c++ programmer armed with a few smart pointer classes from boost and the stl and no understanding of the underlying issues each is designed to address.

                                    Nevertheless, Stroustrup recommends learning high-level procedural C++ and then learning the low-level stuff, i.e., the exact opposite of what you say.

                                    Kevin

                                    L 1 Reply Last reply
                                    0
                                    • M Maximilien

                                      Shouldn't code be as machine/hardware independent as possible ? If you really want to go down on your knees and look under the hood, it is still possible with C++ and C, but that is not a beginner topic.

                                      Watched code never compiles.

                                      J Offline
                                      J Offline
                                      Joe Woodbury
                                      wrote on last edited by
                                      #18

                                      Absolutely not! Code should do the best it can to solve the problem (for your customer.) I'm having this very argument now over writing generic code that can be ported to Linux vs. sharing that code which you can, but tailoring the core to each platform. (The current version is more generic and simply doesn't scale well.) I'm also tired of using programs that suck on every platform, all in the name of being cross-platform.

                                      M B 2 Replies Last reply
                                      0
                                      • J Joe Woodbury

                                        Yes, C is very good at teaching you HOW computers work. Think of C as super-assembly. (And if you learn assembly language first, C is a walk in the park.) I run across too much C++ code that would be much more stable if more C-type constructs were used. On the other hand, I've also dealt with too much C++ code that is nothing but C with classes and misses out on some truly great features of C++. I've also observed that C programmers who start thinking about encapsulation end up with many of the basics of C++. I remember when I very first learned C++ and realized that the this pointer is what I'd already been doing in a lot of my code, though having it built in was quite nice. Final point and a narrow observation; I've worked with several people whose first language was C#. Not one of them understood memory management. I've also found that they had a hard time moving "down" toward C or even C# code that had to be very hardware aware.

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

                                        I agree with most in your post, except this:

                                        Joe Woodbury wrote:

                                        Yes, C is very good at teaching you HOW computers work.

                                        It reflects what's happening "underneath" only very slightly. It doesn't make it immediately clear that the computer just blindly does whatever you throw at it. It's "too typed" to make it obvious that types do not really exist.

                                        J 1 Reply Last reply
                                        0
                                        • L Lost User

                                          I agree with most in your post, except this:

                                          Joe Woodbury wrote:

                                          Yes, C is very good at teaching you HOW computers work.

                                          It reflects what's happening "underneath" only very slightly. It doesn't make it immediately clear that the computer just blindly does whatever you throw at it. It's "too typed" to make it obvious that types do not really exist.

                                          J Offline
                                          J Offline
                                          Joe Woodbury
                                          wrote on last edited by
                                          #20

                                          Perhaps I should have written that C is better than most languages at teaching you how computers work, but agree that's true only if the person teaching stresses that point. I still like assembly as a must-language to learn.

                                          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