Alternative C, C ++?

Everything,

There are so many programming languages ​​/ operating systems / device drivers, that is, software tools that are created using C and C ++ . I was wondering if C and C ++ were the only 2 low-level programming languages ​​that all companies have ever had to create their own products? If so, why are C and C ++ getting so many preferences over other options?

+6
c ++ c
source share
10 answers

There are other low-level languages, but C has the effect of "snowball popularity."

This is about as effective as any reasonably portable language, so it is a good choice for system programming. Once you create an operating system on it, it makes sense to create tools for the same system with it, so many programmers got access to it in the 80s and 90s. Thus, he became a lingua franca with which all system programmers were familiar.

Relatively little can be done to improve C without compromising on its effectiveness or portability, so there was no obvious place to compete with it at a low level.

+3
source share

There are many mid-level languages ​​suitable for OS development, but C and, to a lesser extent, C ++ are by far the most popular. There are many reasons for this, including:

  • C's early success as a Unix implementation led to its widespread adoption.

  • The huge availability of excellent development tools (compilers, lint, editors, memory leak analysis, profiles, code generators, ad nauseam) makes C even more convincing.

  • The proximity of C to the level of "abstract machine"; unlike, say, Pascal, which has significantly more execution time. This is desirable when writing high-performance software. C is sometimes called "portable assembler" for its proximity to hardware.

+7
source share

Forth is sometimes used to develop low-level software, such as device drivers. For example, the boot release for SUN SPARC-based servers was used by Forth. See http://en.wikipedia.org/wiki/Open_Firmware for more details.

+6
source share

I know some people who program systems in D. This is a lower level than C #, etc., but it has many of the same advantages of modern languages.

+3
source share

Even more than a low level of abstraction, the key function of C and (C ++ with RTTI disabled), applicable to system software, is that they do not need a runtime library.

See, you can write a compiler in the same language, but you cannot write runtime in a language that depends on it.

C has a standard library, but not a runtime library, so you can implement a standard C library, and you can also use it to write runtime libraries for other languages. Same for C ++ (with RTTI disabled).

+3
source share

No, there is an absolute bucket of language downloads that companies use to create their software. C has a clear advantage over all of them for one specific area, which is very low-level because it has very little connection between code and hardware.

Most other languages ​​(including C ++ to some extent, if you do not limit yourself to the C side) usually carry a lot of unnecessary baggage, which, being an absolute find for programming applications, tends to simply interfere with the system level.

Of course, you can also use assembler code, but rarely needed now with the quality of C compilers.

+2
source share

Ada, Pascal, Build, Fortran, etc. Even if you limit your discussion to low-level languages, you still have many options. There are many companies that do not do a lot of work in C or C ++ at all (for example, the US military does a lot of work with Ada).

One of the reasons for the popularity of C and C ++ is that many people know these languages ​​(I understand that a recursive answer). Companies use C or C ++ because it’s easy to find a developer who knows the language, and developers learn the language because this is what companies hire. It also doesn't hurt that there is a very wide selection of books, compilers, IDEs, debuggers, libraries, etc. For C and C ++, and that C / C ++ compilers are available for almost any platform you may encounter. In addition, these languages ​​have been around for quite some time. Legacy C code is more likely to be supported by the C developer than being rewritten in another language. Both C and C ++ are universal, powerful languages ​​that will continue to be used for the foreseeable future. However, they are far from the only option.

+2
source share

C has been lingua-franca since the early days of Unix. There is so much existing C code, so much cultural root that people just use that language. This is even more so: C is so well designed: in its simplicity, in terms of learning speed, compilation speed, coding speed, speed of work; in our Bible study book, in the sheer amount of solid open source that we still use and crack today, and the list goes on. It’s just a useful language, as without a gravity-independent diamond sparkling millionth pen with angels’ fingerprints, it can replace a pencil.

As for C ++, it's not as simple as C. On the contrary: it is probably more complex than just about any other language there, in terms of grammar, dark angles, learning curve, modern modern code and other criteria. It would seem This complexity will kill the language, and many have actually said it for decades. Java was born on this basis. But here we are today, about thirty years after the language was born, and it still lives and kicks among the 10 most popular tags on StackOverflow. There are a number of people who are passionate about the language, yours - really among them.

Of course, this does not explain why C ++ thrives today as a popular language. I think C ++ freedom gives you support for so many different programming paradigms. This is how C ++ supports programming both low-level and C, with the same efficiency and high-level as other languages, taking into account the corresponding auxiliary libraries. I recommend you read this interview with Bjarne Stroustrup .

C and C ++, of course, are not the only alternatives for low-level programming. But this is an option that is very difficult to resist. the best option, if I can safely assume, at least for their solid, long story, which hints that they are both here to stay; and for a repertoire of solid code that demonstrates what you can do with these languages. Supporting existing software requires promises of many active boards on the network, many companies hiring a company - and all in general - live, carrying a couple of languages.

+1
source share

What about c #? Many Windows applications are created using C #.

What about Perl / Python? Many applications on Windows and Linux get builds using these languages.

How about D? Always a good language to use, but it’s sad that it doesn’t speak as well as I need with my native C ++.

0
source share

Partly because it was one of the first high-level languages ​​(after B), which was adopted on a large scale. Languages ​​like Java are owned by companies that can be deleted if a pin falls, and then you won’t see any updates from oracle. There is also the fact that c and C ++ translate to a relatively low level of assembly code, which makes it much smaller and more compact.

There is also the most important philosophy of C. You do not pay for what you do not need. (i.e., in java, you have garbage collection, but if you are writing a program that does not need a garbage collector, what wasted resources and you are paying speed and efficiency for this.) In C, if you need something need, you do it yourself, there are no lost resources, much more efficient code (depending on the programmer).

0
source share

All Articles