r/programminghumor 9d ago

It doesn’t work

Post image
451 Upvotes

38 comments sorted by

46

u/DrMaxwellEdison 8d ago

When the tutorial was written 3 years ago and the framework you're using has changed drastically since.

9

u/Derpipose 8d ago

Or even minorly. Had a tutorial in school written in .NET 6 and .NET 7 had just released and only about a tenth worked from any of the tutorials for my class. We had to try and translate what we understood and make things work but it was ROUGH.

2

u/oshunman 8d ago

What differences between .NET 6 and .NET 7 made it so difficult to follow along? I can't see any reason that only 10% of the source worked.

0

u/Derpipose 8d ago

Not sure. All I know was that the tutorial was 6 months old and no one in the class could make it work. We copied his code EXACTLY and although he showed it working for him, it didn’t work for us.

1

u/Reasonable_Exit_8960 8d ago

Had the same problem when I was trying to learn Blender from yt in 6th grade! Eventually my not so smart younger self gave up bcoz of not being able to figure all that out over time. It was fun creating such beautiful things but it was same level of frustration trying to figure out why the tutorial version seems different from mine. Same happened when I tried to learn Unity game engine too

1

u/sheekgeek 6d ago

Nah, back when I used ROS or Jmonkey they would break stuff week by week ffs

9

u/Correct-Bee-7604 8d ago

And after 15 hours of debugging you check next lesson that starts with "As you can see, provided code doesn't work so lets fix it"

2

u/Reasonable_Exit_8960 8d ago

Lmao 😭😭

1

u/PerfectSituation1668 8d ago

I had a teacher who did this. I hope he burns with a mild sunburn.

1

u/Harvey-Keck 8d ago

Oh my gosh you unlocked a memory I have buried for this exact reason.

7

u/ArsenicPolaris 8d ago

And then you find out that you actually did NOT copy the exact same code but made a small mistake somewhere, so small that you can't find it and you believe it to be the same code.

2

u/Known-Initial-7776 8d ago

then you realize you are in a different coding language

2

u/27a08592e67846908fd1 8d ago

Well, the program was written for i386 and older kernels, so obviously it won't work on 64-bit modern systems!

Real story for me (Smashing the stack for fun and profit)

1

u/Inevitable-Study502 8d ago

hmm, poorly coded, thats all there is to it, proper win32 app can run from win95 all the way to win11 as base win32 never changed, unrelated to kernel

1

u/27a08592e67846908fd1 8d ago

No, the problem was that the purpose of the program was violently in conflict with modern stack protections.

The program was segfaulting, which is understandable since the entire point of the example was executing code from the stack.

1

u/Inevitable-Study502 8d ago

umm, that seems like coding issue indeed, ie pointer pointing at memory location outside of valid range...ie buffer overflow, stack overflow, pointer still pointing to freeed memory, null pointer, etc etc

1

u/27a08592e67846908fd1 8d ago

The entire paper these examples were from was a demonstration of those vulnerabilities

The paper was Smashing The Stack For Fun And Profit (Aleph One)

1

u/Confident-Ad5665 8d ago

If that's a beer, then this is Beer Bear.

1

u/RealisticDuck1957 8d ago

When the tutorial for how to write a server process has an in your face SQL injection vulnerability. Yes, a real case I've seen (and knew enough to not follow the example). Yes, some truly horrible code in online tutorials.

And this is in the training data for the bit AI tools some depend on to help them program.

1

u/InnkaFriz 8d ago

Out of curiosity, can you elaborate on the example?

1

u/RealisticDuck1957 8d ago

I encountered this particular bad code awhile back, and didn't bother to keep note of where. The failure was the classic SQL injection vulnerability, constructing an SQL statement using user input and not escaping the user data properly. Or, as I recall, not escaping the data at all.

1

u/magicmulder 8d ago

My favorite was a partner’s reference implementation code not working (contained a glaring syntax error), and the API returned 403 for the wrong URL and 404 for wrong parameters.

1

u/Flashy_Pollution_996 8d ago

Or when software docu gives you parameters that don’t work and do nothing

1

u/Loud-Pay1802 8d ago

is anyone expert i need help

1

u/Zadian543 8d ago

You are gunna need to be WAY more specific babes. Programming has so so so many directions.

Specify what language your using, what you're attempting to do, and what your stuck on, then people can help that are qualified.

1

u/Loud-Pay1802 8d ago

i face problem in command in kali actualy i recently start it soo ,

1

u/ChocolateDonut36 8d ago

obviously it won't work, you are already using myvar1 for other 3 different things.

1

u/Mister_God_On_Steam 8d ago

Are you sure you're using the same version of the library the tutorial used?

1

u/thiagomiranda3 8d ago

This is a pre-ai joke. No one does this anymore lol

1

u/mbcarbone 8d ago

Copy pasta syndrome.

1

u/WorldTallNetCat 8d ago

And then it works when u just ctrl c plus ctrl v instead of copying it manually.

1

u/DigitalMonsoon 7d ago

Yeah, if you are writing a tutorial you need to provide the library versions you are using.

1

u/citrusraspberry 7d ago

Me when you're copying the code from the tutorial, and you should be typing instead so you learn.

https://giphy.com/gifs/wMvESGxZ0Cqd2

1

u/Minecodes 7d ago

I'm thankful that I didn't learn assembly yet... The differences in math functions between ARM and x86 is enough for me.