Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm hesitant to consider this a valid question so close or downvote if you wish, I promise not to be offended :-)
I've just been watching Herb Sutter's excellent CppCon2018 talk on making C++ more powerful and simpler at the same time. I'd strongly suggest watching this if you haven't already.
Near the end, he references an xkcd cartoon on pointers, where the three pointers given are suspiciously ASCII in nature(a), usually a sure sign that you've somehow got yourself a corrupt pointer.
The three pointers are 0x3a28213a, 0x6339392c and 0x7363682e, which equate to the three character blocks :(!:, c99, and sch. (though endian issues may reverse the order of the characters).
Does anyone know if there's any significance to these pointers?
(a) Yes, I also noticed the ASCII in Homer Simpson's 3d episode sequence, meaning I've been in this game way too long :-)
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 24 days ago.
This post was edited and submitted for review 24 days ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
For example, if I have a list of names names :: [Text], and I construct a NonEmpty Text from it, I could call it neNames, names', namesNonEmpty. Is there a standard (preferably short) convention for this?
A silly question, I know, but I'd like to know people's opinions on this. Naming is, after all, one of the two hard problems in computer science.
Edit: Apparently I'm not allowed to ask for people's opinions. However, the rest of the question still stands. Whether or not there is a standard convention for this is certainly something for which it is possible to provide citations.
Not that I'm aware of, but you might be able to borrow the convention from monadic parsers of using a 1 suffix to identify "at least one". We have sepBy and endBy when parsing zero or more things, and sepBy1 and endBy1 when parsing one or more things.
So, names and names1 might do it.
Ideally, you would try to design your datatypes so that you never have to name names at all, if an empty list of names indicates an invalid state, though I understand you might be validating an existing data structure where names can be empty into a new data structure where names1 must be non-empty.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm currently self-studying C++ and I'm about to finish my OOP course, till now, I've finished the OOP concepts but the course also includes an introduction to the STL, but I feel like it's too early to have a look on the STL at this stage(before studying Data Structures).
Is it a good idea to skip the last part of the OOP course and start studying Data Structures right now? or should I complete the course anyway?
In my opinion, if you already can understand OOP principles you should use STL and do not care how it really works under the hood, but after that, you should learn basic data structures and all will come clear for you.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
For years I have used stringname[0] to obtain the first char of a string without even thinking about it. However, I recently came to wonder if brute access to the array is really a good practice. This may seem a trivial question, but it is not because it looks deeply linked to memory/access management of STL containers.
I can think of stringname.at(0) (not very convincing) but there are probably better alternatives with an iterator. Most importantly, the ideal method would not cause an error if the string is empty.
Any widely accepted good practice for this ?
If s is an empty string, s[0] returns '\0' whereas s.at(0) throws std::out_of_range.
That difference in behavior is far more significant than any difference in performance.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I've learned about data structures and algorithms in my university course and they taught us how to implement them. After reading some answers on SO and Quora, it seems that using the STL containers are recommended.
As a software engineer/developer, you should know how a particular data structure works under the hood. and you should be able to customize/invent one when you need it. that's the reason they thought you so.
But generally you won't need to reinvent the wheel. so when there are tried and tested data structures available, like the std::stack, there's no need to do it again. specially because you'll have more bug issues in your implementation than those of STL or any other well designed one like Boost.
Unless you think you have a better knowledge of software engineering than the designers of the STL - or you have some very specific hardware requirements that they are unaware of
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've heard systems described as a "clean object model", but a precise definition does not seem to be around. It seems to refer to the classes being complete or consistent in some way.
I'm just wondering if it's referring to a specific trait or just another favorable term like 'elegant'.
Quantlib is described as "written in C++ with a clean object model".1
It's not really a technical term. A "clean" object model is a well-designed one, by whichever standard of good design. Usually it involved orthogonal classes with a clear separation of concerns and an intuitive mapping to real-world concepts, i.e. a lot of fuzziness that you'll need to judge for yourself.