is binary important

Is binary in c++ important to learn, Ive read over it and understand the basic.
I see there is alot to learn in it but it seems time could be better spent learning other things.
am i wrong?

(currently trying to understand functions, classes, operators and all that jazz)

Comments

  • : Is binary in c++ important to learn, Ive read over it and understand the basic.
    : I see there is alot to learn in it but it seems time could be better spent learning other things.
    : am i wrong?
    :
    : (currently trying to understand functions, classes, operators and all that jazz)
    [purple]
    if u understand binary, it will be easy for u to understand how computer really works. however, an extensive knowledge on binary is not required since the middle or high level programming languages wrapped them and let u think abstractly. to learn a language, basic knowledge about binary is enough i think. yes, it is better to understand the syntax and techniques of the language first.
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • : : Is binary in c++ important to learn, Ive read over it and understand the basic.
    : : I see there is alot to learn in it but it seems time could be better spent learning other things.
    : : am i wrong?
    : :
    : : (currently trying to understand functions, classes, operators and all that jazz)
    : [purple]
    : if u understand binary, it will be easy for u to understand how computer really works. however, an extensive knowledge on binary is not required since the middle or high level programming languages wrapped them and let u think abstractly. to learn a language, basic knowledge about binary is enough i think. yes, it is better to understand the syntax and techniques of the language first.
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    :


    Imho, a programmer that doesn't know about the binary system or how data is stored in memory is like a fish that doesn't know how to swim.

  • : Imho, a programmer that doesn't know about the binary system or how data is stored in memory is like a fish that doesn't know how to swim.
    :

    No, it's a fish who doesn't know what water is. It can still swim in it, but has no idea how swimming works.

    A programmer can program a lot without knowing binary, but it is a lot easier to program when one know binary. The same is for pointers, wich I learned only becouse of x86 asm. In other languages it wasn't necesary to use them, so I didn't.

    Happy coding wishes
    the one and only
    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • :
    : : Imho, a programmer that doesn't know about the binary system or how data is stored in memory is like a fish that doesn't know how to swim.
    : :
    :
    : No, it's a fish who doesn't know what water is. It can still swim in it, but has no idea how swimming works.
    :
    : A programmer can program a lot without knowing binary, but it is a lot easier to program when one know binary. The same is for pointers, wich I learned only becouse of x86 asm. In other languages it wasn't necesary to use them, so I didn't.
    :
    : Happy coding wishes
    : the one and only
    : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    :


    You can't however make good programs without knowing how things are stored in memory. And you can't know how things are stored in memory unless you know binary numbers. Example of bad programming:

    Task: make a matrix for your fancy graphics. Use 1 to tell if a pixle is drawn, 0 if it isn't.

    /* bad programmer does like this: */
    int matrix[640][480];

    /* good programmer does like this: */
    unsigned char matrix[38400];

    Bad programmer allocates 1 228 800 bytes where only 38 400 is needed.
  • : You can't however make good programs without knowing how things are stored in memory. And you can't know how things are stored in memory unless you know binary numbers. Example of bad programming:
    :
    : Task: make a matrix for your fancy graphics. Use 1 to tell if a pixle is drawn, 0 if it isn't.
    :
    : /* bad programmer does like this: */
    : int matrix[640][480];
    :
    : /* good programmer does like this: */
    : unsigned char matrix[38400];
    :
    : Bad programmer allocates 1 228 800 bytes where only 38 400 is needed.
    :

    You are assuming too much -- not everyone writes graphics program :-) I've rarly needed to do anything like that (bitmaping), and I don't think I've had any use for it at all over the last 10 years.
  • : : You can't however make good programs without knowing how things are stored in memory. And you can't know how things are stored in memory unless you know binary numbers. Example of bad programming:
    : :
    : : Task: make a matrix for your fancy graphics. Use 1 to tell if a pixle is drawn, 0 if it isn't.
    : :
    : : /* bad programmer does like this: */
    : : int matrix[640][480];
    : :
    : : /* good programmer does like this: */
    : : unsigned char matrix[38400];
    : :
    : : Bad programmer allocates 1 228 800 bytes where only 38 400 is needed.
    : :


    How would 38400 be enough? I don't get it..
    [hr]
    [Green]Mother Nature[/Green][Purple] needs your help... Please visit: [/Purple]http://www.greenpeace.ca/e/resource/green/everyday.php
    [hr]

  • : How would 38400 be enough? I don't get it..


    It only takes 1 bit to know whether a pixel is on or off, and one byte contains 8 (possibly more on some operating systems) bits. 38,400 bytes will hold 38400*8, or 307,200 bits which is the equlivant of the array of 640 X 480. So if you want the 1st pixel on row 1 column 0 it would be in bit number 480, or byte 480/8 = 60
  • : : : You can't however make good programs without knowing how things are stored in memory. And you can't know how things are stored in memory unless you know binary numbers. Example of bad programming:
    : : :
    : : : Task: make a matrix for your fancy graphics. Use 1 to tell if a pixle is drawn, 0 if it isn't.
    : : :
    : : : /* bad programmer does like this: */
    : : : int matrix[640][480];
    : : :
    : : : /* good programmer does like this: */
    : : : unsigned char matrix[38400];
    : : :
    : : : Bad programmer allocates 1 228 800 bytes where only 38 400 is needed.
    : : :
    :
    :
    : How would 38400 be enough? I don't get it..
    : [hr]
    : [Green]Mother Nature[/Green][Purple] needs your help... Please visit: [/Purple]http://www.greenpeace.ca/e/resource/green/everyday.php
    : [hr]
    :
    :

    Well, we need 640*480 = 307200 bits to represent the screen
    A byte holds 8 bits so - 38400 bytes * 8 = 307200
    And 307200 is fairly enough.

    What he meant was, that in high level languages, bad programmers may sometimes mistakenly allocate whole bytes to represent simple TRUE/FALSE states. The correct way would be to allocate bits[grey](or bytes/8)[/grey] to do this.

    This is an array of a bad progammer:
    0000000 00000001 0000000 00000001 0000001 00000001 0000000 0000001

    This is an array of a good programmer:
    01011101
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories