News for hackers. Stuff that matters.
Re:The Best Programming Language (or How to Stop Worrying an... by stinos on Monday March 03, 2014 @06:53AM (#7333235)
Some nice angles in the article, but now I feel obliged to defend C++ (and actually C# and F# too, but I'll let that to others as I'm sure it will turn up in the HN comments) since the author seems to make no real points to support his view of it as a monster.

First of all, it's not because x [1] and y and a bunch of others say that "a == true", you can safely use it as a fact or a way to support your view (those logical fallacies are called Bandwagon Fallacy/Appeal to Authority).

Second: I don't know where those code samples come from, but that is not exactly how you write good C++, as it is called in the paragraph. And a paragraph lower there is mention of the dreaded C/C++ - a thing that does not exist, never has, and never will. Some might say that adds to the author's points (as in, it's so hard he doesn't know how to write it properly), but you might as well say: sorry, but if you don't know how to write it properly then you do not really have the bagage needed to start criticizing it let alone calling it a monster.

[1] esecially when x is called Linus and he's in one of his rage moments where every single being that does not think alike is violently insulted and reduced to the dirt of the earth, with or without arguments making sense :]

Re:The Best Programming Language (or How to Stop Worrying an... by NAFV_P on Monday March 03, 2014 @12:05PM (#7334851)
> Some nice angles in the article, but now I feel obliged to defend C++ (and actually C# and F# too, but I'll let that to others as I'm sure it will turn up in the HN comments) since the author seems to make no real points to support his view of it as a monster.

C++ is incredibly popular, the term "C++" is even known among some non-programmers. This might partially explain why it gets a lot of flack .... oh, that reminds me:

There are only two kinds of languages: the ones people complain about and the ones nobody uses - Bjarne Stroustrup, http://www.stroustrup.com/bs_faq.html#really-say-that

I take the view that all languages are ugly and stupid, especially languages like C and English.

Re:The Best Programming Language (or How to Stop Worrying an... by andrewcooke on Monday March 03, 2014 @10:16AM (#7334108)
i guess maybe now is a good time to repeat this request - does anyone know of a good, recent book that describes how to write correct, modern c++ using the latest standards and staying with the subset of the language that expert users recognise as elegant and powerful?
Re:The Best Programming Language (or How to Stop Worrying an... by polskibus on Monday March 03, 2014 @11:01AM (#7334430)
I always recommend Effective C++ by Scott Meyers. It does not cover C++11 but is still relevant to anyone wanting to learn the good c++.
Re:The Best Programming Language (or How to Stop Worrying an... by jtfrench on Tuesday March 04, 2014 @03:32AM (#7339104)
I would have to second that. Scott's book is great (and he's a fellow Brown alum)
Re:The Best Programming Language (or How to Stop Worrying an... by pjmlp on Monday March 03, 2014 @10:19AM (#7334133)
Check Tour of C++, recently published by Bjarne.
Re:The Best Programming Language (or How to Stop Worrying an... by sanderjd on Monday March 03, 2014 @10:22AM (#7334161)
Wow, thanks, I'd been looking for this too, and somehow had failed to come across that one. Sounds perfect.
Re:The Best Programming Language (or How to Stop Worrying an... by jbeja on Monday March 03, 2014 @10:47AM (#7334329)
Sams Teach Yourself CPP One Hour a Day 7th and CPP Primer 5th
Re:The Best Programming Language (or How to Stop Worrying an... by NAFV_P on Monday March 03, 2014 @12:30PM (#7335015)
I think I have an older edition of that book, and it doesn't cover recursion. I would not recommend it for a novice programmer, other than picking up basic syntax, since it doesn't give anything substantial to sink your teeth into.

The last C++ text that I came across was "C++ In Action: Industrial Strength Programming" by Bartosz Milewski. It was first published over a dozen years ago, so it will have dated a bit. In the first chapter the author explains objects using the usual taxonomist analogy, but also explains it in terms of the concept of scope. That first chapter alone gave me more insight than most of the SAMS text.

Re:The Best Programming Language (or How to Stop Worrying an... by adamnemecek on Monday March 03, 2014 @03:14PM (#7336142)
I don't think that recursion is really idiomatic in C++.
Re:The Best Programming Language (or How to Stop Worrying an... by NAFV_P on Tuesday March 04, 2014 @04:44PM (#7343413)
> I don't think that recursion is really idiomatic in C++.

Ok, I think you could throw that at C as well. As a general programming concept it's quite idiomatic. All I know is that fucking up recursion is just as easy as fucking up iteration.

Re:The Best Programming Language (or How to Stop Worrying an... by adamnemecek on Tuesday March 04, 2014 @08:56PM (#7344731)
Well it's not really idiomatic in C either. And it's not about fucking it up but about performance. Even if you do tail recursion, it will still be slower.
Re:The Best Programming Language (or How to Stop Worrying an... by dman on Monday March 03, 2014 @11:20AM (#7334556)
Tour of c++.
Re:The Best Programming Language (or How to Stop Worrying an... by GhotiFish on Monday March 03, 2014 @09:02AM (#7333704)
Well isn't that a cute dilemma. You're either an idiot, which means you won't understand it and shouldn't criticize, or you're not an idiot and your lack of understanding is an effective criticism.

Reminds me of Haskell.

Personally, I'm of the view that the planet is populated by humans, and you have to work with them, and C++'s arcane tome of a standard is perhaps a hostile environment for such creatures.

Re:The Best Programming Language (or How to Stop Worrying an... by coldtea on Monday March 03, 2014 @11:50AM (#7334765)
>Personally, I'm of the view that the planet is populated by humans, and you have to work with them, and C++'s arcane tome of a standard is perhaps a hostile environment for such creatures.

I don't know, everybody who's doing serious commercial programming seems to doing OK with C++, for stuff from Photoshop to Premiere, and from MS Office to AAA games and super stable and fast multimedia apps, like Cubase, Studio One, Reason et al.

In fact, OSes aside, more programs of this kind (full featured applications used by billions of people) are written in C++ than in any other language, including C.

Re:The Best Programming Language (or How to Stop Worrying an... by tracker1 on Monday March 03, 2014 @02:51PM (#7335993)
> everybody who's doing serious commercial programming ...

Really, so anyone using a higher level language for line of business apps isn't doing serious commercial programming?

Re:The Best Programming Language (or How to Stop Worrying an... by coldtea on Tuesday March 04, 2014 @12:26AM (#7338652)
>Really, so anyone using a higher level language for line of business apps isn't doing serious commercial programming?

Well, IMNSHO business apps (I take it you mean "enterprise apps") are not the epitome of programming, much less serious programming. Especially in-house apps.

But it should be obvious from my description that with "commercial programming" I meant the end user market, and things people used to buy in a box or (now) download to run on their Desktop. Not, say, some IBM Java based toolset for the enterprise.

So stuff like MS Office (or LibreOffice), multimedia apps such as Premiere, Photoshop, Avid, Cubase, all modern browsers, AAA games, etc etc.

Re:The Best Programming Language (or How to Stop Worrying an... by sixbrx on Tuesday March 04, 2014 @01:49PM (#7342203)
> business apps (I take it you mean "enterprise apps") are not the epitome of programming, much less serious programming.

I'd reverse that and say the polished, packaged apps are the exceptions, these days. Code behind webservers and business backend processing is the code that runs the world now. To see C++ used in such code is pretty unusual. I do think C++ has its place: kernels, drivers, numerics. Not much else.

Re:The Best Programming Language (or How to Stop Worrying an... by GhotiFish on Monday March 03, 2014 @04:23PM (#7336576)
yes, I know. Though just because it's standard doesn't make it good.

It does offer good job security, however.

Re:The Best Programming Language (or How to Stop Worrying an... by vapourismo on Monday March 03, 2014 @10:44AM (#7334314)
May I have fries with that?
Re:The Best Programming Language (or How to Stop Worrying an... by GhotiFish on Monday March 03, 2014 @04:23PM (#7336586)
I'm sure that comment meant something. I have no idea what.