Cows Look Like Maps@sh.itjust.works to Programmer Humor · 1 年前Bill is a pro grammersh.itjust.worksimagemessage-square99linkfedilinkarrow-up1809arrow-down197
arrow-up1712arrow-down1imageBill is a pro grammersh.itjust.worksCows Look Like Maps@sh.itjust.works to Programmer Humor · 1 年前message-square99linkfedilink
minus-squaretowerfullinkfedilinkarrow-up64arrow-down3·edit-21 年前// increase the dynamically allocated memory space of a word sized integer stored at the memory address represented by the symbol "x" by the integer 1 and terminate the instruction
minus-squaremorrowind@lemmy.mllinkfedilinkarrow-up38·1 年前Wait why is it dynamically allocated and why are you increasing the memory. Something is very wrong here
minus-squarefloofloof@lemmy.calinkfedilinkEnglisharrow-up34·1 年前Found the bug. Thank goodness for comments.
minus-squareAnders429linkfedilinkarrow-up3·1 年前Oh, is this what they meant by “commenting your code”?
minus-squareAnders429linkfedilinkarrow-up11·1 年前Why the heck does it need to be dynamically allocated? Just put that puppy on the stack.
minus-squaretowerfullinkfedilinkarrow-up6·1 年前That’s what it used to do. But it was a bug, and the code has been fixed.
minus-squareautokludgelinkfedilinkEnglisharrow-up20·edit-21 年前…Years later x += config.increment; // Increases x by one """ config.yaml increment: -2 """
minus-squareZILtoid1991@kbin.sociallinkfedilinkarrow-up16arrow-down1·1 年前x++; // Move X position forward by one There, I made that kind of comment more useful!
minus-squareLostXOR@kbin.sociallinkfedilinkarrow-up9·1 年前x++; // Set x to the incrementation of the value of x Much better.
x += 1; // Increases x by one
// increase the dynamically allocated memory space of a word sized integer stored at the memory address represented by the symbol "x" by the integer 1 and terminate the instruction
Wait why is it dynamically allocated and why are you increasing the memory. Something is very wrong here
Found the bug. Thank goodness for comments.
Oh, is this what they meant by “commenting your code”?
Why the heck does it need to be dynamically allocated? Just put that puppy on the stack.
That’s what it used to do.
But it was a bug, and the code has been fixed.
…Years later
x += config.increment; // Increases x by one
""" config.yaml increment: -2 """
x++; // Move X position forward by one
There, I made that kind of comment more useful!
x++; // Set x to the incrementation of the value of x
Much better.
// Move to the right