What is the weakness of C ?

This is a discussion on What is the weakness of C ? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; If any one ask you about the weakness of C, what is your opinion. Is it the code management ? ...

  1. #1
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    532

    What is the weakness of C ?

    If any one ask you about the weakness of C, what is your opinion.

    Is it the code management ? or what?
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

  2. #2
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    I am not 100% sure, others may know for sure, but I always thought it was speed.
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    No its not speed, its its non-ease of use (for some, anyway)

  4. #4
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Well plain C doesnt give you the advantage of object oriented programming, which hurts both project scalability and code reusability, so I'd say the main deficiency is the efficiency with which it can be programmed in.

  5. #5
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    efficiency != defficiency

  6. #6
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    lol, pendantic aren't we? Any nothing about my ending a sentence with a preposition?

    Fine.

    I'd say the greatest deficiency of C lies in the more limited capacity for scalable efficiency when programming in it.

  7. #7
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    I think C code is much more difficult to decipher than C++ code. What the heck is malloc and dealloc, etc? C++ is much simpler about that—New and delete.

    My biggest gripe with C code is input and output. I keep seeing all of that printf, fprintf, scanf stuff along with the % operator which means you have to specify which type all of your variables are in order to output them. That's soooooo overly complicated. Cout and cin make much more sense. There's console output and console input. Their operators help to make the code even easier to read.

    I really don't see why anyone would want to learn C when they could learn C++ just as well.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  8. #8
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    C++ is a more complex language than C, it has the elements of C and a lot more. Also the object oriented paradigm is harder to understand for beginners than the procedural paradigm. C is a small language and quite easy to understand.

    But the main disadvantage are the already mentioned elements code management, scalability and reusability. The advantages of object orientation are most visible in large scale software development. So the main weakness of C is that it doesn't support object orientation very well.

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    A weakness of C (and of C++ to a large extent) is that it forces you to think in terms of the machine too much. This is not always the most efficient (in terms of productivity) or elegant way to solve every problem. Or so they say.
    Joe

  10. #10
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    Originally posted by joshdick
    I think C code is much more difficult to decipher than C++ code. What the heck is malloc and dealloc, etc? C++ is much simpler about that—New and delete.

    My biggest gripe with C code is input and output. I keep seeing all of that printf, fprintf, scanf stuff along with the % operator which means you have to specify which type all of your variables are in order to output them. That's soooooo overly complicated. Cout and cin make much more sense. There's console output and console input. Their operators help to make the code even easier to read.

    I really don't see why anyone would want to learn C when they could learn C++ just as well.
    I agree, I hate the syntax in C, it's easier in C++, although C++ is more complex...
    none...

  11. #11
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >I hate the syntax in C, it's easier in C++, although C++ is more
    >complex...

    ??

    C++ has C's syntax and quite a lot more more language elements and constructions, like new operators, pointers to member functions, templates, ways of inheritance, abstract classes etc. A little demonstration of some new operator and constructions in C++:

    Code:
    void (Class:: *fp)() = &Class::print;
    ((new Class)->*fp)();
    To me, C++ has a more complex syntaxis than C.

    What, in your opinion, makes C++ easier than C? (I think you've used the wrong words in your post, I think you meant something different than syntaxis)
    Last edited by Shiro; 01-01-2003 at 07:43 AM.

  12. #12
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by Shiro

    A little demonstration of some new operator and constructions in C++:
    So, by showing an example of complex syntax in C++ you conclude that the C++ syntax is more complex than the C syntax?

    Let me show some advanced C syntax:
    http://www.es.ioccc.org/2000/anderson.c

    I admit that the syntax of C++ can get a bit esoteric sometimes though, especially when dealing with templates.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  13. #13
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    So, by showing an example of complex syntax in C++ you conclude that the C++ syntax is more complex than the C syntax?
    No, you probably forgot to read the first lines of my post: "C++ has C's syntax quite a lot more more language elements and constructions,.. ". So C syntax is C++ syntax and I gave an example to show that with C++ the syntax hasn't become easier.

  14. #14
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Talking

    It is not the best teaching language to beginning programming students.
    Mr. C: Author and Instructor

  15. #15
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Its "incomplete type-safety" and the fact that it doesn't have templating or direct support of OOP.

    So pretty much the weakness of C is that it's not C++

Page 1 of 4 1234 LastLast
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21