Live data from Hacker News

3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

stroustrup.com

91–100 of 231 posts

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#91
post #17

I miss my days working with C++. It's moved further down the development stack than where it used to be. We used to handle UI, API parsing, and pretty much everything using C++.

I felt some nostalgia for Fortran a while ago. Spent half an hour programming in it, cured. Maybe take a shot at parsing JSON in C++ and see if the nostalgia survives the process.

>Maybe take a shot at parsing JSON in C++ and see if the nostalgia survives the process.

I have used this library in the past and was actually pretty easy

https://github.com/nlohmann/json

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#93
post #45

Earlier quoted context omitted.

The most complex, demanding and cutting edge computational fields - Machine Learning, Artificial Intelligence, Real-time multi-user Gaming, High frequency Trading, Rendering/Animation, High Performance Computing, Compiler infrastructure (LLVM) - are all at the core written in C++ for the most part. There is no other option in the foreseeable future as the investment needed to rewrite (if you can find the people) is i…

> So you will need to know C++ if we want to be the cutting edge and need extreme performance. I would suggest a better phrasing might be that you should learn C++ if you want to cling to existing software in the state it is today, certain that history ended yesterday and the future is just the same forever from here on. You won't get "extreme performance" from C++ because it is buried under the weight of decades of…

A more extreme version of this would be COBOL right? Even if people stopped writing C++ today the amount of code that's already written will last many lifetimes.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#94

Know what I like about Stroustrup's code? "using namespace std;". The typical convention of sticking std:: in front of std::every std::last std::bloody std::thing drives me std::insane.

It depends ...

You should NEVER have "using namespace" (for any namespace) in a header file, since that is how you create name clashes, which is what the namespaces are there to avoid.

I don't personally like "using namespace std;" even in implementations, since I think it makes code less readable, and the contents of std:: is so large, and growing, that I'd again prefer to just avoid the possibility of name clashes.

We write code once, but read it many times, so shorter names (incl. namespaces) seems like a poor efficiency choice.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#95

Earlier quoted context omitted.

The idea of using Rust for scripting is bizaar. I can understand not wanting to use Python for everything, but I see the problem being the 'use it for everything' not the language choice. Use the tool that excels at the job. There is no language that is good at everything.

Rust is cool now. Python is not cool anymore.

Having to use the wrong tool is not cool, ever. So I don't care how cool Rust is right now, I still am not going to use it for scripting.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#96

Earlier quoted context omitted.

There's a fun stream where tsoding decides to learn Fortran, and the instructions he's working from say to turn off implicit typing (ie write "implicit none"). He's familiar with modern languages with type inference and with C++ type deduction which is a similar idea to full blown inference - and so he has no reason to even guess what Fortran is going to do without that admonition and you can see he's not happy when…

I was teaching one of the local highschool kids how to program in C and they asked "So why does everybody use i,j, and k for their indexes in loops?"

I only use 'j' and 'k', not 'i ' -- the rarely-used letters are easier to search for.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#97
Haven't used C++ in 10+ years but I remember studying an earlier version of this book in stupid depth. And this was at the end of 4 years of using 99% C++ in college.

It's such a good book. If you really take the time to understand the book C++ it seems kind of sad the world was so afraid of it.

But of course after all this I of course met an army of people who had never read a book like this at all and wrote horrifying C++ code.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#98
post #17

I miss my days working with C++. It's moved further down the development stack than where it used to be. We used to handle UI, API parsing, and pretty much everything using C++.

Often I think that I'm lucky, still working on C++ desktop applications.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#99

[flagged]

Well, he's articulate and very experienced with software development who invented the original C++ out of necessity. In fact, he sounds like an ideal person to tech good programming practices using the language he helped design.

Re: 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup

#100

Earlier quoted context omitted.

The idea of using Rust for scripting is bizaar. I can understand not wanting to use Python for everything, but I see the problem being the 'use it for everything' not the language choice. Use the tool that excels at the job. There is no language that is good at everything.

Rust is cool now. Python is not cool anymore.

The current project I’m working on has tons of resource caches (for performance), with tons of non-owning pointers sharing cache references. I’d hate to do this in opinionated languages like Rust.
Post reply on HN