Content-Length: 12038 | pFad | http://lwn.net/Articles/697221/

Weird [LWN.net]
|
|
Subscribe / Log in / New account

Weird

Weird

Posted Aug 15, 2016 2:52 UTC (Mon) by ncm (guest, #165)
In reply to: Weird by neilbrown
Parent article: Better types in C using sparse and smatch

Making C better led directly to C++. There is no defensible reason for a programmer competent in C to choose it over C++ for a new program. All it takes to start is file names with a *.cc suffix, and the right compiler. If you don't like some feature in C++, you are not obliged to use it in your program. But the prospect of faster, more reliably correct programs written more quickly is a benefit you cannot rationally justify avoiding. Pottering about with hacks on C to help you catch problems that C++ already eliminated a decade ago is a tragic waste of your short time on Earth.

Learning Rust would certainly slow you down, for a while. Rust is mostly an opportunity for the next generation of serious programmers, and those who will teach them. But before you know it, the most interesting programs will be coded in Rust, and you will need to know it to read them.


to post comments

Weird

Posted Aug 18, 2016 12:07 UTC (Thu) by tuna (guest, #44480) [Link]

If you want to make libraries that are usable from many different languages it is probably easier to use C than C++.

Weird

Posted Aug 18, 2016 16:26 UTC (Thu) by Wol (subscriber, #4433) [Link] (1 responses)

> There is no defensible reason for a programmer competent in C to choose it over C++ for a new program.

Why then, looking at lilypond and libreoffice C++ code, do I think "what the hell is going on here", yet when I looked at the (C) code for mdadm, I felt at home straight away?

Or, trying to write my pet project in C++, I'm left wondering how on earth I interact with the hardware to the extent that I actually know what is going on at the hardware level?

Cheers,
Wol

Weird

Posted Aug 18, 2016 16:37 UTC (Thu) by andresfreund (subscriber, #69562) [Link]

> Or, trying to write my pet project in C++, I'm left wondering how on earth I interact with the hardware to the extent that I actually know what is going on at the hardware level?

Huh? There's no difference between C and C++ on that end of things.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://lwn.net/Articles/697221/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy