Not sure if you're trolling, but I'll bite. This is very common in security literature -- it's always Eve, Alice and Bob, with Eve trying to intercept/subvert Alice and Bob's communications. Nothing to do with PC. That's just how it's done.
Of course, the STL was written by Stepanov before C++ was standardized. What the interviewer probably meant to ask about is the C++ standard library, which is similar but different. Or maybe they really were asking about the STL, in which case I wholeheartedly agree that bullets were dodged.
If only, Los Angeles has a vanishingly small subway system. One subway line that goes from downtown LA to North Hollywood, and an aborted line that was meant to go to Santa Monica but only made it to Wilshire.
Except that the original question only specified the parameter to be an integer, not whether it was signed or not (nor what range of values it could take)
lambdas can be faster than say, function pointers, mostly because the compiler can have more information about pointer aliasing. They should be a wash speed-wise relative to loops. Also, you say functors, which can take a few forms; this can be a callable object (e.g. a struct with its operator() overloaded, no templates needed), a stored lambda function, or a std::function object (e.g. as created through std::bind, lambdas, etc). They all look rather different; do you find all of them unreadable? Not all of them require 'enormous' header files
It was stated in a different article that they were unable to procure the current ones used in airports (millimeter wave), and that it was already rather difficult for them to acquire this one -- perhaps now you know why
Don't you think that implies at least some sort of effort to understand them?
Well apparently not, because you stated multiple points that are, as of today, patently false. Perhaps it was different in C++98, but (in case you didn't know), it's not 1998 anymore.
Not as many as possible. Use the right tool for the right job, as always. But don't rule out libraries because they use templates -- that's downright silly. Templates are made for writing generic code, which maps very well to libraries. Lastly, I don't claim to be a *good* programmer, but I do at least make an effort to understand the language that I'm using.
Might I ask what you feel to be unpleasant about C++11's additions? Do you have any specific cases in mind?
A lot of people will (and do) use the =delete syntax. Prior to that you would have to declare the method as being private, but this wasn't perfect. Class friend and member functions could still access them, and the errors would only be detected at link time. Alternately you could use boost noncopyable, but you can't always use boost. With the =delete syntax, errors are detected at compile time, and provide some semantic information about your code to anyone reading it.
Also, it's actually 6 implicit functions that compilers generate; you forgot about the copy-assignment and move-assignment operators.
Sorry but this is nonsense. Templates aren't any slower than hand-written code. Compilers may have had problems with templates a decade ago, but template support among the major compilers nowadays are very solid and consistent.
You say "many programmers minimize their use of templates, both in their own code and in their use of templated library code" -- are you saying "many" programmers writing C++ don't use boost or the standard library? Because that too is nonsense. Many bad programmers perhaps?
Lastly, partial specialization is very convenient for performing compile time recursion, which is pretty essential to template metaprogramming.
If you change a private implementation detail in a class, you have to recompile everything which uses the class. This is the opposite of encapsulation.
As with most everything, there's a way to solve that problem in C++, it just takes some work and knowledge to know what, when, and how to use it. I do agree that the language is too big though; conceptually, C++ could be broken into 4 distinct components (C, STL, templates, OOP), as each have their own quirks and idioms that don't necessarily carry over well to the other, and some are even Turing complete on their own (ie template metaprogramming)
I'm not quite sure I understand your gripe properly. You're saying that since C++ has classes, and classes are defined in header files, that calling code is dependent on the class because... it's in a header file?
If it bothers you so much, use the PIMPL idiom. Or forward declarations where you can. Or template your calling code and write to static interfaces. You've got plenty of options, you just need to know how to use them. C++ is admittedly a very large (arguably too large) language, which is both it's most compelling feature and it's biggest drawback. You can use it for pretty much everything, but fully grasping the language and knowing when to use what feature takes time. This is partly due to trying to maintain backward compatibility with C, while still incorporating new language features. Because of this hodgepodge, iterative development, some dubious choices have been made. D is meant to take the good parts of C++ and cut out the bad; it is a good idea, and a lot of the foremost C++ experts are D supporters. It's a shame that D will probably never take off.
If you're going to complain about C++, at least use valid complaints. Like about how 2 primary aspects of the language (templates and OOP/dynamic polymorphism) are partly incompatible, or about how there's no dynamic multi-dispatch built in to the language still, or how there's no concepts, or how C++11 async doesn't really give task parallelism. (And yes, there are others, many others). But classes and header files? Cmon.
As other people pointed out: who wants to work for facebook?
I was citing your post. You're the one who used them as an exemplar. Why are you asking me this?
And: do you really assume I don't know?
I have no idea what this question is referencing
And, regarding that interviewer... sorry: no one knows out of his mind how to regexp an HTML document... depending on language to use it is even more complex. An interview question like this is utter nonsense.
Or how exactly do you again skip text inside of a tag, like attribute definitions, but match between an opening and a closing tag? If someone is using regexps to search for text inside of an HTML/XML document, he is a retard. But perhaps that is the expected answer?
And why the heck should it be relevant for Amazon to regexp HTML pages?
That interview question list is completely made up. (You are asked in a phone interview to WRITE error free CODE, correct syntax? ROFL)
I provided no judgment or commentary about whether I agreed or not with the interview procedure or questions. My point was merely that being able to operate on the bit-level is still useful, mandatory in fact, to work at the places you cite as not needing them. YMMV
And as soon as you work for Facebook or Amazon, you will never have any use for 'bit bashing' again.
It's funny that you mention that. I've recently had to perform some interviews (as an interviewer), so I was looking around the 'net for some tips on how to be a good interviewer. Lo and behold I came across this piece by Steve Yegge, about the kind of questions he asks as an Amazon interviewer.
He lists "The Five Essential Questions" for phone interviews , one of which is, as you would say, 'bit bashing'. The full list is:
1. Coding. The candidate has to write some simple code, with correct syntax, in C, C++, or Java.
2. OO design. The candidate has to define basic OO concepts, and come up with classes to model a simple problem.
3. Scripting and regexes. The candidate has to describe how to find the phone numbers in 50,000 HTML pages.
4. Data structures. The candidate has to demonstrate basic knowledge of the most common data structures.
5. Bits and bytes.
So while you might not use bit bashing after you start working for those companies, you'll never get the chance to if you don't know how.
Ebola is only contagious when the symptoms are present , NOT during the incubation period. The symptoms of Ebola are pretty pronounced, so if you see someone projectile vomiting and bleeding from their eyeballs, steer clear, but otherwise you should be alright.
From the WHO Ebola FAQ:
The incubation period, or the time interval from infection to onset of symptoms, is from 2 to 21 days. The patients become contagious once they begin to show symptoms. They are not contagious during the incubation period.
4.8 was also the first GCC version that (more or less) had full support for C++11. It's not terribly surprising to get more regressions when adding (many) new features.
Not sure if you're trolling, but I'll bite. This is very common in security literature -- it's always Eve, Alice and Bob, with Eve trying to intercept/subvert Alice and Bob's communications. Nothing to do with PC. That's just how it's done.
Sure, but you'll need a time machine
Fortran doesn't have pointer aliasing. This allows the compiler to perform more aggressive optimizations
Of course, the STL was written by Stepanov before C++ was standardized. What the interviewer probably meant to ask about is the C++ standard library, which is similar but different. Or maybe they really were asking about the STL, in which case I wholeheartedly agree that bullets were dodged.
Most of those games you quoted are very old and OP has probably played them all and is looking for something new.
Wasteland 2 comes out this Friday (9/19) and Pillars of Eternity is still in Beta. Unless you've got a time machine that's about as new as it gets.
If only, Los Angeles has a vanishingly small subway system. One subway line that goes from downtown LA to North Hollywood, and an aborted line that was meant to go to Santa Monica but only made it to Wilshire.
Except that the original question only specified the parameter to be an integer, not whether it was signed or not (nor what range of values it could take)
lambdas can be faster than say, function pointers, mostly because the compiler can have more information about pointer aliasing. They should be a wash speed-wise relative to loops. Also, you say functors, which can take a few forms; this can be a callable object (e.g. a struct with its operator() overloaded, no templates needed), a stored lambda function, or a std::function object (e.g. as created through std::bind, lambdas, etc). They all look rather different; do you find all of them unreadable? Not all of them require 'enormous' header files
It was stated in a different article that they were unable to procure the current ones used in airports (millimeter wave), and that it was already rather difficult for them to acquire this one -- perhaps now you know why
Don't you think that implies at least some sort of effort to understand them?
Well apparently not, because you stated multiple points that are, as of today, patently false. Perhaps it was different in C++98, but (in case you didn't know), it's not 1998 anymore.
Not as many as possible. Use the right tool for the right job, as always. But don't rule out libraries because they use templates -- that's downright silly. Templates are made for writing generic code, which maps very well to libraries. Lastly, I don't claim to be a *good* programmer, but I do at least make an effort to understand the language that I'm using.
Might I ask what you feel to be unpleasant about C++11's additions? Do you have any specific cases in mind?
A lot of people will (and do) use the =delete syntax. Prior to that you would have to declare the method as being private, but this wasn't perfect. Class friend and member functions could still access them, and the errors would only be detected at link time. Alternately you could use boost noncopyable, but you can't always use boost. With the =delete syntax, errors are detected at compile time, and provide some semantic information about your code to anyone reading it.
Also, it's actually 6 implicit functions that compilers generate; you forgot about the copy-assignment and move-assignment operators.
Sorry but this is nonsense. Templates aren't any slower than hand-written code. Compilers may have had problems with templates a decade ago, but template support among the major compilers nowadays are very solid and consistent.
You say "many programmers minimize their use of templates, both in their own code and in their use of templated library code" -- are you saying "many" programmers writing C++ don't use boost or the standard library? Because that too is nonsense. Many bad programmers perhaps?
Lastly, partial specialization is very convenient for performing compile time recursion, which is pretty essential to template metaprogramming.
When is C++ going to natively support multiple return types? i.e.
Right now we can use a struct hack, but native support would be appreciated.
You could always just return a tuple, then use tie on the caller side. To use your example,
Also, your last question isn't really a question, is it?
The assembler? Then how do you intend to compile anything into machine code? Must be quite a project you have there
If you change a private implementation detail in a class, you have to recompile everything which uses the class. This is the opposite of encapsulation.
Yes, that's what the PIMPL idiom is for. Here's a nice introduction to it .
As with most everything, there's a way to solve that problem in C++, it just takes some work and knowledge to know what, when, and how to use it. I do agree that the language is too big though; conceptually, C++ could be broken into 4 distinct components (C, STL, templates, OOP), as each have their own quirks and idioms that don't necessarily carry over well to the other, and some are even Turing complete on their own (ie template metaprogramming)
I'm not quite sure I understand your gripe properly. You're saying that since C++ has classes, and classes are defined in header files, that calling code is dependent on the class because... it's in a header file?
If it bothers you so much, use the PIMPL idiom. Or forward declarations where you can. Or template your calling code and write to static interfaces. You've got plenty of options, you just need to know how to use them. C++ is admittedly a very large (arguably too large) language, which is both it's most compelling feature and it's biggest drawback. You can use it for pretty much everything, but fully grasping the language and knowing when to use what feature takes time. This is partly due to trying to maintain backward compatibility with C, while still incorporating new language features. Because of this hodgepodge, iterative development, some dubious choices have been made. D is meant to take the good parts of C++ and cut out the bad; it is a good idea, and a lot of the foremost C++ experts are D supporters. It's a shame that D will probably never take off.
If you're going to complain about C++, at least use valid complaints. Like about how 2 primary aspects of the language (templates and OOP/dynamic polymorphism) are partly incompatible, or about how there's no dynamic multi-dispatch built in to the language still, or how there's no concepts, or how C++11 async doesn't really give task parallelism. (And yes, there are others, many others). But classes and header files? Cmon.
And yes, the famous, fictional interview...
As other people pointed out: who wants to work for facebook?
I was citing your post. You're the one who used them as an exemplar. Why are you asking me this?
And: do you really assume I don't know?
I have no idea what this question is referencing
And, regarding that interviewer ... sorry: no one knows out of his mind how to regexp an HTML document ... depending on language to use it is even more complex. An interview question like this is utter nonsense.
Or how exactly do you again skip text inside of a tag, like attribute definitions, but match between an opening and a closing tag? If someone is using regexps to search for text inside of an HTML/XML document, he is a retard. But perhaps that is the expected answer?
And why the heck should it be relevant for Amazon to regexp HTML pages?
That interview question list is completely made up. (You are asked in a phone interview to WRITE error free CODE, correct syntax? ROFL)
I provided no judgment or commentary about whether I agreed or not with the interview procedure or questions. My point was merely that being able to operate on the bit-level is still useful, mandatory in fact, to work at the places you cite as not needing them. YMMV
And as soon as you work for Facebook or Amazon, you will never have any use for 'bit bashing' again.
It's funny that you mention that. I've recently had to perform some interviews (as an interviewer), so I was looking around the 'net for some tips on how to be a good interviewer. Lo and behold I came across this piece by Steve Yegge, about the kind of questions he asks as an Amazon interviewer.
He lists "The Five Essential Questions" for phone interviews , one of which is, as you would say, 'bit bashing'. The full list is:
So while you might not use bit bashing after you start working for those companies, you'll never get the chance to if you don't know how.
C++ has turned out to be a mess. It adds hiding to C without adding memory safety, an unfortunate feature combination unique to C++.
Adds hiding? You mean... encapsulation?
Is that the only thing you can think of that C++ adds to C? If so, that may explain why you have such a poor view of C++
– Robert Sewell
The incubation period, or the time interval from infection to onset of symptoms, is from 2 to 21 days. The patients become contagious once they begin to show symptoms. They are not contagious during the incubation period.
I was referring to Neymar specifically -- he got a fractured vertebrate in the game against Columbia and had to sit out the rest of the World Cup.
Of course, when you get kneed in the back and get a fractured vertebrae, not much acting is required.
4.8 was also the first GCC version that (more or less) had full support for C++11. It's not terribly surprising to get more regressions when adding (many) new features.