Live data from Hacker News

Does C++ still deserve a bad rap?

nibblestew.blogspot.com

271–280 of 310 posts

Re: Does C++ still deserve a bad rap?

#271
post #76

Earlier quoted context omitted.

> There isn't any point of using C++ to count words in a text file. Any high-level language like Python will beat you to it. People using c++ usually care about programs finishing before the heat death of the universe. I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant.

>I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant. Was it worth rewriting those scripts in C++? I'm not trying to be facetious; a few seconds (or minutes) of additional runtime for scripts you hardly ever run or even run only once doesn't really matter, but running such scripts often may then worth the effort to convert them to something…

> Was it worth rewriting those scripts in C++?

Mostly for development, I ended up invoking the script quite often and had to wait for the results. In production the input it ran on only changed once a week, so there was no need to run it often.

I most likely tried to run it with Pypy first, thought I am not 100% sure on that. If I ran into a similar issue today I would first try to compile it with Cython as I already try to use type annotations in every new script I write.

> What made you pick C++ over e.g. go or rust or C#?

Most of the project was already C++ and I only had to link in an Xml library for some of the output.

Re: Does C++ still deserve a bad rap?

#272

The current state of C++ is that of Madonna trying to stay relevant in the modern music world. You can have her rap, have her dab, or use autotune but she still won’t fit in as easily as a Billie Eilish. I look at C++ and wish it had C#’s compile-time attributes, first-class reflection, mixins, a decent syntax for pure virtual functions, and a more logical pointer syntax (it’s illogical and you know it). However, the…

those are super weird things to ask from C++, except the reflection. More logical pointer syntax? How is

int* -> pointer to int

and

&abc -> address of abc

and

abc->xyz -> pointer access to xyz field

and

*abc -> dereference

not as easy as it gets? 4 operators for 4 different things - whats the issue?

Re: Does C++ still deserve a bad rap?

#273

Serious question to those in the gaming industry: I heard C++ is mostly dominant there, can any other language even be considered for writing a game engine in? For serious AAA titles?

Most studios wouldn't consider changing from C or C++, but the only other realistic options as of 2020 are D and Rust.

Re: Does C++ still deserve a bad rap?

#274
post #201

Earlier quoted context omitted.

To be fair, C++'s standard I/O library is really bad. There is probably an almost universal consensus in the C++ world that the locale library is the worst standard library, immediately followed by iostreams. For small programs that's annoying, although using libc IO is usually fine for them. However, C++ is probably one of the top 3 languages for developing large applications (Java would also be there, not sure whic…

In terms of large projects C++’s role is very much shrinking. C++’s last major strength is being cross platform, but new platforms keep excluding it. You can’t program on iOS or client side websites with it. Microsoft actively discourages using C++ on Windows, and C# took over for large projects. Essentially C++ and the modern ideas about computer security are at war.

What a load of nonsense...

1) Neither iOS, nor "the web" are new platforms.

2) Not only you can program with C++ on iOS, it's heavily used in certain kinds of applications.

3) Why would anyone single out a specific language and claim that it's a problem that you can't use it to build websites with it? This applies to all languages with one exception. Or it did, because now there's WebASM, which makes this argument even more bizarre.

4) C++ had and has first-class support on Windows.

Re: Does C++ still deserve a bad rap?

#275

I have nothing against C++ per se. Used it on and off for 10 years (but most actively 3). It's a fine language. To me using C++ means you are ready to give up a lot of time and energy in order to gain a complete control over certain aspects of your program. I was very much into that at the start of my career and gradually started drifting away to more immediate productivity while reserving the right to poke under the…

One of the issues with this comment is that, while it aims to elaborate on certain aspects of C++ that make it unattractive, it tacitly promotes the idea using C++ gives a person "complete control over certain aspects of your program". Given the intent of the message, this is actually kind of harmful. There's a certain class of chest-thumping/-puffing programmer who sees this as vindication for the language. So, perpetuating that idea is bad news, especially since it's only true if applying very, very loose criteria of what it means to give a programmer "complete control".

Re: Does C++ still deserve a bad rap?

#276

