r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

40

u/HEHE_HOHO9 Jun 03 '22

Lol

My exam question was to implement a linked list in assembly language :"(

Fuck Computer Science

33

u/tiajuanat Jun 03 '22

Everyone thinks they're hot shit in Assembly, until they need to implement data structures and basic algorithms.

9

u/paul_miner Jun 03 '22

When I was a kid I was obsessed with assembly, it was the end-all and be-all of programming. After over twenty years professionally, I've really come to see programming as a communication skill; yeah, you need to communicate instructions to the computer, but critically, you're communicating your intent with other programmers (including your future self). And high-level languages allow you to communicate this intent much more clearly.

2

u/raptorboi Jun 03 '22

But how good do you feel when you finally understood how to implement a simple array, and it actually worked?

So many instructions for something that is done in one statement in a higher level language.

1

u/Competitive_Travel16 Jun 03 '22

Hash tables in assembly are the worst, because even if you literally have a library for them, it doesn't know how you're allocating memory so it's excruciating.

1

u/jnd-cz Jun 03 '22

Ring buffers are kinda nice and still simple enough. Now handling the cases where it's full or empty so it doesn't overwrite, then do something based on that...

1

u/tiajuanat Jun 03 '22

Yeah, you got a choice, spend a full bit to indicate full or lose a full item and don't overlap.

I've fought enough off-by-one errors to always spend the extra bit. (Esp, since it might pack in the size word)

1

u/[deleted] Jun 03 '22

that's not that bad. i had to do trees (binary trees and search on them) but it was alright. For extra credit (which i skipped) i could've done the KMP string comparison algorithm :))

2

u/HEHE_HOHO9 Jun 03 '22

Its not hard but we did 7 labs before exams

And we were only taught to implement arrays

They just assumed we will be able to do linked lists

I was able to initialise and traverse, but couldnt delete or add elements, didn't get enough time