3 ms·
> They are both being used, where C and C++ were the only alternative > Some of the points to be made here is that C and C++ are being used for a very wide ran
by zeveb 9y ago
> They are both being used, where C and C++ were the only alternative
> Some of the points to be made here is that C and C++ are being used for a very wide range of applications
That's a really good point. C is an odd language: people used it to squeeze every ounce of performance out of machines, even when they didn't need to. E.g. an ls or cat written in C is almost certainly a premature optimisation. Even a program like Sendmail should probably have been written in something like Lisp or Go (had it existed) rather than in C (and anyone over a certain age knows the high price of Sendmail being written in C: vulnerability after vulnerability).
People were using C almost as a scripting language, which in retrospect is insane. Using it as a portable assembler to build the bulk of an OS, or at least the low-level parts of an OS, made sense — trying to use it for high-level programming was a mistake.
I write Go every day, but I'd like to take a look at Rust eventually. I wonder if decent Rust can be written as quickly as decent Go can.
- vram22 9y ago>People were using C almost as a scripting language, which in retrospect is insane. Using it as a portable assembler to build the bulk of an OS, or at least the low-level parts of an OS, made sense — trying to use it for high-level programming was a mistake. Before C++ and some of the less and more recent higher-level languages became available and were stable enough, people were writing both business applications and desktop / server software products in C - a lot. Biz apps that required database-like functionality were written either using ISAM-type libraries or low-level proprietary database APIs (specific to a particular database server) or using embedded SQL in C (e.g. Pro-C for Oracle, ESQL/C for Informix, DB-Library for Sybase, etc. And lots of successful Unix and Win32 software products were written in C, for both the logic and GUI parts of the apps. I've worked some earlier on real projects / products of all those types I mentioned (except Sybase). Some higher level products such as 4GLs also existed (for reporting and other purposes) and those were used too, but C was still used, even for business apps. When there were less of good higher-level-but-still performant choices available, and hardware was not as powerful, it was not an insane option at all. Plus, as is known to C programmers, "in C you can do anything." Not many higher-level languages can say that - except by linking to C libs via FFIs of some type. Obviously there were cons involved too, such as string handling, memory and pointer management, and less productivity than higher-level tools. https://en.wikipedia.org/wiki/Embedded_SQL https://en.wikipedia.org/wiki/Embedded_SQL https://en.wikipedia.org/wiki/Pro*C https://en.wikipedia.org/wiki/Pro*C https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.esqlc.doc/ids_esqlc_0862.htm https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0...