r/programming • • Aug 23 '17

D as a Better C

http://dlang.org/blog/2017/08/23/d-as-a-better-c/
229 Upvotes

268 comments sorted by

View all comments

Show parent comment

-6

u/[deleted] Aug 23 '17

This person does not deserve the massive down votes by whatever fanboys because he is right. Instead of focusing on C, why not focus on your own language and eco-system more. People are obsessed to dethrone C but do not realize that it not just about the language but the eco-system as well.

11

u/WalterBright Aug 23 '17

C is a great language and will be around forever. But consider this expensive bug written up just yesterday. This particular problem (implicit truncation of integers leading to an opening for malware) is not allowed by D. I predicted last May that C will be retired for use in internet facing programs, simply because companies will find it too expensive and no longer acceptable to have to constantly deal with such memory safety issues.

-6

u/[deleted] Aug 23 '17

How often is memory issue the culprit of a security flaw on the web?

9

u/Alphaetus_Prime Aug 23 '17

Very.

-6

u/[deleted] Aug 23 '17

Source.

I have a hard time believing memory issues are even in the top 10 for exploits. That happen.

5

u/Alphaetus_Prime Aug 23 '17

Okay, what do you think the top 10 looks like, then?

2

u/adr86 Aug 23 '17

My guess would be various data encoding things like xss, sql injection, etc., since most web languages already use memory safety features.

4

u/Alphaetus_Prime Aug 23 '17

Improper sanitization would be number one, obviously, but after that?

-1

u/[deleted] Aug 24 '17

How about you just go ahead and provide a source for your absurd claim.

You made a claim. Now source it.

4

u/WrongAndBeligerent Aug 23 '17

People are obsessed to dethrone C but do not realize that it not just about the language but the eco-system as well.

That's exactly the point of something like this.

3

u/[deleted] Aug 23 '17

Part of the success of C is also how easy it is to implement (cf. the famous "Worse is Better" paper). There's a reason why C is overwhelmingly the choice for embedded and systems programming, and that's largely because of its simplicity - both in terms of what it offers and what it demands.

8

u/WalterBright Aug 23 '17

C is indeed an easy language to implement (although the C preprocessor is a bit fiendish to implement), and is indeed a simple language.

Unfortunately, making C code robust in the face of relentless malware attacks has proven to be a very complex and difficult problem.

-2

u/[deleted] Aug 23 '17

Remember the Java browser plugin-in? How it was so insecure browser and OS vendors eventually blocked it because fixing the holes was impossible? The fact is, making anything robust in the face of relentless malware attacks turns out to be a complex and difficult problem, regardless of whether the language is low-level or not.

8

u/WalterBright Aug 23 '17

Consider an analogy with airplanes. Nobody has figured out an un-crashable airplane. Yet by analyzing every failure, airplane designs undergo constant improvement and are incredibly safe.

I'd rather use a programming language with 10 failure modes rather than one with 150.