• 1 Post
  • 76 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle
















  • MTK@lemmy.worldtoNo Stupid Questions@lemmy.worldWhy can't code be uncompiled?
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    edit-2
    10 months ago

    I would say that it’s more like 4+4=8 but the original could have been (1+1+1+1)+(3+1) or (2+2)+(1+2+1) etc.

    Basically it’s the same thing but if you really want to understand the code and modify it in any meaningful way you have to know how it was intended and not just the results.

    My point being that decompiling does give you something similar to the original. It’s not just a guess that gives you random code with the correct result, but it could be very different from the source code.

    The reason is that the compiler does a lot of things to make it more efficient but that just means that while 1+1+1+1 can be efficiently written as 4, there still is a good reason for 1+1+1+1 from a logical sense. For example, if you’re counting something, it would make sense to say 1+1+1+1. But if you’re looking at a specific value, maybe it makes more sense to just say 4.