Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
posted by Fnord666 on Monday October 28 2019, @06:05AM   Printer-friendly
from the evolve-or-die dept.

C++ is a language you should give serious consideration to learning in 2019 (or whenever you happen to come across this article). Rapid language modernization, better tooling, a growing and inclusive community, and a thriving job market are just some of the reasons C++ should be your next language to learn.

Wow, this guy drank too much Kool-Aid ™️️, I'm out.

Yeah, I get it. At least in the communities I've been a part of over the years, C++ has a consistently bad reputation.

...

Modern C++ (versions ≥ 11) is an entirely different beast and should be considered separately.

foreach new_shiny in hackerland
    { import; improve; integrate; }

Plus, importing crusty old code into your projects is fun, well, at least more fun than dissecting them and re-coding in a new language which lacks the libraries they leaned on.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by HiThere on Monday October 28 2019, @05:51PM (2 children)

    by HiThere (866) Subscriber Badge on Monday October 28 2019, @05:51PM (#912899) Journal

    If you already know C++ well enough, you can use it for almost anything. (Well, it still doesn't understand directories on disk, but that's coming.) The problem is it's a lot more complex than ADA ever was, and doesn't have the security.

    FWIW, *any* Turing complete language can do anything that any of the others can. In principle. But there was a reason that languages like, e.g., SNOBOL were developed. C++ is an excellent tool for many languages that C isn't that great for, and conversely. And if you use C++ where you should use Python, you're taking lots of extra time and making things hard for yourself to no gain. (When the limiting factor is user response time, "fast enough" can't be improved on.)

    And there are problems for which no existing language is optimally designed. For one that I'm looking at byte aligned structs would be really desirable, but I also want decent handling of unicode strings, message passing parallel processing on a dynamic grid of destinations, concurrency AND parallelism, immutable structs, user defined types, decent documentation that emits static html pages (or some word processor equivalent), etc. I'm currently building a toy version in Python, and expect to need to translate that to Go at some point for the easy concurrency with faster processing. But Go doesn't have a decent screen drawing library yet. The best I've found so far is tkinter. (It currently seems better than qt, wx, or swing for my purposes). (Go does have tk libraries, but they look beta and, if the documentation is to be trusted, are not feature complete enough.)

    But this all COULD be done in C++. Probably even C, though I'm not sure about the message passing concurrency without using RAM based emulations of disk files. But handling unicode in C++ is not easy. It's doable, but I'd have to write the code rather than using a decent library (and I'd still need to use an external library, just one that wasn't feature complete).

    --
    Javascript is what you use to allow unknown third parties to run software you have no idea about on your computer.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by exaeta on Wednesday October 30 2019, @08:45PM (1 child)

    by exaeta (6957) on Wednesday October 30 2019, @08:45PM (#913869) Homepage Journal

    The point isn't about libraries, but what the core language is capable of. Unicode is just more libraries that need to be written. The core language handles text processing just fine.

    Java is unsuitable for realtime work. There is no way to get around that with a library or writing more code. The garbage collector makes it unusable. Go is unsuitable for DOS resistance. Garbage collector again. JavaScript, python, etc. is unsuitable if you need maximum performance. C is unsuitable if you need to do something complicated in a secure way. C++ can handle secure, high performance, complicated projects just fine. There is no niche it can't fill. C++ doesn't hand everything to you on a plate, but it can still do it if you write the correct code. No other language can fill all these different niches.

    Actually I need to correct myself. There is one area that C++ cannot handle, and that is the GPU. You need GLSL or DirectX shader language for that... Vulkan+LLVM may change this though!

    --
    The Government is a Bird
    • (Score: 2) by exaeta on Wednesday October 30 2019, @09:56PM

      by exaeta (6957) on Wednesday October 30 2019, @09:56PM (#913896) Homepage Journal
      ps: C++ already understands directories, std::filesystem...
      --
      The Government is a Bird