>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
>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.
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
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.
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++.c is tedious to code, prone to programmer errors, and more difficult to debug
You can do anything with C, how is that not versatile?The rule set compared to c++ is much smaller making it a lot less versatileThe 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.Link lists in c++ are created using the stl, and oop allows for reusable code.
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.
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.You can do anything with C, how is that not versatile?
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.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.
Indeed.At least come up with a verifiable argument instead of spouting stupid opinions.
Joe
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;
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.
damn, my last post got messed up cause I hit the wrong button anyways: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++.
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.
You can't create classes in c Anyways, I was talking about coding programs, not the language itself.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 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.
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.
excuse me, depending on the program ( it could save that much if not more).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.
sorry again, I can't edit.Originally posted by Terrance11
Anyways, I was talking about coding programs, not the language itself.
I meant: Anyways, I was talking about the language, not actually coding programs.
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).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.
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.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
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.and since c is completely low level, it requires more code than c++.
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.The only advantage for the stl is that it's standard
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.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,
I agree completely.Originally posted by face_master
No its not speed, its its non-ease of use (for some, anyway)
And no, im not that some.
.
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
Therefore libraries are used. Why write code that has already been written?
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.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.