I have nothing against C++ per se. Used it on and off for 10 years (but most actively 3). It's a fine language. To me using C++ means you are ready to give up a lot of time and energy in order to gain a complete control over certain aspects of your program. I was very much into that at the start of my career and gradually started drifting away to more immediate productivity while reserving the right to poke under the…

One of the issues with this comment is that, while it aims to elaborate on certain aspects of C++ that make it unattractive, it tacitly promotes the idea using C++ gives a person "complete control over certain aspects of your program". Given the intent of the message, this is actually kind of harmful. There's a certain class of chest-thumping/-puffing programmer who sees this as vindication for the language. So, perp…

This is what I heard several seasoned C++ veterans claim and so far I didn't have a reason to doubt them.

As already stated, I'm not a fan, but apparently a lot of people out there manage just fine with C++ and claim that it's actually easy and possible to attain complete control.

I'd imagine that could be somewhat true if you invest decades in that language.

Re: Does C++ still deserve a bad rap?

#277
post #117

Earlier quoted context omitted.

Why not just fuzz the library if that's a concern?

The effort required for this makes it not worth it. If I want a library in python it takes about a second to install with one command, and these libraries tend to be safe so you're not going to get any resistance if you want to try out 10 libraries in the next hour or so, which is sort of impossible with c++. Also these libraries are easily uninstalled and isolated from other python apps you have. No need to use mass…

Yeah I wouldn't use C++ for building web applications.

Re: Does C++ still deserve a bad rap?

#278

Earlier quoted context omitted.

One of the issues with this comment is that, while it aims to elaborate on certain aspects of C++ that make it unattractive, it tacitly promotes the idea using C++ gives a person "complete control over certain aspects of your program". Given the intent of the message, this is actually kind of harmful. There's a certain class of chest-thumping/-puffing programmer who sees this as vindication for the language. So, perp…

This is what I heard several seasoned C++ veterans claim and so far I didn't have a reason to doubt them. As already stated, I'm not a fan, but apparently a lot of people out there manage just fine with C++ and claim that it's actually easy and possible to attain complete control. I'd imagine that could be somewhat true if you invest decades in that language.

It isn't true unless that investment includes tons of bespoke and unrealistic compiler work and an open side channel (e.g. in the form of command-line flags to the compiler) to get it to lay down exactly what you want it to.

When people write those kinds of things, they're being hyperbolic. It's best not to assent, in light of the chest thumpers. Complete control just isn't possible in C++. More control than many of its contemporaries, yes.

Re: Does C++ still deserve a bad rap?

#279
post #274
post #201

Earlier quoted context omitted.

In terms of large projects C++’s role is very much shrinking. C++’s last major strength is being cross platform, but new platforms keep excluding it. You can’t program on iOS or client side websites with it. Microsoft actively discourages using C++ on Windows, and C# took over for large projects. Essentially C++ and the modern ideas about computer security are at war.

What a load of nonsense... 1) Neither iOS, nor "the web" are new platforms. 2) Not only you can program with C++ on iOS, it's heavily used in certain kinds of applications. 3) Why would anyone single out a specific language and claim that it's a problem that you can't use it to build websites with it? This applies to all languages with one exception. Or it did, because now there's WebASM, which makes this argument ev…

C++ is 35 years old significantly older than client side web programming. iOS apps are only 12 years old. So, they both showed up well after C++ was a mainstream language.

2) Objective-C++ may look like C++ but their different languages. As always beware of edge cases.

3) WebAsm is somewhat “supported“ by 92% of web browsers which sounds great but isn’t enough to be viable for companies like Amazon. But hey it’s a cool toy if you don’t have real work to do.

4) I have run into plenty of missing C++ documentation when C# documentation was available on Windows. It’s supported sure, but very much a second class citizen.

Re: Does C++ still deserve a bad rap?

#280
post #43

Earlier quoted context omitted.

I don't think lisp is that beloved here. It's just that the few people who love it love to bring it up.

Hacker News is written in a Lisp, started by people deeply interested in the language, and frequented in a large part by people who feel similarly.

I think that last clause is incorrect. It might have once been correct but I suspect most people on here have never used Lisp at all.
Post reply on HN