Why C Is Obsolete
softdevtube.com
Why C Is Obsolete
1–10 of 75 posts
Re: Why C Is Obsolete
#2Re: Why C Is Obsolete
#3Re: Why C Is Obsolete
#4Re: Why C Is Obsolete
#5Yeah right, a language/platform is a bag of fun toys out of which you can pick whichever ones you want, and all is well and everyone is happy. How can a programmer who has any experience claim something so ridiculous? When you decide on a platform, you have to live with whatever is there, the good and the bad. You can't tell people to use some feature but not touch this library, or not include that other package but write yours instead.
Re: Why C Is Obsolete
#6It would be so easier if the only difference between compiling for C or C++ was whether or not symbols were mangled or not. Someone writing C code that nevertheless calls C++ code could still compile with the C compiler, instead of today's solution, specifically - wrap the file in #ifdef __cplusplus extern "C" { #endif
and compile with the C++ compiler.
Plus, no more need to deal with all of the different flags leading to CFLAGS, CPPFLAGS, CXXFLAGS, no more worrying if a bool is a bool or a _Bool etc etc etc
Of course, care would need to be taken to not needlessly drag in the C++ runtime if it is not used.
Re: Why C Is Obsolete
#7in C++, you'd have a Matrix class with a getter. To get an element of the matrix you'd do
int v = pMatrix->get(i,j);
whereas in C you'd typedef a Matrix structure type and have an accessor function int v = matrix_get(pMatrix,i,j);
Looking inside the functions, they'do pretty much the same thing. In both of these functions you'd be basically accessing either element i+imax * j of your data array if you are implementing the matrix as a single array, or the j-th element of the i-th row if you were using a pointer to pointer structure. the C version would work on the provided matrix structire whereas the C++ would use the implicitly provided this structure. C++ would allow your matrix class to override some operator to make this look cooler - but operator overloading being a good thing is not really a consensus AFAIK.I dont see anything more than a syntactic difference here. The abstract reasoning behind the structures/classes is exactly the same.
C may be obsolete, but this is hardly a justification.
Re: Why C Is Obsolete
#8Re: Why C Is Obsolete
#9Thank the stars this didn't & won't happen!
Bjarne has been stuck in "C++ is the best & only language anyone needs" long after the world has moved on to Java, C#, Python, Ruby, JavaScript, etc.
C occupies a sweet spot combination of:
- low-level with "no magic"
- small enough for most people to "hold in your head"
C++ matched these conditions for a brief time in it's life - the early 90s aka "Stroustrup 2nd edition" - when the only "magic" was basic virtual functions, and templates where just a promising experiment in an appendix.