Thread: What is the weakness of C ?

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >So pretty much the weakness of C is that it's not C++
    Except to people who feel that the C/C++ relationship is similar to Algol-60/Algol-68, which was quite the fiasco.

    -Prelude
    My best code is written with the delete key.

  2. #17
    most people that use C are people who used it b4 C++ was big and are just to stubborn to learn C++.

    Sang-drax: that wasn't complicated syntax, that was just an idiot programmer trying to be funny.

    Shiro: I hope that code you gave wasn't the complicated syntax you were referring too. It's just a function pointer, and you are dynamically allocating...wait. You didn't provide a variable for the new class you made. Loser

  3. #18
    Terrance11
    Guest
    c is tedious to code, prone to programmer errors, and more difficult to debug than just about any other language.

    The rule set compared to c++ is much smaller making it a lot less versatile, and since c is completely low level, it requires more code than c++.

    Link lists in c++ are created using the stl, and oop allows for reusable code.

    c++ is a much more complex language, and I agree that a lot of old time c-er's aren't willing to learn object oriented programming for many different reasons, but it doesn't stop them from using c++ syntaxes, and making c++ code that's 90% c code.

    C is only low level, and that's the main weakness in my opinion.

  4. #19
    Registered User
    Join Date
    Jul 2002
    Posts
    66
    c is tedious to code, prone to programmer errors, and more difficult to debug
    C++ really isn't any better, but you can be reasonably sure that you'll use most of C for any given program where with C++ you won't even use 15% of the language even for huge programs. You can know and use all of C regularly but probably only a handful of people in the world know all of C++.
    The rule set compared to c++ is much smaller making it a lot less versatile
    You can do anything with C, how is that not versatile?
    Link lists in c++ are created using the stl, and oop allows for reusable code.
    The only advantage for the stl is that it's standard, any moron can write a reusable linked list library in C. Most C++ people don't even know how to make a linked list, that's why they rave about the stl.

    Don't get me wrong, I love C++ and use it whenever I can, but I don't run around with a closed mind making idiotic statements. At least come up with a verifiable argument instead of spouting stupid opinions.

  5. #20
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    You can do anything with C, how is that not versatile?
    I don't think this is what he meant. The built in language features of C++ allows you more versitility in the way you wish to construct your program. However this may not always be an advantage; which I believe you touched on in your 25.123% of people prefer pepsi statement.


    The only advantage for the stl is that it's standard, any moron can write a reusable linked list library in C. Most C++ people don't even know how to make a linked list, that's why they rave about the stl.
    I'd agree that the main benefit of the stl is that it offers a standard interface; however I gather it's a little more than a naive linked list that any moron could produce.

    At least come up with a verifiable argument instead of spouting stupid opinions.
    Indeed.
    Joe

  6. #21
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Just the syntax of templates should convince anyone
    that c++ ranks among the most complicated languages
    syntactaly. This is a syntax error
    vector<vector<int>> v; But this is not
    vector<vector<int> > v;

  7. #22
    Terrance11
    Guest
    Originally posted by Crimpy
    C++ really isn't any better, but you can be reasonably sure that you'll use most of C for any given program where with C++ you won't even use 15% of the language even for huge programs. You can know and use all of C regularly but probably only a handful of people in the world know all of C++.

    You can do anything with C, how is that not versatile?
    The only advantage for the stl is that it's standard, any moron can write a reusable linked list library in C. Most C++ people don't even know how to make a linked list, that's why they rave about the stl.

    Don't get me wrong, I love C++ and use it whenever I can, but I don't run around with a closed mind making idiotic statements. At least come up with a verifiable argument instead of spouting stupid opinions.

  8. #23
    Terrance11
    Guest
    Originally posted by Crimpy
    C++ really isn't any better, but you can be reasonably sure that you'll use most of C for any given program where with C++ you won't even use 15% of the language even for huge programs. You can know and use all of C regularly but probably only a handful of people in the world know all of C++.
    damn, my last post got messed up cause I hit the wrong button anyways:

    that's one of the things that's so great about c++. C++ consists of about 7000 rules sets. You can be a functional programmer in c++ knowing a few thousand.

    C is a relatively small language, which is powerful, but a lot less flexible.

    And I would say that debugging a well written object oriented c++ program using stl takes 1/4-1/2 the time the same program would take to debug in c. Assuming the programmer knew both languages extremely well. C++'s flexibilty allows you to save a lot of lines of code, and stl saves you a heck of lot of time not having to write out tedious algorithms.

    And my guess is that no one knows all of c++, at least not off the top of their head. Stroustrup himself said that he doesn't have a complete understanding of all of the standardized c++ language.

    Originally posted by Crimpy
    You can do anything with C, how is that not versatile?
    The only advantage for the stl is that it's standard, any moron can write a reusable linked list library in C. Most C++ people don't even know how to make a linked list, that's why they rave about the stl.
    You can't create classes in c Anyways, I was talking about coding programs, not the language itself.

    You can code anything in assembler, why even use c???

    And you're right, one advantage of stl is that it's standardized, but it's certainly not the only advantage.

    STL has the algorithms to help a programmer code virtually any type of program you can think of, and probably saves the coder 10's to 100's of hours on a large project. If that's not an advantage, then I say there's no advantage of using c over assembly as well.

  9. #24
    I don't use STL much. Most of the time I'll make my own linked list with classes. I just don't like vectors. Now I bet 10 people are going to start yelling and throwing their opinions at me, but I just like linked lists better.

  10. #25
    Terrance11
    Guest
    Originally posted by Terrance11
    And I would say that debugging a well written object oriented c++ program using stl takes 1/4-1/2 the time the same program would take to debug in c.
    excuse me, depending on the program ( it could save that much if not more).

  11. #26
    Terrance11
    Guest
    Originally posted by Terrance11
    Anyways, I was talking about coding programs, not the language itself.
    sorry again, I can't edit.

    I meant: Anyways, I was talking about the language, not actually coding programs.

  12. #27
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by frenchfry164
    I just don't like vectors. Now I bet 10 people are going to start yelling and throwing their opinions at me, but I just like linked lists better.
    If you don't understand situations where it's better to use arrays or vectors instead of linked lists then that's not a question of opinion, it's of stupidity (sorry to be harsh, but each have their place and neither makes sense in all situations).

  13. #28
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Shiro: I hope that code you gave wasn't the complicated syntax you were referring too. It's just a function pointer, and you are dynamically allocating...wait. You didn't provide a variable for the new class you made. Loser
    First it is a member function pointer and not just a function pointer, second I didn't make a new class and third a new variable isn't always necessary. I can imagine you don't find the code complicated, but that's probably because you are a very well C++ programmer.

    and since c is completely low level, it requires more code than c++.
    Therefore libraries are used. Why write code that has already been written? A lot of the low level things, like implementation of trees, graphs and other datastructures and a lot of algorithms are implemented a lot of times. So when using C in a software project, programmers, coding in whatever language, usually first take a look around what code they can reuse.

    The only advantage for the stl is that it's standard
    In my opinion it is a great advantage. You are right that every programmer should be able to write a linked list library, but if your goal is to use a linked list and not to write a linked list implementation, an implementation already available in the standard library is preferred. Then you don't need to spend time on designing, writing and probably debugging a linked list library. Also, if you use standard code, others can easily use your code without being required to have your libraries too.

    C is a relatively small language, which is powerful, but a lot less flexible. (..) C++'s flexibilty allows you to save a lot of lines of code,
    If that is your definition of flexible, then I disagree, because when using a library, a C program also doesn't require a lot of lines of code.

  14. #29
    Seven years? civix's Avatar
    Join Date
    Jul 2002
    Posts
    605
    Originally posted by face_master
    No its not speed, its its non-ease of use (for some, anyway)
    I agree completely.
    And no, im not that some.
    .

  15. #30
    Terrance11
    Guest
    Originally posted by Shiro
    Therefore libraries are used. Why write code that has already been written?
    templates, inheritance, other built in features of oop, and stl helps c++ save coding time over c, sorry, didn't explain that well.





    Originally posted by Shiro
    If that is your definition of flexible, then I disagree, because when using a library, a C program also doesn't require a lot of lines of code.
    Not my only definition of flexible. C function libraries are great, but templates allow the same general set of operations using various data types, and are sorely missed in C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Microsoft Interview Questions
    By Kohatian 3279 in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 04-29-2006, 03:00 PM
  2. weakness and strenghs of Polymorphism?
    By must in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2002, 09:01 PM