Why do programmers use hexadecimal numbers?

Поділитися
Вставка
  • Опубліковано 24 лип 2024
  • Patreon ➤ / jacobsorber
    Courses ➤ jacobsorber.thinkific.com
    Website ➤ www.jacobsorber.com
    ---
    Ever wondered about hex. Hexadecimal numbers can be intimidating to people just learning to program. This video explains what they are, how they work, and when to use them, as a more convenient replacement for binary numbers, when representing memory and network addresses, and when using bitmasks, RGB colors, and anytime when the binary representation matters.
    ***
    Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
    About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
    More about me and what I do:
    www.jacobsorber.com
    people.cs.clemson.edu/~jsorber/
    persist.cs.clemson.edu/
    To Support the Channel:
    + like, subscribe, spread the word
    + contribute via Patreon --- [ / jacobsorber ]
    + rep the channel with nerdy merch --- [teespring.com/stores/jacob-so...]
    Source code is also available to Patreon supporters. --- [jsorber-youtube-source.heroku...]

КОМЕНТАРІ • 149

  • @juicedup14
    @juicedup14 4 роки тому +138

    I love having hex

    • @JoshMadakor
      @JoshMadakor 3 роки тому +22

      How old were you the first time you had hex?

    • @the_allucinator
      @the_allucinator 3 роки тому +12

      I just had hex, and it felt so good.

    • @dxtrs_mnpltr
      @dxtrs_mnpltr 3 роки тому +18

      So hexy

    • @Inoom.
      @Inoom. 3 роки тому

      Can you explain? because 0xdigit equals 0

    • @biblicalangel4914
      @biblicalangel4914 3 роки тому +1

      But can you have hex if you have small chode?

  • @cellmaker1
    @cellmaker1 3 роки тому +9

    What a clear and very useful explanation of when and why to use Hex! Thanks.

  • @mshingote
    @mshingote 4 роки тому +16

    Your channel has very rich content. The quality of the videos, your presentation skill is really nice.

  • @jimnoeth3040
    @jimnoeth3040 11 місяців тому

    Great job explaining hex and why to use it. The first mainframe I programmed on was a GE 6000 series that had a 36 bit word (IBM used 36 bit words in their early computers too). The words were divided into upper and lower of 18 bits each. Base 8 or octal worked well in that case, so I got used to octal (or rectal as we sometimes referred to it) to represent the 18 and 36 bit values. Just a piece of history.

  • @wojciechjaworski602
    @wojciechjaworski602 4 роки тому +12

    Two 7-segments displays are enough to show the entire byte in hex and value is more readable than 8 LEDs connected to port. Good for debugging purposes in electronics, some motherboards have them to print POST codes

  • @thomasmurphy4640
    @thomasmurphy4640 4 роки тому +1

    Great timing for this video. I just start programming with hexadecimal numbers at my job.

  • @MickZeller
    @MickZeller 4 роки тому +4

    I'm digging the goatee look! Great video, as usual, thanks for putting it together!

  • @Maya_s1999
    @Maya_s1999 Рік тому

    Fantastic summary! Hexadecimal numbers here I come, thanks for the heads up Jason!!

  • @user-rx4gw7gz9m
    @user-rx4gw7gz9m 2 місяці тому

    Taking David Bombal's CCNA course and this just helped me greatly. Much simpler explanation and now converting to binary is easy, thanks !

  • @johnjackson3483
    @johnjackson3483 2 роки тому

    Sir(the respectful part) One place you will find binary in code is Ben Eater’s video on sending commands to an LCD display in C code to set register commands to set all pins to output. He says “I could use oXFF but so you can visualize it I’ll use %”11111111” to set all pins to input.
    Enjoying your videos.

  • @Jenny_Digital
    @Jenny_Digital Рік тому

    Also, having heard you mention not seeing all that much binary in code, I found it much more useful when going straight to the metal back in the day than now. Somehow it made more sense with some registers and whatnot in 6502 and back then. Thank goodness for good compilers now though!

  • @odpisani981
    @odpisani981 4 роки тому +2

    Great video as always! Thanks for sharing your knowledge with us. :)

  • @derekkonigsberg2047
    @derekkonigsberg2047 3 роки тому +53

    I have a Computer Science degree and absolutely do know how to use hexadecimal, yet somehow I've never heard the term "hexit" before in my entire life.

    • @krisboultbee1006
      @krisboultbee1006 2 роки тому +1

      Same here. I think the term "nibble" is more common. It's also a pun, which of course programmers love as well. A Nibble is a part of a Byte.

    • @JacobSorber
      @JacobSorber  2 роки тому +2

      Yeah, apparently there are dialects within the CS language. Glad I could expand your vocabulary. 😂

    • @krisboultbee1006
      @krisboultbee1006 2 роки тому +2

      @@JacobSorber That's a good point, even if you didn't really mean it that way (or even if you did). People use different terms for things all the time. So please don't take what I said as dismissal of the term "hexit". It actually makes complete linguistic sense for it to be called that. I've just never come across it.

    • @JacobSorber
      @JacobSorber  2 роки тому +1

      ​@@krisboultbee1006 No worries. Your comment didn't sound dismissive to me, at all.

    • @camm409
      @camm409 Рік тому

      I had never heard that term either but it made complete sense to me, I might rob the usage of that term to explain it to others.

  • @tymothylim6550
    @tymothylim6550 2 роки тому

    Thank you Jacob for this video. Helps clarify things for me :)

  • @Jenny_Digital
    @Jenny_Digital Рік тому +1

    I’ve been familiar with and using hex numbers since 1982-3 when dad bought us a ‘family’ home computer. It was an Acorn Electron with a built in assembler and I wore my first code on it. Sweet times!
    Seriously though, hex numbers are useful and make things easier _some_ of the time. Didn’t find it funny however when reading a datasheet for an old GI part, they used a few octal numbers without telling me they were such. Took me ages to realise what was wrong.

  • @ABaumstumpf
    @ABaumstumpf 3 роки тому

    Reminds me of a bug that took me ages to find and fix.
    For printing documents the event has a field for the document-type - so far so easy. That field is a hand written bit-set (well, mostly typedef and several defines and macros.... no, this is C++14,,,, ) but ok, and the mask for that was from an enum. And there in lied the problem - the enum was written with decimal numbers (of course partially from other defines and enums again) and somebody added a new document-type but just gave it another new integer - not a power of 2. And to make matters worse the function that mapped a given document-type-field to the actual documents was not a simple lookup but had an internal state and, given the same document-type-field again, returns the NEXT BIT that is set - a relic from when the bit-field was used for other things.
    So as long as you had only power-of-2 numbers it worked, if you had a number like 66 then the first time you checked it would give you the document corresponding to the enum for 64 and the second time it would be 2......................... which meant that when you tried to compare a document-type to it self it could return not-equal because of that -.-

  • @anandjoshua4711
    @anandjoshua4711 10 місяців тому

    Very useful video, I wish I had come across this sooner.

  • @KaspianBerheimBrudin-ny4ge
    @KaspianBerheimBrudin-ny4ge Місяць тому

    If you channel a 4-bit number through a 4bit decoder and then set the appropiate bits for a 7segment display, you can show a binary number in hex. Super easy to expand.

  • @ColinBroderickMaths
    @ColinBroderickMaths Рік тому +1

    I get alone fine with hex but I often prefer the binary notation (like 0b01101001) for masks because I can immediately tell which bits are affected with exactly zero thought. That notation is now standard in both C and C++, I believe. Naturally if you're dealing with 32-bit masks, or something large like that, it becomes a lot less convenient!

  • @amirvejahat9566
    @amirvejahat9566 2 місяці тому

    Great explanation!

  • @askr7512
    @askr7512 4 роки тому

    Can you please do a video on after effects in embedded field like losses in market, what new we can expect ... etc etc due to corona lockdown on earth...

  • @chef1arjunaidi
    @chef1arjunaidi 3 роки тому +1

    I am surprised you did not mention the HP 16C computer scientist calculator which makes base number calculations a breeze. Sadly, it is no longer in production. However, a Swiss company SwissMicros have produced DM-16, a clone of the venerable HP 16C

  • @cybercrimeconsultant
    @cybercrimeconsultant 2 роки тому

    Nice discussion on HEX.

  • @JoePescisAngryCousin
    @JoePescisAngryCousin Рік тому

    This video was great. Thank you.

  • @Rakusan2
    @Rakusan2 2 роки тому +1

    When I was learning C, I already knew hex from languages I learned before and so it did not bother me.
    On the other hand, octal did. It was mainly because I had never seen it before and at first look, I thought it was hex.

  • @ancatarca8047
    @ancatarca8047 3 роки тому

    love your videos , this was very helpful

    • @JacobSorber
      @JacobSorber  3 роки тому

      Thanks, Anca. Glad I could help.

  • @ziat1988
    @ziat1988 Рік тому

    I don't understand why there's the x in 0x16D? Only letters from A to F are accepted right?

  • @44r0n-9
    @44r0n-9 4 роки тому

    I love your videos so much.

  • @igwanwan_dagoat1523
    @igwanwan_dagoat1523 Рік тому

    So when you use numbers such as 26 you use more data in the computer?

  • @leonardoestacio5437
    @leonardoestacio5437 2 роки тому

    How rare though, when I first met hex I fell in love with it, I like it even more than the decimal base, and I code as hobby, am I some type of nerd?

  • @mnoxman
    @mnoxman 11 місяців тому

    Before the 80s Octal was quite popular too and going back even further BCD.

  • @komodot9249
    @komodot9249 4 роки тому +1

    I might have missed it ,but I think you forgot to mention big edian vs little edian. That can be really confusing when trying to read data from a binary file when you already know hex.

    • @davidolsen1222
      @davidolsen1222 2 роки тому

      And the endian nature matters a lot. Such that where the individual bytes and sometimes octets end is absolutely critical to understanding the data. A thing that gets much harder to understand if we don't have those boundaries marked by using hex.

  • @chiragjethava1186
    @chiragjethava1186 4 роки тому +1

    Can you make a video on thread pool explanation using pthread ?

    • @JacobSorber
      @JacobSorber  4 роки тому

      Check out my multithreaded server videos. One of them has a thread pool.

  • @tahmiddaniel9241
    @tahmiddaniel9241 3 роки тому

    I liked your video very much. I learnt a lot about the conversation of numbers. Thanks.
    But I have a query that (365)2 = (11110101)2 is this correct? Did I make a mistake? Please help me to figure out what error occurred?
    Advance thanks again.

    • @TomStorey96
      @TomStorey96 2 роки тому +2

      If you've done what I think you did, you don't encode each decimal number as it's own string of binary digits and then concatenate them.
      The binary representation indicates which powers of two add up to make the number.
      365(10) = 101101101(2)
      Or
      256+64+32+8+4+1

  • @lylewyant3356
    @lylewyant3356 4 роки тому +1

    Been a long time since I've studied hex or octal

  • @gabe9250
    @gabe9250 3 роки тому

    Now I know how to turn hexadecimal to decimal in my head faster, I know that’s not the purpose of the video but thanks anyway 🙏!

  • @user-sb3vh6by7e
    @user-sb3vh6by7e 3 роки тому +2

    I'm familiar with hex, but I haven't understood something yet. Why does the 0* exist? For ex: 0*F63A. Why don't we just write F63A?

    • @homelessrobot
      @homelessrobot 3 роки тому +4

      the 0x or 0h convention is to make distinguishing numbers from other symbols easier; if a token starts with a digit; the token represents some kind of number. Otherwise you have to do more complex parsing to even identify what the role of a symbol is. And the x is used two distinguish between overlapping numerical representations: 0123; is it decimal? Is it octal? Is it hex? You cannot tell just by looking at it. All of those digits are valid in all three representations.

    • @rustycherkas8229
      @rustycherkas8229 2 роки тому +2

      Consider how the parser deals with sequential characters in a C source file.
      An alphabetic character suggests a symbol is starting.
      (Eg: in "xyz = 5;" the 'xyz' is a variable name starting with letter 'x'.)
      A leading digit means that what follows is a number.
      (Eg: "x = 3.14159;" the '3' triggers interpretation as a value.)
      27 or 345 or 1024 would each be recognised as decimal integer values.
      Long ago, octal was more popular, and a leading 0 meant the value was octal, not decimal.
      (UNIX & C were developed on DEC PDP computers whose internals and machine code instruction set 'fit' with octal numbering.)
      077(base 8) is the octal representation of 63(base 10). As Hex, that would be 0x3F(base 16).
      To 'extend' C, the leading 0 has been retained to indicate "non-decimal number",
      and 'x' was added as 2nd char to indicate "this is hexadecimal, not octal".
      As to your F63A??? Consider: if( R2D2 < C3P0 )... Your 'F63A' is a valid name (token) for a variable (or a function)... How should the compiler distinguish you mean it to be a number?
      (Yes, R, P and O are not hex digits... cut me some slack, please!)
      const int F63A = 0xF63A; 🤣🤣

  • @leonardesser5802
    @leonardesser5802 4 роки тому

    Thank you, J :-)

  • @unclerojelio6320
    @unclerojelio6320 2 роки тому +1

    Hexits? I’ve been a programming since the 80’s and that’s a new one on me.

  • @rustycherkas8229
    @rustycherkas8229 2 роки тому

    @07:15 "Favourite uses for hex?"
    Sending messages to NASA if/when I'm ever marooned on Mars... 👽
    🤣🤣🤣🤣🤣

  • @sayanghosh6996
    @sayanghosh6996 3 роки тому +1

    2:00 this? what this? where ?

  • @PartheevVideoClub
    @PartheevVideoClub 3 роки тому

    Make a video on Octal decimal

  • @wandersgion4989
    @wandersgion4989 3 роки тому +1

    Anybody ever watch the CGI animated kid's show, Reboot?
    There's this cool villain in it named Hexadecimal.
    I guess she must have been really good at counting to 16.
    I think that show deserves a reboot. 😉

  • @scottbaldy8956
    @scottbaldy8956 2 роки тому

    At 3:48 you imply that 45004503 (base 10) = 11010101110101101101101011 (Binary). This is incorrect. The binary number shown equates to 56056683.

  • @lewiscole5193
    @lewiscole5193 3 роки тому +2

    IMHO, you should use hex if that's what the convention(s) is/are for the programming environment you are working in.
    In today's world, that means you will usually use hex (or decimal or occasionally binary).
    But if you're an old timer like me who used to work on a 36-bit machine with 6-bit, 9-bit, 12-bit, or 18-bit subunits where it was convention to deal with 3-bit groups, then you will usually use octal (or binary or occasionally binary).
    IOW, find out what the conventions are and stick to them, not use hex if you can't use binary or decimal.

  • @oluwatobioyinlola
    @oluwatobioyinlola 4 роки тому

    const unit32_t = 0x47F12000; Amazing Prof! :)

  • @MaheshKumar-lq1xm
    @MaheshKumar-lq1xm 3 роки тому

    Can you please upload your consciousness ?
    I can download it for my project...
    Your C videos are my only hope.
    I have double masters in computer science but still I learn something in every video of yours...👍

  • @edgeeffect
    @edgeeffect 2 роки тому

    DEAD BEEF....
    That one of the places Unix and it's friends show their age.... Hex seemed to "win" against Octal sometime around 1980s but Unix still uses Octal in quite a few places.

  • @Tyrope
    @Tyrope 3 роки тому

    5:12 "imagine if we were to write this in decimal", you mean.. like this? rgb(255, 170, 84)?

    • @homelessrobot
      @homelessrobot 3 роки тому

      thats representing the components as decimal, not the entire computed value. the entire computed value is 255*(2^16) + (170*(2^8)) + 84, or 16755284. You are not just going to be able to eyeball the components out of a number like that. You /could/ displace the components with a power of 10, but now you've made actually computing the color 10 times more difficult for your computer, and also you are wasting a bunch of padding bits
      This stuff is mostly important at a lower level than even 99% of programmers regularly operate at anymore, like where things like colors and text and data structures are actually just machine numbers with a thin venere of representative symbols.

  • @olealgoritme6774
    @olealgoritme6774 4 роки тому +3

    Nibble = half a byte
    Half a byte = 4 bits
    8 bits = 1 byte

  • @TarousDT
    @TarousDT 2 роки тому

    I only see binary in code when there are bit flags, but honestly I don't see hex very often. TO BE FAIR, I don't look at a lot of other people's code, so mostly I just don't use hex xD

  • @user-te2gb1hy9y
    @user-te2gb1hy9y 2 роки тому

    I like how HEX is, on average, shorter to write. In DEC, from 100 to 255, everything in HEX is still only 2 characters while DEC is 3 now.

    • @ninesquared81
      @ninesquared81 Рік тому

      In general, a larger base admits a shorter representation of some given number than a smaller base.
      More precisely, with N(b,k) as the number of base-b digits needed to represent an integer k, if m > n, then N(m,k) ≤ N(n,k) for integers n, m, k; n, m > 1.

  • @danieleccleston7928
    @danieleccleston7928 3 роки тому

    Jacob Sorber: Why are you Running!?

  • @jiechen1374
    @jiechen1374 2 роки тому

    3:55 Hex over binary ; 4:30 another advantage

  • @janjoska2549
    @janjoska2549 3 роки тому

    bakcground-color: rgb(255,0,0)

  • @AnilKumar-hp1qg
    @AnilKumar-hp1qg 3 роки тому +2

    Binary is like Traditional Chinese. Hexadecimal is Simplified Chinese, still is excruciatingly difficult to learn.

  • @justcurious1940
    @justcurious1940 2 роки тому

    to convert from binary to decimal u multiply each digit with powers of 2 and then u add them together but from binary to hexa u group every 4 bits then u convert them to get 1 hexa digit
    i know 1 hexa digit can represent what a 4bits can represent but what does not make sense is the way how we convert binary to decimal why we use all bits together and then we add the result of the multiplication of all digits with the powers of 2 why does it work this way ?????????? is base10 an unique base or what ??? please i cant sleep because of this i feel i'm missing something

    • @JacobSorber
      @JacobSorber  2 роки тому +1

      No there's nothing special about base 10. Base 16 is special because it's a power of 2. That's why you can take bits in bundles. So, base 4 and base 8 and base 32 would all have that property. But converting from base 2 to base 5 or base 3 you would end up doing what you're doing with base 2-> base 10.

    • @justcurious1940
      @justcurious1940 2 роки тому

      @@JacobSorber thank you for answering
      i'm trying my best to not be a heavy student here
      conversions from :
      base 2 -> base 8
      base 2 -> base 16
      base 2 -> base 32
      is very clear to me
      and also the steps we tak for these conversions make sense
      what is not clear is conversions from :
      base 10 -> base 2
      base 10 -> base 16
      base 10 -> base 3
      base 10 -> base x
      the steps u take to convert base 10 to any other base is the same u only have to change the base value for the target base
      which mean we can convert base 10 to any other base but
      we canot for example convert base 2 to base 3 or base 2 to base 5 directly right ?
      or even convert from hexadecimal to octal directly right ?
      which mean base 10 is the only base that we can convert any other base to it right ?
      like u said base 8 and base 16 are specials for base 2
      but what about base 10 on general why is it the only base that we can convert any other base to it ?

    • @JacobSorber
      @JacobSorber  2 роки тому +1

      You can convert any base to any other base. We just use base 10 because it's our societal default-it's what we're used to.
      For example, say I want to convert from base 2 to base 5.
      Consider the base-2 representation 011010
      Normally, we talk about the base-2 places as 1, 2, 4, 8, 16, 32, 64 ...
      In base 5, they would be 1, 2, 4, 13, 31, 122, 224
      So, in base 5, that number would be 2 + 13 + 31 = 101
      But, we usually mentally use base 10 as our internal "native" number format. So, people usually convert to base 10 as an intermediate step. But, you definitely don't have to.

    • @justcurious1940
      @justcurious1940 2 роки тому

      @@JacobSorber thank you so much brother i did play with base 5 a little bit i'm not gonna lie it was
      tricky with addition and multiplication but i did convert
      base 2 to base 5 using 1,2,4,13,31,112,224 as a place values
      and also i managed to convert binary to hexadecimal without grouping digits
      by using 1,2,4,8,10,20,40,80 instead of using place values in base 10 (hopefully i'm correct in this explanation )
      thank u so much i really couldn't get over it in the past few days to a point i started thinking why do
      we have 10 fingers ? is it related to the 10 digits that we have in base 10 hhhhhhhhh

  • @chinaesedog-eater
    @chinaesedog-eater 2 роки тому +1

    I love hex

  • @thomascotton2834
    @thomascotton2834 Рік тому

    Never heard of this hexit thing, 5A is one hexidecimal byte, 5A 4C is two hexidecimal bytes also known as a short or a word, the byte has two hexidecimal symbols (0 to F) a byte is 8 bit, a nibble is 4 bit, a short or a word is 2 bytes, also known as 16 bits... Never heard or seen the use of the word hexit, which is just one byte represented in hexidecimal, its not a hexit, its one byte which is 8 bit, 00 to ff.. people just call these bytes usually, not hexits.
    hexit just sounds like some odd conversion tool, id rather just call one byte.. one byte.
    if theres a community of people using the word hexit instead of byte, i mean no offense, but to me it just looks like one byte of data represented in hexidecimal, people usually just call this a byte, or bytes.
    "Heres 4 bytes in hexidecimal 5A C3 7B D4"

  • @Sollace
    @Sollace Рік тому

    0xBEEF is underappreciated, ngl

  • @NimaqAlizadeh
    @NimaqAlizadeh Місяць тому

    Nice 🎉

  • @eidiazcas
    @eidiazcas 4 роки тому +1

    But what does the 0x mean?

    • @RubiksSolver25
      @RubiksSolver25 4 роки тому +2

      eidiazcas it’s a prefix that indicates the number is in hexadecimal form

    • @JacobSorber
      @JacobSorber  4 роки тому +2

      Yeah, what RubiksSolver25 said (thanks). Otherwise, when you see a number like 101, you wouldn't know if it's decimal or hex.

    • @eidiazcas
      @eidiazcas 4 роки тому

      Thanks

    • @homelessrobot
      @homelessrobot 3 роки тому

      the leading zero tells the lexer that its a number, as opposed to an identifier with a cool name like FAAB, and the x tells it to interpret it in hex, because numbers like 465 can represent hex, or octal or decimal, but mean different things in each.

    • @rustycherkas8229
      @rustycherkas8229 2 роки тому

      @@JacobSorber 101??? Could be binary, octal, decimal or hex! 😂

  • @somuchinfo4879
    @somuchinfo4879 4 роки тому

    4:00

  • @andydelle4509
    @andydelle4509 3 роки тому

    What did you miss? I'll tell you - The dreaded DEC OCTAL base 8 system!

    • @JacobSorber
      @JacobSorber  3 роки тому

      I'll let you make that one, ok? 😀

  • @islandcave8738
    @islandcave8738 3 роки тому

    0x45

  • @HaouDeSoul
    @HaouDeSoul 4 роки тому +3

    0xDEAD

  • @69k_gold
    @69k_gold Рік тому

    Hex in itself isn't a problem, it's when some insane people write hex numbers in odd number of digits it becomes confusing

  • @jacko314
    @jacko314 Рік тому

    missed: negative numbers in hex.

  • @skybyte4me
    @skybyte4me Рік тому

    0:20 I use universal translator btw 🤣

  • @Supaship6000
    @Supaship6000 4 роки тому

    0xBEEF :D

  • @carbon3549
    @carbon3549 2 роки тому

    To be honest, I prefer binary representation over hexadecimal representation

  • @ishaktobbi4860
    @ishaktobbi4860 3 місяці тому

    i am not saying that the video is bad , but the amount of information compared to the time consumed is not much

  • @subsidizer292
    @subsidizer292 2 роки тому +1

    Here's an old hexadecimal-based geek joke.
    Q: "To be or not to be?"
    A: "FF"
    😁

    • @rustycherkas8229
      @rustycherkas8229 2 роки тому

      printf( "The answer is %d
      ", ( 'T' + 'o' + 'B' + 'e' ) & 0x1F );🤣

  • @antutucat8231
    @antutucat8231 4 роки тому

    8 bits=1 byte
    4 bits=1 hexa
    1 byte= 2 hexa

    • @syamimnijam4586
      @syamimnijam4586 3 роки тому

      Nibble is a funnier word

    • @homelessrobot
      @homelessrobot 3 роки тому

      this is also mixing metaphors; hexa is a description of the visual representation, not the size of the number being represented.

  • @dara_1989
    @dara_1989 9 місяців тому

    writing hexa numbers is easy ... but reading them is difficult , impossible

  • @ckacquah
    @ckacquah 4 роки тому +1

    0xDEADBEEF

  • @kraftwerk974
    @kraftwerk974 4 роки тому +1

    Let me summarise: $FFFFFF is more convenient than %111111111111111111111111 in your code. Isn't it ?

    • @JohnMarkIsaacMadison
      @JohnMarkIsaacMadison 4 роки тому +2

      Sometimes binary literals are a bit easier to read than hex for bit flags.

    • @JacobSorber
      @JacobSorber  4 роки тому

      Hex is more compact. Readability and convenience depend on what you're doing. But, yeah, binary literals get big fast.

    • @kraftwerk974
      @kraftwerk974 4 роки тому

      @@JacobSorber actually in my beloved 6510 I never need going beyond $FF for opcodes and $FFFF for addresses for obvious reasons but it's true that for bit instructions I tend to use binary for clarity. BRK.

    • @lewiscole5193
      @lewiscole5193 3 роки тому

      So is 07777777 (octal) now that you mention it, and it's more "convenient" to use if you're programming on a 36-bit machine.

  • @jamesbeatty-wilson5290
    @jamesbeatty-wilson5290 Рік тому

    Because tostadas were obsolete

  • @maaahakalgupta4317
    @maaahakalgupta4317 2 роки тому

    #

  • @Mintymenty
    @Mintymenty Рік тому

    So basically im a programmer now?

  • @jamesbeatty-wilson5290
    @jamesbeatty-wilson5290 Рік тому

    Zoog zomg

  • @coshvjicujmlqef6047
    @coshvjicujmlqef6047 4 роки тому +1

    Stop representing other people. I am a programmer and I do not use hexadecimal. And I would argue hex is generally just a horrible disaster. Hex floating-point formatting algorithm is a fucking disaster.
    Formatting them or parsing them is not as fast as formatting decimal digits.

    • @justshinigami9364
      @justshinigami9364 2 роки тому

      Exceptions make the rule. nobody says hexadecimals have to be used everywhere. but there are many cases where it actually is easier to use hex instead of dec. sometimes its just preference. like bitfields saved as integer: i write them out in binary so i always can look up the bits that are set by me;

  • @chesshooligan1282
    @chesshooligan1282 4 роки тому

    This video could have been 2-minutes long, perhaps even 1-minute.

    • @homelessrobot
      @homelessrobot 3 роки тому

      Maybe you should make your own 1 minute video on the topic then and save people some time? Or maybe don't look a gift horse in the mouth.

  • @justink7269
    @justink7269 2 роки тому

    I dont think this is a good explanation.