Well, maybe it's a stupid question, but I don't know the answer and I hope to see one here.
Well, maybe it's a stupid question, but I don't know the answer and I hope to see one here.
It is a question that can start flamewars, unfortunately.
C is already in use for "big applications", although it may not be the only programming language used in such applications.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
There are extremely large applications written in C. Whether C is "suited" for this is up for debate. I used to manage development of a pure C application that weighed in at over a million lines. I didn't realize how painful it was until I moved on to something else.
Keep in mind that any application of that size has probably been in development for many, many years. At the time that project started, C++ didn't even exist. The code itself started out in Fortran. Compared to that, C was a step forward. Not that Fortran is a bad language, but it definitely wasn't the right choice for that particular software.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
I think that depends on the definition of suited.
Can a big application be written in C? Certainly. Will it be easy? That depends on the application I would say.
Are there other languages that could make the task easier? Most likely.
Are the other languages better than C on these tasks? That depends.
This may be a cryptic answer, but it really does depend. The best alternative is to find out each language's strengths and weaknesses and compare them to C, and compare that to the task at hand, then make a qualified guess as to whether it would be suited or not.
Depends on what kind of "big application". If it's for something like a server, an OS kernel, a system driver, a video game, a compiler or some such then the answer is yes. There are many areas where it's probably not the best language, however (Scripting, text processing).
I'm sorry, I don't want to start a flame war, but I'm trying to figure out if C is actually suited for my (hobby)-project, which has to do with the syntax of a natural language. It has to look up words of a given sentence in a database (sqlite), determine what kind of words these are (verbs, articles, prepositions,...) and determine the structure of a sentence:
For example:
The boy gave him a book.
(subject - main verb - indirect object - direct object)
I know that Python is well suited for natural language processing, but I don't feel comfortable with it.
I'm not saying that Python isn't good. But it's too radically different from what I'm used to and I have difficulties learning these new paradigms.
So, for the project given: is C suited or should I persevere and try to learn Python anyway?
It's a matter of opinion, really. Different people feel at home with different things.
C lacks any kind of regex (string processing), so handling string literals may not be as easy as other languages. Although, regex in itself can be pretty complex.
I cannot speak on how Python is since I've never used it, though. Perhaps others will give you some other advice, but I would say that you should try to use what you're most familiar with and what feels most natural to you.
In that case, you can most likely stick with C. There are several libraries to handle SQL database access, although the complexity of your program appears to be in determining the structure of a sentence. Compared to Python, you'll have to write a lot more code, but since you're not comfortable with it, then you may use C.
If it is about easier, python will probably make it much, much, easier than either C or C++, or most other languages. I only know a little python, but presuming it is on a par with perl, functionality wise (which it seems to be, and supposedly is), I'll make you a promise in that regard. Those languages operate on a much higher level, have a tremendous core, and nothing can beat perl for library extensions (and I believe the python gang are rapidly catching up).
"Better" is harder question to answer. Based on what you say, I don't think any one language will be that much better for this task than any other, it is really up to the programmer.
However, if the project is serious enough that you would consider learning a new language to do it, it will probably take you several weeks to a month to learn enough to consider starting such a project in that new language. If it is very serious, I highly recommend you try to duplicate something you have already done in C first, and/or at least complete a couple of reasonably complex, fully functioning things before you move on to the big enchilada. In other words, the amount time you save coding the final product will probably be taken up learning python. Of course, you will also get something extra out of it, because you will now know python.
Last edited by MK27; 12-22-2009 at 01:29 PM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Thank you very much for your opinions! I'll stick with C. and if I'm stuck, I know a good place to ask for some help.
No, just 'small' projects like the Linux kernel, the microcontroller that runs your coffee maker, the electronic ignition in your car, you know, minor things like that.
Yes, of course it is suited to large applications, although it is currently out of favor with fledgling programmers and academia.
The languages of choice for OS development are C and Assembly. In fact very few people think C++ is suited to OS development, although a few have tried it.
That's total bull.........
Last edited by abachler; 12-23-2009 at 07:29 AM.
Clearly, this is a rather biased view!
Is a screwdriver suitable for big construction projects? Clearly it depends, does it not?
Why do you think C is out of favor? Because usually there is a faster and easier way to do things with another language, which kind of indicates that C may not be suited for big applications.
Again, it depends!
That is because most operating systems were started when C++ did not exist.The languages of choice for OS development are C and Assembly. In fact very few people think C++ is suited to OS development, although a few have tried it.
Is it suitable for OS development? Just take a look at Symbian. All C++, baby!
That's not regex. That is string handling functions. C has those, but not regex.
Regular expression libraries are available for C even though none of them are part of the C standard library.Originally Posted by Elysia
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I generally agree in MK27 on these kind of questions. Your better choice is the language you know. It will save you much time on debugging...
When it comes to C you can also consider C++. Is there any reason you should not use std::string? Just write C-code, use std::string and compile it as a C++ code. It will take you a few minutes to understand the syntax to use std::string w/o knowing C++ at all. You can consier C++ as an added library as well as a new language.