programming_horror

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Torty, in Apparently I had a high tolerance for pain

I can't tell who you hate more. Yourself or your teammates lol.

stratts,

You can't beat yourself up too much over code you wrote in the past, especially if you're just starting and you learn from your mistakes.

I'm the only dev at my company, so most of the code was written by an external dev a while back. They very occasionally do some work for us still and their code written today is just a shitty as it was 4 years ago.

tappyturtle, in Curly bracket chain

The staircase of dispair

msage, in Curly bracket chain

And that, my friends, is why you handle errors first, then do the big block of code.

fogetaboutit, in Apparently I had a high tolerance for pain

Context please, what is this bit shifting shenanigans that im witnessing right now?

impossible_silver,

PA_ prefixed functions seem to be from palibds, which is a Nintendo DS homebrew development library.

DS being a constrained device it is logical that whoever wrote this code packed multiple byte-sized info into a bigger 16-bit short and using bit shifting to extract a specific byte

stratts,

You’re right, this is some homebrew I wrote for my DS when I was in highschool.

But it was nothing as clever or logical as that! I think I had read somewhere that floats were really expensive on the DS ARM9 CPU, as was division (?). So to allow fractional values for object positions, etc, you would store them in an integer at 256x their true value, then shift it by 8 to the right to ‘divide’ by 256 and get the proper value back.

Not sure whether this was actually true, but either way this would’ve been completely cancelled out by calling that ‘lowestXInObj’ function 20 times per frame - it loops through every object in the scene!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming_horror@programming.dev
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • cisconetworking
  • normalnudes
  • tester
  • ngwrru68w68
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines