Thread: Confused newbie

  1. #16
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by CornedBee View Post
    Ah, but what is the high and what is the low byte?

    For that matter, how do you know you have 8-bit bytes?
    Who said something about real systems?
    I just explaind the solution the creators of the task had in mind they come to the answer...
    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

  2. #17
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by vart View Post
    Who said something about real systems?
    I just explaind the solution the creators of the task had in mind they come to the answer...
    I don't think I comprehend this statement. You're saying that taking the abstract into account (i.e. the possibility of differing byte orders and byte sizes) is actually about "real systems?" And that by assuming some particular configuration you are somehow being general?

  3. #18
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by brewbuck View Post
    I don't think I comprehend this statement. You're saying that taking the abstract into account (i.e. the possibility of differing byte orders and byte sizes) is actually about "real systems?" And that by assuming some particular configuration you are somehow being general?
    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

  4. #19
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    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.

  5. #20
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by MacGyver View Post
    It only makes sense when doing math and examining binary, that we as humans, keep all of of the numbers in big-endian format.
    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

  6. #21
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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.
    Then you have things like traditional Chinese text, where the words are read from top to bottom, right to left. Top-endian, anyone?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #22
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    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.

  8. #23
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    One and twenty and twenty-one are the same no matter how you look at it. 20 + 1 or 1 + 20 is still 21.
    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".

    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).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #24
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Quote Originally Posted by MacGyver View Post
    BTW, Pride and Prejudice is good.
    u r teh gay!
    "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

  10. #25
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    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.

    Quote Originally Posted by hk_mp5kpdw View Post
    u r teh gay!
    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.

  11. #26
    Advanced Novice linucksrox's Avatar
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    198
    Although maybe the author should've explained it more thoroughly in the last chapters of the book.
    Yeah, either that, or stay away from making assumptions about technical issues that are going to confuse beginners.
    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.

    In other words, he could have been an uber 1337 programmer! He's one of us!
    ... but his name is Darcy... come on now...
    "What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)

  12. #27
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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.
    It is an endianness issue, though this time with respect to digits rather than bits, bytes, words etc.

    ... but his name is Darcy... come on now...
    Maybe he's the real fellow behind darcs?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #28
    Advanced Novice linucksrox's Avatar
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    198
    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)

  14. #29
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by linucksrox View Post
    ... but his name is Darcy... come on now...
    Like Darcy couldn't be the name of a popular O/S today.

  15. #30
    Advanced Novice linucksrox's Avatar
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    198
    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)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. newbie : a little confused ?
    By gemini_shooter in forum C++ Programming
    Replies: 4
    Last Post: 05-10-2006, 08:33 AM
  2. Newbie Question - fflush(stdin) & fpurge(stdin) on Mac and PC
    By tvsinesperanto in forum C Programming
    Replies: 34
    Last Post: 03-11-2006, 12:13 PM
  3. newbie question about linked list
    By gemini_shooter in forum C Programming
    Replies: 10
    Last Post: 04-13-2005, 10:50 PM
  4. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 01:17 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM