Live data from Hacker News

C++: Is It Really a Cruel Joke? (2003)

webhome.phy.duke.edu

121–130 of 155 posts

Re: C++: Is It Really a Cruel Joke? (2003)

#121
post #45

I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days? I liked Borland Pascal, and I know Delphi is kind of ticking along, but I'd rather invest in a language that is growing. Swift looks nice but still seems too Apple focused. Don't want to start a war, just open to some tips on the ecosystem..

>I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days?

C++ with Qt.

Re: C++: Is It Really a Cruel Joke? (2003)

#122
post #9

Modern C++ is WAY better than C, IMO. I can never go back to C, having tasted C++14, and I work on embedded systems.

Type safety, constexpr, template metaprogramming: I don't know why anybody does anything in C in embedded systems when C++11 is right there. Compile time programming is what it's all about.

Support has been slow, but even the non-GCC embedded toolchains have been improving substantially over the last few years.

Re: C++: Is It Really a Cruel Joke? (2003)

#123

Earlier quoted context omitted.

"Almost perfect"[1] disagrees with you. [1] http://www.wordplace.com/ap/index.shtml

which part? I skimmed through it and it mostly seemed to be group interplay, direction and competition. This is what kills products, not language of choice.

The part where they stick to assembly while the competition doesn't.

Re: C++: Is It Really a Cruel Joke? (2003)

#124
post #76

Earlier quoted context omitted.

There are plenty of languages in use that people genuinely enjoy using [1]. A lot of complexity in languages tends to be completely incidental. It's often not inherent in the problem the language solves, and it's just a design decision somebody made based on their aesthetic and experience at the time. A lot of people seem to take pride in memorizing these quirks, but they're just that. There's nothing fundamentally i…

I can think of only two C++ "quirks" that meet the definition of "just mental clutter; nothing fundamentally interesting about them." 1. Nested templates closing brackets conflicting with `>>` operator, necessitating `> >`. This was fixed in C++ 11. 2. Syntax for declaring an automatic variable conflicts with the syntax for C function type: `Thing mything();`. Those two certainly seem to be "unforced errors" where th…

> after witnessing disasters such as Perl 6

OOC, how long ago did you witness this "disaster"? Perl 6 is doing very well, thank you.

Re: C++: Is It Really a Cruel Joke? (2003)

#125
My biggest gripe with the language is the template thing. Templates are wonderful, but it often gets out of hand, especially with library code (I'm looking at you boost). While the interview is clearly a satire, it seems that templates were designed, or ended up upgraded, specifically to create a class of 'experts'. Being able to deal with highly nested templated code seems to be the mark of an expert, more than any other aspect of the language. Then, the whole template meta programming is just nuts and a circlejerk of sorts.

A week back I had to parse some Unicode text that had a BOM on Windows. I was using fstream. The code to be able to read the BOM was so incredibly contrived, with all the templated codecvt stuff, that I said fuck it and went back to FILE* and manually skipped the first two bytes.

Re: C++: Is It Really a Cruel Joke? (2003)

#126
post #8

Earlier quoted context omitted.

Funny how many people believe that language choice influences success. I guess they're all wrong? Sure, there are an uncountable number of other factors, but picking the wrong platform/language can be fatal.

I think it does and it doesn't. It really depends on what your end goal is. Writing a web application? Not sure it really matters much if you use Python/Django, Ruby/Rails, Java/Spring. Just use what you (or the developers) are most comfortable with. Trying to make a game engine for AAA games? Yeah your not going to get away with Ruby or Python.

> Writing a web application? Not sure it really matters much if you use Python/Django, Ruby/Rails, Java/Spring. Just use what you (or the developers) are most comfortable with.

It might matter if you used COBOL, though. Or even C++.

Re: C++: Is It Really a Cruel Joke? (2003)

#127
post #15
post #8

Earlier quoted context omitted.

Funny how many people believe that language choice influences success. I guess they're all wrong? Sure, there are an uncountable number of other factors, but picking the wrong platform/language can be fatal.

Anytime I see someone bashing Java/PHP/JavaScript on /r/programmerhumor (reddit) I challenge them to a coding contest. I use the language they just bashed, they use their ideal language. No takers yet. I think, more often than not, language choice is like golf club choice. Different pros have their preferences, but a pro can play a good game with any set of clubs. A novice will blame the clubs for a poor game.

The winner will be the one who gets to pick the task for the programming challenge.

Re: C++: Is It Really a Cruel Joke? (2003)

#128

Earlier quoted context omitted.

"Dependent" is a strong word, but tool/job fit is still important. I've personally never grown comfortable enough with C++ to get to a point where, were I to be the one calling the shots, it would ever be my first choice. But I also recognize that it's dominant in certain spaces for a reason. At the same time, I have a lot of sympathy for people who prefer C over C++. There's a lot of cognitive overhead involved in u…

I've been in the business for 15 years, I have never seen a successful product fail because it was written in language x or y. It fails for a lot of other non programming language reasons though

I have never seen a successful product that failed for any reason, ever. ;)

Re: C++: Is It Really a Cruel Joke? (2003)

#129

Earlier quoted context omitted.

I've been in the business for 15 years, I have never seen a successful product fail because it was written in language x or y. It fails for a lot of other non programming language reasons though

I have never seen a successful product that failed for any reason, ever. ;)

wordperfect

Re: C++: Is It Really a Cruel Joke? (2003)

#130
post #105
post #97

Earlier quoted context omitted.

A number of those C++ benchmarks are "cheating" by using SIMD intrinsics, which was only stabilized in Rust about two weeks ago.

1) Specifically which of those C++ programs? Innuendo is not OK. 2) Even with cheating in scare quotes, name-calling is not OK.

It's not innuendo when you consider the inherent problems with benchmarks. Once you have an algorithm, it's so hard to define what an objective benchmark is that you should assume the implementation is cheating, even if you wrote it.

I say this from personal experience; in one case I was doing timing studies to solve performance problems, and wound up fooling myself by measuring the wrong thing!

In this case, is it fair to use SIMD intrinsics? It depends on what you're trying to measure. I think that's why "cheating" is in scare quotes, because what would be cheating in one context might be useful information in another.

For instance, if C++ is providing SIMD intrinsics, it's going to beat other languages, and if I just want current performance statistics, that's the question I want to answer.

If the question is, "what's the overall quality of the code delivered by the compiler / optimizer" then using specific tricks doesn't give me a good answer.

Post reply on HN