this post was submitted on 25 Mar 2024
542 points (98.6% liked)

Programmer Humor

19718 readers
68 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 8 months ago (1 children)

Ah my bad, misunderstood the use case.

I thought you were talking about keeping an unmaintained library intact but building onto it.

I thought C was a really dangerous way to use that syntactic sugar pattern. Actual manipulation of the bytecode to maintain and extend a compiled binary is wild

[–] [email protected] 9 points 8 months ago (1 children)

Actual manipulation of the bytecode to maintain and extend a compiled binary is wild

Just wait until you learn about machine code. :)

[–] [email protected] 1 points 8 months ago (1 children)

I do have a degree in this. I am aware.

This is sometimes practical, too. For example, hooking and extending functions in compiled code that will never be updated by the original author, while preserving the original executable/library files.

Your original comment made it seem more like extensions - extend and preserve. That's the misunderstanding.

When I said it's wild to manipulate bytecode I means "wow that's a terrifying practice, I would hate to check that PR"

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago) (1 children)

Fair enough. What threw me is that you said "bytecode", which is generally not used when referring to hardware machine instructions. My original comment is about patching the in-memory image of a running program or library, replacing machine instructions in order to intercept certain calls and extend their behavior.

I thought my phrase "compiled code" would convey this, but I guess nowadays bytecode-compiled languages are so common that some people assume that instead.

[–] [email protected] 1 points 8 months ago (1 children)

Yeah and part of this is that the domain I've been working in for years now is very far from machine code, and I'm probably overly lax with my language here.

The result of being in very corporate app dev - I'm usually talking in much higher level abstractions. My bad on conflating bytecode and machine code

[–] [email protected] 2 points 8 months ago (1 children)

Ah, corporate work. I hope they're treating you well.

[–] [email protected] 1 points 8 months ago

Different strokes - some would find what I'm doing hell. I personally love it.

The 260k/yr salary may help alleviate the pain.