Question:
Is a good,solid grasp of the C language a good foundation in Programming?Or C is something too basic?
electric
2012-08-19 20:49:20 UTC
The more I explore C the more I feel that it's not a trivial thing...I find it vast enough, with so much to learn,something that would need consistent study and practise.I attempt to understand each topic in C thoroughly,in detail rather than move fast and cursorily from topic to topic and get a false idea that I have covered all in little time..(I have taken so long to understand pointers in C, for example)

So what I want to ask you is, is it all worth it from a programming point of view?Is C a really good foundation or I am a dullard for taking so long to finish a trivial thing and finding unfounded satisfaction for doing something trivial and easy?
Six answers:
Jonathan
2012-08-19 22:35:36 UTC
It's a great foundation and quite practical, even to this day. See the link below. Yes, it is worth becoming an expert at C.



P.S. Since you are working hard to understand pointers, can you now write a function that accepts a pointer to a function like strcpy() and returns that same pointer as its result value? In short, the routine does nothing but accept and return the same value, a pointer to a function. But you need to declare it correctly. Take a crack at the syntax. I'll post it, shortly, if you don't close down this question before I do that. And if you get that far, create an array of structures where one of the members of that structure happens to be one of these pointers and then use it in some C code snippet that scans the array and when some key is found, accesses the indicated function correctly. When this becomes 2nd nature to you, you know C pointers pretty well.



P.P.S. Oh, and it sounds like you really are a programmer, writing "satisfaction for doing something trivial and easy." I could hardly put it better. You are a programmer. hehe.



P.P.P.S. Here's the function. I didn't even need to test it. It flows out of my hand freely:

char * (*func( char * (*p)( char *, const char * ) ))( char *, const char * ) {

    return p;

}



Reads easy to me, as well. You might use it like this:



int main( int argc, char *argv[] ) {

    char * (*z)( char *, const char * );

        z= func( strcpy );

        z= func( z );

    return 0;

}



Now you explain the syntax to me.



You can do significant things in C. Keep in mind that C++ didn't have a compiler of its own for 10 years or more. It was compiled using a C program called CFRONT which converted C++ source into C source, which was then compiled with an everyday C compiler. C can do C++. See 2nd link below.
SteveO
2012-08-19 20:54:27 UTC
C is actually quite a useful language despite how small it is. Linux is coded in C, Git is written in C, most game engines to this day are still primarily written in C, large server environments are done in C, and it's actually a slightly better language than C++ anyway (I could argue this with anyone who wants to say otherwise). You can really do anything with C that you can do with C++ if you don't do the OOP stuff that C++ has to offer, because that's the only thing that C++ has over C...and you write C anyway in C++ programs that don't use the C++ STL, but just with C++ syntax.



EDIT: @Josh Minecraft is a different issue when it was ported to Xbox, mainly because Microsoft doesn't allow for Java code to be submitted...it had to be rewritten in C#, which is near identical to Java in many ways. Java is also just a bad language in terms of efficiency and resource use...it's slow, slows down your system, and Minecraft is the only real game I've seen written in Java in the past 5 years, and for a good reason. There are still tons of performance issues with Minecraft being coded in Java, and you can see them a lot of the time if you have a slower system.
MarkF120
2012-08-19 21:26:43 UTC
It's for embedded systems/anything with a microprocessor/washing machine/microwave/electronics in a car, robotics, the mars curiosity rover was coded in C, space shuttles, aircraft controls, and you can do anything on a PC in C(though there are languages better suited for certain things), the interpreters for python and java are written in C, I'm slowly finding out Everything is written in C which is wonderful because I only started programming a year ago and I loved C but like you didnt think it had many uses in this day and age.



Most other languages are similar to the C syntax, so if you master C, you'll be able to get your head around most other languages fairly quickly.
theshadowknows
2012-08-19 21:08:05 UTC
Learning programming is more of a discipline than a specific language or development tool. To learn and be good at programming you must have the mentality for logic, be detail oriented and very methodical. Learning C will serve that purpose.
grabe
2016-10-17 05:25:43 UTC
beforehand u study C++, u ought to recognize the C lang. If u recognize C lang, then getting to understand any comp lang will will become really ordinary. B`cos C is the mummy language of computers. in preserving with C many different lang r stepped ahead. So u initiate getting to understand from C lang & then bypass 4 different lang.
Josh
2012-08-19 20:59:52 UTC
i don't know much but C is used for a lot of stuff. i think linux is coded with c.



java is also a very useful language. minecraft is coded with java but i hear you're not supposed to code games with java. it's the reason they had to use an older minecraft for the xbox.



EDIT: well SteveO kicked my answers ***...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...