Very interesting to reflect on the amount of time needed to write a technical book on a programming language. If I compare that to amount of time taken to write code (and forgive me for the horrible KLOC metric), I think one could easily average about 300 lines of good C++ code (including tests) per day on a new project -- probably more if you are working alone, but let's keep it conservative. So about 37.5 lines per…
The Time Needed to Write “Effective Modern C++”
41–50 of 152 posts
Re: The Time Needed to Write “Effective Modern C++”
#42Earlier quoted context omitted.
Constness when used on classes introduces a way to create objects that behave differently in different contexts. Are you calling a member function from a const or from a non-const pointer? Depending on that you could be running different code. In my opinion you should make your mind about what the class does: is it mutable? then don't use it with const. Unfortunately, you are still required to use const in many place…
That is an argument to avoid const overloading, not constness generally. I would say that constness is a massive boon so I use it on the vast majority of declarations. It reduces cognitive load by being able to assume that variables are not going to change.
include
void foo(const int& a, int& b)
{
std::cout
Here the value of a changes in the middle of the function even though it's a const reference, because of aliasing. Here const doesn't mean the value won't change--only that you can't change it through that particular reference. Yes, const is useful, but if you don't know what it actually does it will bite you in the ass, just like most of C++.Re: The Time Needed to Write “Effective Modern C++”
#43Is this guy actually writing C++ programs in the wild? He often presents himself as an apostle in the C++ church, but, I am always surprised that he does not seem to apply his guidelines into any practical project of his. As a programmer, I'm suspicious when people have opinions and give advice but never showed me more than snippets of code. Like a master tailor that wouldn't sew. How come he gets that much recogniti…
Re: The Time Needed to Write “Effective Modern C++”
#44for now, it seems that C is insufficiently expressive and everything else is too slow. but the complexity of C++ is troubling.
Re: The Time Needed to Write “Effective Modern C++”
#45Re: The Time Needed to Write “Effective Modern C++”
#46Earlier quoted context omitted.
D is a better alternative for many people. Speaking of Scott Meyers, C++, and D, his talk at DConf 2014 was humorous and you'll get a better sense of him. https://www.youtube.com/watch?v=48kP_Ssg2eY It depends on your actual goals. Personally, though I prefer Go for everything when possible, my favorite alternative to C++ is C++ . If you want a true alternative, Rust is probably a smarter investment of time compared…
Thanks this video is just too funny. I was aware of the quirkiness of C++ but this is very insightful. On the Go note, I like it but I think the target of Go is system programming with great concurrency support. More about Go here: http://yager.io/programming/go.html Rust seems to incorporate all of the academic research about programming languages and also moves towards memory safety and correctness, and that is a g…
The Go article has some fair points. Yet, most of the reasons the author discounts Go are reasons I prefer Go. Its minimalism is a virtue. I'm grateful that it ignores a lot of research overload. It's grounding. I see more and do more in it. Reading people's code and the standard library itself isn't painful. Go is versatile. Systems don't sum it up. In my view, it'll have a healthy stride in a lot of other areas outside of networking and the web, given time (e.g. desktop GUIs, mobile, games, game servers, etc.). In 10 years, we'll have exhausted all letters and be back on C.
Re: The Time Needed to Write “Effective Modern C++”
#47Re: The Time Needed to Write “Effective Modern C++”
#48Is this guy actually writing C++ programs in the wild? He often presents himself as an apostle in the C++ church, but, I am always surprised that he does not seem to apply his guidelines into any practical project of his. As a programmer, I'm suspicious when people have opinions and give advice but never showed me more than snippets of code. Like a master tailor that wouldn't sew. How come he gets that much recogniti…
Re: The Time Needed to Write “Effective Modern C++”
#49Is this guy actually writing C++ programs in the wild? He often presents himself as an apostle in the C++ church, but, I am always surprised that he does not seem to apply his guidelines into any practical project of his. As a programmer, I'm suspicious when people have opinions and give advice but never showed me more than snippets of code. Like a master tailor that wouldn't sew. How come he gets that much recogniti…
Those who cannot do or teach, write books.
( And use the fame derived from them to get consulting gigs. )
Re: The Time Needed to Write “Effective Modern C++”
#50I write C++ for a living and I like it, but it bothers me that we need a book that's essentially a list of "you can easily fuck this up by accident, watch out!" for now, it seems that C is insufficiently expressive and everything else is too slow. but the complexity of C++ is troubling.