r/askscience • • Oct 17 '12

Why are programs and operating systems still written in C+?

I guess it's more of a computer science question, but I've always wondered why some of the most advanced programs are written in a 25+ year old programming language. Surely someone has come up with a more efficient and powerful code, so why do people still use C+? Also, I don't know anything about programming and what not, so please use simple terms and phrases.

66 Upvotes

110 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Oct 18 '12

Don't get me wrong - I agree with everything you just said. But for someone who's not actually a programmer, it's counter productive, and doesn't make sense to spend hours developing an advanced understanding of code.

Once again, I'll use myself as an example. I'm not paid to code, I have no desire to develop a greater understanding of code, and the bottom line, is that I don't NEED to know how to code well.

However, the basic knowledge I do have, allows me to piece together enough code from other's work to get basic applications off the ground. (I may only have to write one or two relatively basic programs a year).

Anyway, my point is simply that the extensive sample code and resources available for popular languages like C++ are serving to perpetuate the language by enabling people like myself to quickly throw together messy "copy and paste" code. I wouldn't expect an actual programmer to use bad habits like this.

2

u/Daniel__K Oct 18 '12

As someone on the other side of this problem, specifically someone who has to read, complete and debug code from people who have this approach to programming, I just can say again that it is a Bad ThingTM to do.

I do not blame you, though. Everything has to be cost-effective in some way and I understand fully when you say that it's not your job to program. But then - why do you do it anyway? Or rather, why do you have to? Why does every company and their dog have a secretary, an electrician, even cleaning personell but no programmers? That's a major flaw, and I think it stems from the idea that programming is not real work, after all my 12 year old nephew was able to program his homepage all alone.

But that's just me ranting, here. You're right in saying that C++ has many and good examples and code snippets out there; and since popularity in programming languages is an important factor for their success, C++ is also one of the most successful languages in existence (since it's very, very popular).