C, but not C, this is a question

I started programming in Java and then switched to C ++. Then I noticed that many languages ​​use bindings to C libraries such as GTK, OpenGL, OpenAL and many others. Also, languages ​​such as Java, Python, ADA are numerous in bindings to C libraries ... Then there are databases that have bindings to C.

Then I read Joel's article that all CS graduates need to learn C ... So I took this advice, and still it seems to me that almost everything is done in C; Linux again, etc. Many things from other languages ​​became clearer just by typing a book in the C programming language.

Why has the industry moved away from C, but is it still so stuck on the foundations of C? For example, if Java is much better than C, why isn't everything done in Java? Why libraries are not converted to pure Java and so on?

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

+4
source share
11 answers

C has some desirable properties.

It is close to metal and requires very little lead time. This means that C libraries can be very efficient when necessary. It also means that it is a good language for learning the basics of computer (not necessarily the basics of computer science or the basics of programming).

At present, almost everything has a C compiler, and there frameworks carry one if necessary. Putting the JVM on the new platform is much larger.

C has existed for a long time, and there is a generally accepted ABI. It's simple, so it's easy to use programs in most languages ​​that call C routines. It's old, so almost all language implementations have this ability.

Since C has been around for a long time, it's easy to find C programmers whenever you want.

+11
source

You need to know C, even if you are not going to use it professionally, because it is close enough to the car so that you can better understand this car.

The reason most of them don't use it professionally is because it takes longer to write the same program in C with respect to Java / C #, which makes it bad for business and because many programmers don’t love to use it.

(For the record, my favorite language is C ++ - I'm not trying bash C here, I'm just trying to explain what I heard before)

+9
source

Each programming language has its advantages and disadvantages. That's why.

+4
source

So what would you write Java virtual machines?

At the bottom of the language level should always be something that works at a low level, next to the "bare metal" and something almost always C.

+3
source

Basically, there is a case of choosing the right tool for the job. C / C ++ is a “lower level” than Java, and (everyone else is equal) should be used for lower level tasks.

C / C ++ is more suitable if you want to write code that is "close to metal" for maximum performance or interaction with equipment. Suitable for graphic games, developing an operating system, writing Linux / UNIX utilities, high-performance computing.

Java is more appropriate when you are more interested in development mobility, security, usability, and productivity. Suitable for business applications, prototypes, web applications and less intensive games.

I professionally encoded both. I am currently using Java because most of the things I develop are in the latter category. But I would use C / C ++ if I wanted to develop something in the previous category.

+2
source

C is very simple, it does not have the convenience of using other languages, you can create it to have more features. The problem is that you have to build it.

Java and C ++ and other high-level languages ​​are popular because they already have many functions, and this greatly simplifies the life of programmers. Personally, I like it just :)

+1
source

It depends. Some companies still use C. It is more about getting a business advantage from the language used. If you are developing a device driver, then I'm sorry, you need to stick to fairly low-level languages. But if you plan to develop a "corporate" application, then you will probably see more Java / C # because of the high level of language, the time it takes to implement the implemented functions, as well as the development cost. It all depends on the application. Now the language arena is more diverse, and everyone I think chooses a language to get the most out of it.

Although C is good to know, because by studying it, you acquire some fundamentals of computer science that are universal.

0
source

Businesses tend to use higher-level languages ​​instead of lower-level ones because less time is required to create functional programs. And since time is money, they want to quickly create programs to make a lot of money. Using C to create a simple program is an attempt to smooth out a handkerchief with one of these clips. It works, but it is exaggerated.

Also, did you mean that your title was “C C or not C”? This is the question. "(Hamlet-gake here ...)

0
source

Software development is more important than a programming language. This suggests that C will be a good language to start programming. When you are developing to become a better designer and based on the needs of the project and the platform you speak, you need to switch to languages ​​that provide better ease of use (I'm not saying that they are better than C).

As one of the posts mentions creating a larger enterprise solution, you can switch to using C ++, Java, and C #. You can also write a good object-oriented solution using C, but other languages ​​provide support for it, and therefore you also speak, and also concentrate more on the design part.

0
source

In addition, the TIOBE index does not measure how big the language is, how much people love the language, how many applications are written in the language, or something like that. It measures how many people mention the name of a language. This will mean your resume, in which you are likely to mention only languages ​​that are still considered relevant, or in posts where you claim that one language is better than another, where again even your defeated language seems to be to relate both to you and to you the people with whom you are talking.

If I said that driving is faster than walking, but the use of a skateboard is not mentioned, the approach of the TIOBE index will be evaluated going above skateboarding. Then, if someone else said that cycling is faster than walking, walking will be at the top of the list. It is interesting and significant that people use C as a comparison language in these conversations. But the point he makes is not that C is better, or that all students should learn this. (And yes, I know C and C ++. And I once knew several assembler languages. And I really honestly assembled the assembler into machine code, and then typed it into a computer, which my husband and I made in an apartment from a set and a soldering iron and random bits of wire, but that was in the eighties.)

0
source

To quote Bard:

In C or not in C - this is the question: is it worth it to suffer the syntax and obfuscation of ancient languages ​​or take a weapon against C ++ problems and, in contrast, use Java.

This is an interesting question, especially if you are comparing C ++ and C using modern compilers. There is not much between them, since C ++ is a superset of C, everything you can write in C will work pretty much in C ++.

One of the reasons why many of these libraies and the OS were not ported to C ++ is time and money. Some of the examples you cited have a lot of code, and rewriting all of this would be a huge task. What did not break ....

Then the fact arises that many of these libraries began to work before the C ++ compilers became strong enough to be used for such development, and, again, porting to another language halfway is never the idea of ​​God.

0
source

Source: https://habr.com/ru/post/1315533/


All Articles