Why is c so popular
Furthermore, after having tried OOP for 10 years, I find it's not always useful, and often times it's easier to use procedural programming instead.
Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Learn more. What makes C so popular in the age of OOP? Asked 9 years, 7 months ago. Active 6 years, 4 months ago. Viewed 52k times. Improve this question. A blog post "Why nobody does C programming anymore" counts for C in this index. Heck, even this question may does as soon as google picks it up. The age of OOP? You have the illusion that OOP is a silver bullet, you should lose that quickly, there is nothing special or "good" about OOP, it's just one of many code organization strategies.
DeadMG: Pot, meet kettle. TIOBE's data may not be reliable, but your bald assertion that "it's not popular" has no source or citation whatsoever.
If you're going to challenge the assumption behind the question, at least provide some evidence to back it up. Show 10 more comments. Active Oldest Votes. A few factors that contribute: C is ubiquitous. Whatever the platform, C is probably available. C is portable. Write a piece of clean C, and it compiles with minimal modifications on other platforms - sometimes it even works out-of-the-box.
C has been around for a while. Back in the days when UNIX conquered the world, C the UNIX programming language of choice shared in its world domination, and became the lingua franca of the programming world. Any serious programmer can be expected to at least make some sense of a chunk of C; the same can't be said about most other languages.
If you want a library to succeed in open-source land, you need fairly good reasons not to use C. This is partially due to tradition, but more because C is the only language you can safely assume to be supported on any UNIX-like system.
Writing your library in C means you can minimize dependencies. C is simple. It lacks the expressivity of sophisticated OOP or functional languages, but its simplicity means it can be picked up quickly. C is versatile. It is suitable for embedded systems, device drivers, OS kernels, small command-line utilities, large desktop applications, DBMS's, implementing other programming languages, and pretty much anything else you can think of.
C is fast. Most C implementations compile directly to machine code, and the programmer has full power over what happens at the machine level. There is no interpreter, no JIT compiler, no VM or runtime - just the code, a compiler, a linker, and the bare metal.
C is 'free' in both the beer and the speech sense. There is no single company that owns and controls the standard, there are several implementations to choose from, there are no copyright, patenting or trademark issues for using C, and some of the best implementations are open-source.
C has a lot of momentum going. The language has been popular for decades, so there is an enormous amount of applications, libraries, tools, and most of all, communities, to support the language. C is mature. The last standard that introduced big changes is C99, and it is mostly backwards-compatible with previous standards.
Unlike newer languages say, Python , you don't have to worry about breaking changes anytime soon. C is compatible. Most languages have bindings to talk to C.
This means one can develop a library in C using standard calling conventions, and feel confident that almost any other language can link against that library.
C is powerful: if the language cannot do something, all popular compilers allow embedding assembler code which can do anything the hardware can do. Transitively combined with the above point about compatibility, this means C can act as a liaison between higher level languages and the "bare metal" of assembly. Improve this answer. I think not all your arguments are correct.
C is 'free'. So you actually don't answer the question. C11 is the latest standard, not C Not that it really matters as everyone uses ' If you can't do that, at least write a C API.
Everything in the universe can link to C code in some way or another, usually with minimal effort. C does not have closures. Some extensions of C do such as that implemented by the gcc family of compilers but C itself does not i. Show 12 more comments. The other area where OOP can go awry is focusing too much on old object concepts. I'm sure quite a few people dropped out at the "Read further only if you are interested in a physics-level exploration" part.
I am glad I didn't. Since C is fully based on variables, macros, functions, and structures, there isn't all that much to it. Due to this, C has been embedded on almost any modern microprocessor, from fridges to alarm clocks.
It lacks the expressivity of sophisticated OOP or functional languages, but its simplicity means it can be picked up quickly.
C is not a hard language to learn, so all the benefits from learning it will come quite cheap. Since almost all programming languages nowadays are themselves implemented in C , knowing C basically gives you a free ticket to knowing all programming languages. Of course, C is a procedural language, which means classes and objects are non-existent compared to languages like Python, but Python's class model itself is written in C.
This means that understanding C may not teach you object-oriented programming, but it will teach you how it was conceived, designed, and implemented.
C is the best programming language today is still the fact that it simply powers everything. From your phone to your Wifi, no other language provides the level of hardware interaction with the practicality. Many of the C projects that exist today were started decades ago.
The C language was actually created to move the UNIX kernel code from assembly to a higher level language, which would do the same tasks with fewer lines of code. Oracle database development started in , and its code was rewritten from assembly to C in It became one of the most popular databases in the world. Which is the best website to teach kids coding? Error in my C- code. Hello Friends,.
Implementation of forward and bidimensional iterators in C. Ask a Question. Formatting: Spelling, grammar or punctuation errors. Personal Attack: Disrespectful content about a person. Insincere Question: Question not seeking real answers. Incorrect Topics: Broad or inaccurate topics. Spam: Link or advertisement for a product. Not in English: Content in a different language. Not a Helpful Response: Does not address question. Images Need Explanation: Image-only or meme answer.
Incomplete Attribution: Copied text without blockquote and source. Missing Affiliations: Undisclosed relationship to topics. C is not a hard language to learn, so all the benefits from learning it will come quite cheap. As already mentioned, C is a lingua franca for developers. Many implementations of new algorithms in books or on the internet are first or only made available in C by their authors.
This gives the maximum possible portability for the implementation. Be aware that C is an old and widespread language, so you can find all kind of algorithms written in C around the web.
And so on. We would rarely discuss or think about the assembly instructions that a portion of code is executing when analyzing the behavior of a portion of code of a high level language. Instead, when discussing what the machine is doing, we speak or think pretty clearly in C. Many interesting projects , from big database servers or operating system kernels, to small embedded applications you can even do at home for your personal satisfaction and fun, are done in C.
Its versatility, efficiency and good performance makes it an excellent choice for high complexity data manipulation software, like databases or 3D animation. C is still unsurpassed when performance is the priority. The world is running on C-powered devices. We use these devices every day whether we realize it or not. C is the past, the present, and, as far as we can see, still the future for many areas of software. Subscription implies consent to our privacy policy.
Thank you! Check out your inbox to confirm your invite. Engineering All Blogs Icon Chevron. Filter by. View all results. Author Daniel Munoz. He also excels with C and ASM x Many of the C projects that exist today were started decades ago. How is the World Powered by C? Linux Linux is also written mostly in C, with some parts in assembly. Embedded Systems Imagine that you wake up one day and go shopping.
Then you get into your car. If it has the following features, also programmed in C: automatic transmission tire pressure detection systems sensors oxygen, temperature, oil level, etc. Portability and Efficiency C is almost a portable assembly language. Memory Manipulation Arbitrary memory address access and pointer arithmetic is an important feature that makes C a perfect fit for system programming operating systems and embedded systems.
Deterministic Usage of Resources A common language feature that system programming cannot rely on is garbage collection, or even just dynamic allocation for some embedded systems. Code Size C has a very small runtime.
0コメント