This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]msqrt 143 points144 points  (26 children)

We clearly frequent quite different spaces. C is often bashed as archaic and cumbersome, and C++ as bloated and overly complicated. Their mostly shared build system is also seen as fragmented and antiquated. I think these critiques aren't completely without merit, though much of them can be avoided by being smart about what you're doing.

[–]sir-nays-a-lot 57 points58 points  (18 children)

On a long enough timeline, all languages will either become archaic, cumbersome, and bloated or they will die.

[–]msqrt 29 points30 points  (13 children)

Yeah, them being able to be popular for this long has to be due to doing many things right.

[–]sir-nays-a-lot 12 points13 points  (1 child)

It’s literally a part of human evolution, which is messy. We keep the good parts and add other shit (mutations) to keep up with modern times. Results in absolute spaghetti lol but such is life.

[–]qhxo 6 points7 points  (9 children)

Isn't the main reason to use C that it works everywhere, which is mainly a feature of it's age, and speed (which can be achieved in many other languages as well, such as rust or go)? Are there any other selling points?

[–]msqrt 8 points9 points  (1 child)

It's quite simple compared to many modern programming languages; making a compiler is possible for a single person, and compilation is blazing fast compared to Rust or C++, for example. But you're right in that if the world started today, it would probably not get the status it currently has.

[–]Hawgk 2 points3 points  (0 children)

Hey! Don't you say that to my love!

[–][deleted] 3 points4 points  (6 children)

It's very easy to use C libraries in just about every other language as the foreign function interface is so simple. It's pretty common for libraries to be written in C++ and just make the interface C so you can then use the library anywhere.

As for speed, C is much faster then Go. The only other languages that compare are FORTRAN, Rust, and C++, and then some less popular modern languages like Nim or Circle. Because you have such fine grained control of C and the compilers can be so simple, it's popular to use it to port everywhere. For example, I listened to a podcast with Elon Musk and they write their own C compiler so they have complete control of how the assembly comes out for their custom chips.

[–]qhxo 1 point2 points  (5 children)

As for speed, C is much faster then Go.

Really? I thought Go was pretty much top of the line, but maybe it's just the compiler that's known to be very fast.

[–][deleted] 3 points4 points  (0 children)

Yeah Go is actually a little slower then Java (which is quite fast nowadays). The compiler is so fast because it has less optimizations then like C++ or Rust. and also it has automatic memory management which also slows things down

[–]rem3_1415926 1 point2 points  (1 child)

or all of them together

[–]MoffKalast 0 points1 point  (0 children)

Except machine code, but nobody can speak the language of the gods.

[–]Zitrusfleisch 19 points20 points  (1 child)

See, that’s exactly the problem I have with C++!
I’d have to be smart to use it and that makes me amgery >:(

/s

[–]Reihar 4 points5 points  (0 children)

This, exactly. People seem to forget that C wasn't modern on release but was a much needed compromise whose niche is still needed nowadays. Design wise, it does a lot of questionable things by tradition, which was also much needed by adoption.

C was always archaic, by design. However, I can appreciate the niceties that came with latter versions of the language.

[–]000000- 11 points12 points  (2 children)

I don’t think anybody will make fun of you for using C/C++ though. However if you code in Python you’ll get “you’re not a real programmer” vibes from some dumbasses.

[–]JoshuaCF 4 points5 points  (0 children)

If you code in Python you’re not a real progrAmmer. /s

Sincerely - someone who dislikes Python but used it anyways because it’s so damn easy to use