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.
  • W W Balboos GHB

    It may produce a spiritual awaking. C was deliberately written to be unrestricted (to port the Unix O/S). It does what it's told to do, no questions asked. That means you have to pay attention to what you're doing. That is a good habit to learn. I'd even go so far as to suggest you dabble with the in-line assembler.

    "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 disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

    C Offline
    C Offline
    Clifford Nelson
    wrote on last edited by
    #46

    I have found that that you have to pay attention to what you do in any language, otherwise you get into spagetti. It is understanding the concepts of OOD, events, design patterns, architecture that is difficult because you have to wrap your mind arround them. Basic programming should be a one semester course, and then move on to real issues in application programming.

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

      M Offline
      M Offline
      Mladen Jankovic
      wrote on last edited by
      #47

      Maximilien wrote:

      it is efficient.

      std::string is not efficient if you're not using it properly and according how it manages string internally,

      Maximilien wrote:

      it is safe

      and std::shared_ptr is not safe if you're using it incorrectly (circular references). So if you really want safe and efficient code you need to know how those high-level concept works on a low-level.

      1 Reply Last reply
      0
      • K Kevin Marois

        Life is too short to code in C/C++. Go with C#.

        Everything makes sense in someone's mind

        M Offline
        M Offline
        Mladen Jankovic
        wrote on last edited by
        #48

        And life is too short to use application written in C#.

        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
          Philippe Mori
          wrote on last edited by
          #49

          In my opinion, a lot of people really need to better understand how to use correctly C++ in an object-oriented way. When people first learn C, then often only use C++ as a better C... In my opinion, if someone learn C++ and also read Meyers book, he will know the essential. The main advantage of knowing C might be for some embedded development where C++ compiler are not available.

          Philippe Mori

          1 Reply Last reply
          0
          • M Maximilien

            Language feature should make our lives easier to make portability as transparent as possible. Using standard C++ libraries (streams, collections, algorithms, memory management, ...) ), I can write portable code that runs on major OS without the need to think about it.

            Watched code never compiles.

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

            Maximilien wrote:

            I can write portable code that runs on major OS without the need to think about it.

            Wow really i find it hard and painfull at the best of times!?!!?!?

            1 Reply Last reply
            0
            • J Joe Woodbury

              Maximilien wrote:

              I can write portable code that runs on major OS without the need to think about it.

              If you're writing generic algorithms, of course. Writing a high performance server or something comparable and it's a different situation. The standard C++ libraries make up a miniscule fraction of the code base I'm working on (and some of that is still tricky, such as the differences in UNICODE. A few days ago, I had a small class where the entire class is different between Win32 and Linux. Another class has huge differences between Win32 and CE; I haven't even looked at what the Linux version will be like. :) )

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

              this is more of my experience with "portable" code.... :(( i had many #IFDEF SOME_LONG_HW_VERSION_ID ..... #ENDIF not sure if i was doing it wrong but that was how it got done :doh:

              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
                Karanig
                wrote on last edited by
                #52

                I started with VB5 in grade8. Then study C++, Assembly, Java in University. And Start my first work with RPG4, CL and LANSA. But Now I'm working on VB.NET Even if I'm not a good programmer. For me Programming Language is just a tool. I think which language to start doesn't matter.

                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.

                  B Offline
                  B Offline
                  biop codeproject
                  wrote on last edited by
                  #53

                  When I first started out, I did learn Pascal. Then moved onto C. Then Perl. Then C++. Start off with Perl? No because there are those strange UNIX syntax. To keep it clean, Pascal but yes I don't think it has much real use in business. Start off with C? I think that is ok.

                  P 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
                    #54

                    Yes - C is simpler and a much smaller language than C++. C is great for learning about functions, pointers, memory management and calling operating system libraries. C is a beautiful language that allows you to program efficient algorithms. You can learn about how different data types are stored and represented in memory. C will give you the power to implement classic computer science structures and algorithms: arrays, trees, sorting and linked lists. If you 'get' C, you will know that you have what it takes to be a real programmer. C will give you small, lightweight and fast executables. With C, you will have a very good foundation that will complement what you learn with other higher level languages; and the lower level assembly language. Once you know C, it will stand apart from all other languages that you learn.

                    F 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.

                      V Offline
                      V Offline
                      Vivi Chellappa
                      wrote on last edited by
                      #55

                      If the idea of a high-level programming language is to hide hardware details from the programmer, there should never have been any commands associated with memory management in the language.

                      B 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.

                        W Offline
                        W Offline
                        WhaleyTim
                        wrote on last edited by
                        #56

                        There are two questions here: (1) The title of the thread "

                        Quote:

                        Are there reasons for beginner programmers to learn C

                        " (2) The first line of the question: "

                        Quote:

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

                        " There is a difference. Now, if you were wanting to learn about programming, I would not recommend C as a starting point. However if you were being taught programming as part of, say, a course in microprocessor systems engineering then C and assembler would be highly appropriate.

                        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
                          pchinery
                          wrote on last edited by
                          #57

                          I think learning C (and maybe also assembler) is a very good way to understand what really happens. Personally, I find it quite painful to program in these languages, as I prefer a higher order of thinking that does not distract me from doing algorithms and a good software design. But to understand what really happens and why XY now behaves just the way it does, I find it very useful that I have learned ANSI C and i386 Assembler.

                          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
                            jsc42
                            wrote on last edited by
                            #58

                            It depends on what the beginner's aim is. What is the purpose of programming? Ideally, it is the means of communicating a process for performing some goal. If you want someone to fetch something from the kitchen, you don't describe to them how to fire neurons to cause nerve impulses to raise a foot, etc; you start with the high level - walk to the kitchen (if necessary, tell them where the kitchen is), get (whatever), walk back. Same with programming; if there are no quick hits, (i.e. getting programs to do what you want) then the beginner will lose interest (Stage 1). However, once he / she has got some quick hits then, if they are serious about programming rather than just wanting an appreciation, lift the lid (UK) / hood (USA) and show what the instructions really do. Learning C is a very good exercise but can scare off new programmers. It should be stage 2. Only once the understanding of what happens under the lid / hood has been obtained can you use abstractions with impunity (Stage 3). It stops the programmer having surprises. I am sure that any programmer that can mentally visualise what the underlying C / assembler code would be doing will be a far more proficient programmer in any language than one who has not got that understanding. The fear is that they will continue writing C in the syntax of whatever language they are using, not appreciating the simplicity and elegance of the higher level constructs. That is why the Stage 1 is so important - it gets the concept of algorithms (the what) in place before the understanding of what the steps do (the why).

                            1 Reply Last reply
                            0
                            • B biop codeproject

                              When I first started out, I did learn Pascal. Then moved onto C. Then Perl. Then C++. Start off with Perl? No because there are those strange UNIX syntax. To keep it clean, Pascal but yes I don't think it has much real use in business. Start off with C? I think that is ok.

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

                              biop.codeproject wrote:

                              those strange UNIX syntax

                              What?

                              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.

                                T Offline
                                T Offline
                                Thornik
                                wrote on last edited by
                                #60

                                > features that are so prone to errors "Learning C" is not a "learning your tool", it's rather "learn computer insides". Definitely worth it! Having "C" in mind never make you fool when you see at "interesting features" of another languages - you'll always know what costs what. Pointers, limited memory, I/O ports, float registers, MMX, all this gives you real knowledge. Even if you'll program on C#, its every operator will map on "hardware" in your head and you'll never ask "Why my program is so slow?".

                                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.

                                  B Offline
                                  B Offline
                                  Buzzby 0
                                  wrote on last edited by
                                  #61

                                  I think it comes down to whether you want to teach top-down or bottom up.I think for every serious developer it's a good thing to know about. Bottom Up - bits, machine code, Assembly, C, C++, [C# | Java], [functional language] && scripting [Ruby | JavaScript | Python | etc] The Bottom up wants to impart fundamentals about computers early on (what's a processor, execution cycle, registers, memory, stack, etc.] then proceed to abstract out the details. I think this makes you hungrier to learn the abstractions and make life easier - if you haven't wondered off in another direction like marketing] The Top Down basically reverses the order, get's you involved with making things happen right away then takes you down to the basement to show you how it works. I think a lot of people stop at the top of the stairs and never learn to consider memory management, optimization, etc. since there stuff already works.

                                  No matter where you go, there you are.

                                  1 Reply Last reply
                                  0
                                  • V Vivi Chellappa

                                    If the idea of a high-level programming language is to hide hardware details from the programmer, there should never have been any commands associated with memory management in the language.

                                    B Offline
                                    B Offline
                                    Buzzby 0
                                    wrote on last edited by
                                    #62

                                    Sure, they were to prevent you from having to deal with registers and offsets for pointing to memory. And in an embedded world there are many time when you need to get to the data that's at location X in RAM.

                                    No matter where you go, there you are.

                                    1 Reply Last reply
                                    0
                                    • O Oshtri Deka

                                      I somewhat agree, but I would chose those languages only for lower level of education.If it's for college than I am for C all the way. What the heck, C should be in secondary schools as well.

                                      R Offline
                                      R Offline
                                      Rob Ford 2
                                      wrote on last edited by
                                      #63

                                      C should not be inflicted upon anyone. It is clumsy, slow to code and inelegant, and is a source of the World's most inefficient and buggy programs. It is only due to inertia and legacy that it still survives, mostly within failing companies.

                                      O B 2 Replies Last reply
                                      0
                                      • L Lost User

                                        Yes - C is simpler and a much smaller language than C++. C is great for learning about functions, pointers, memory management and calling operating system libraries. C is a beautiful language that allows you to program efficient algorithms. You can learn about how different data types are stored and represented in memory. C will give you the power to implement classic computer science structures and algorithms: arrays, trees, sorting and linked lists. If you 'get' C, you will know that you have what it takes to be a real programmer. C will give you small, lightweight and fast executables. With C, you will have a very good foundation that will complement what you learn with other higher level languages; and the lower level assembly language. Once you know C, it will stand apart from all other languages that you learn.

                                        F Offline
                                        F Offline
                                        Fabio Franco
                                        wrote on last edited by
                                        #64

                                        bigbadben wrote:

                                        Yes - C is simpler and a much smaller language than C++

                                        Exactly. This way students are focused on the important stuff when they are learning programming instead of being distracted from the hugeness of C++. I believe the most important thing to learn is about pointers. Pointers knowledge will be useful even when the student is learning languages that does not require pointer manipulation. They will anticipate many of the managed programming pitfalls if they are familiar of how pointers work and how it differs from stack allocated types.

                                        "To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson

                                        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.

                                          A Offline
                                          A Offline
                                          Alan Balkany
                                          wrote on last edited by
                                          #65

                                          Yes: 1. C forms the basis for many other languages: e.g. C++, C#, and Java. 2. C is good for learning core, low-level programming skills. After these are learned, you can approach object-oriented programming without being distracted by low-level programming issues. 3. C is good for learning function-oriented programming, which complements object-oriented programming. (People who only know object-oriented programming create classes with unmaintainable 300-line methods.) 4. C can be used as a kind of "assembly language", i.e. for low-level modules that have to be the most efficient, without the overhead of C++. 5. C is a small simple language that won't overwhelm a beginner with the complexity of C++. 6. The time spent studying C isn't wasted, since C++ is a superset of C.

                                          "Microsoft -- Adding unnecessary complexity to your work since 1987!"

                                          S 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