All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
The question was:
what the authors of the book had in mind when they gave the above answer.
I described what this...
I do not say it is a correct they to think... Just - it is a way, and I suppose they have this way in their minds...
So if your interrested to know how the author get his answer - 95% sure - that's how.
If you interested to know - If the author correct in his assumptions - you can read other posts in this thread to make a conclusion.
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
I think what vart meant was the authors of programming books generally assume that the system is a 8 bit big endian. I mean, that's the majority of the PCs in the past ages. So, maybe the author doesn't think he need to explain the system he currently using or little / big endian differences. IMHO, newbies won't like to read a too technical book. Although maybe the author should've explained it more thoroughly in the last chapters of the book.
ERROR: Brain not found. Please insert a new brain!
“Do nothing which is of no use.” - Miyamoto Musashi.
We as people of the western hemisphere, you mean. And not even completely. For example, in Germans spoken numbers, the last two digits are flipped. One hundred and twenty-one is "Einhunderteinundzwanzig.", literally "One hundred, one and twenty." (Jane Austen still used this form for all her girls of one-and-twenty years.)
In other places, it's even more extreme. Arabic writes text from right to left, but numbers from left to right. Since they have the same order within numbers as we do, you could say that they write numbers in little-endian format, if you go in text reading direction.
And so on.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Then you have things like traditional Chinese text, where the words are read from top to bottom, right to left. Top-endian, anyone?In other places, it's even more extreme. Arabic writes text from right to left, but numbers from left to right. Since they have the same order within numbers as we do, you could say that they write numbers in little-endian format, if you go in text reading direction.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I would argue that what you two are describing is not endianess per se, as in binary.
One and twenty and twenty-one are the same no matter how you look at it. 20 + 1 or 1 + 20 is still 21. It doesn't change the result of the number if you assume it to be one way or the other. One can be well versed in pronouncing and thinking of 21 in any way they wish, but if they see another form, there is no ambiguity. They should be able to understand it.
In binary form with regard to endianess, you get very different results in terms of how you write them. There is also no way of knowing the endianess by just looking at a number such as in the previous example. When we want to look at a binary number, I think all people would prefer to deal with it in big-endian form. If anybody actually prefers doing math and such with little-endian format, I would be interested in hearing it.
BTW, Pride and Prejudice is good.
Not really. 12 could be read as "one and twenty", while 21 could be read as "twenty-one". Indeed, the number itself remains the same, but its symbolic representation is different. In the case of Chinese, thirty-five would be fifty-three if read in the other direction, so "there is also no way of knowing the endianess by just looking at a number".One and twenty and twenty-one are the same no matter how you look at it. 20 + 1 or 1 + 20 is still 21.
I do see your point for larger numbers though: "One hundred, one and twenty" is neither little-endian nor big-endian, and the Chinese representation of 1053 may leave one in doubt of whether it is 1053 or 1035, but certain that there is a thousand involved (and from there deduce endianness of the tens and ones places).
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
12 would be twelve..... nobody ever writes 21 in that form that I know of for any reason, although I would concede that this would be something more akin to endianess, as it conforms to the same exact issues that we have for binary.
I guess this is why they people write numbers out formally as non-digits in English and other languages in many books.
Oh come on, how can you say that? Take a look at the main male character. Darcy can be described as the following:
- Non-social.
- Rude
- Having a big ego.
- Good guy.
- Trustworthy.
In other words, he could have been an uber 1337 programmer! He's one of us!
Last edited by MacGyver; 06-26-2007 at 05:41 AM.
Yeah, either that, or stay away from making assumptions about technical issues that are going to confuse beginners.Although maybe the author should've explained it more thoroughly in the last chapters of the book.
And btw, for the second exercise, in my head I would've guessed that the answer was 4. So in my opinion, ALL C++ compilers should implement the same order of operations that I used in my head. Ok, just kidding.
... but his name is Darcy... come on now...In other words, he could have been an uber 1337 programmer! He's one of us!
"What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)
It is an endianness issue, though this time with respect to digits rather than bits, bytes, words etc.12 would be twelve..... nobody ever writes 21 in that form that I know of for any reason, although I would concede that this would be something more akin to endianess, as it conforms to the same exact issues that we have for binary.
Maybe he's the real fellow behind darcs?... but his name is Darcy... come on now...
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Yea, well, you've gotta imagine there are all sorts of different kinds of programmers out there: different genders, races, ORIENTATIONS, etc. Not that there is anything wrong with that... The world keeps on spinnin'.
And I didn't know endianness was a word... hmm.
"What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)
No, yea, I know what you mean. Darcy is a good name... yea, I'd be friends with a guy named Darcy. Sure. Write a program, call it "code name Darcy." Solid programming for sure. Darcy, absolutely. I'd vote for Darcy. If a Darcy ran for governor, I'd vote for him.
"What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)