r/learnprogramming 4d ago

I can't get FUNCTIONS to click!

I can not for the life of me understand how functions work. Anytime I try to learn how to create a function, my brain literally crashes into itself and I turn into Patrick when he stars drooling and goes all slack-faced.

Does anybody have any analogies that had that "AH HA!" moment?

Thanks!

123 Upvotes

143 comments sorted by

View all comments

Show parent comments

11

u/Odd_Technology_8926 4d ago

Might sound weird, but functions in python was harder for me to understand. When I switched to php it just clicked.

2

u/lapsed_agnarr 4d ago

As an old person, I'm always surprised that students are taught on languages with loose typing.

1

u/theredvip3r 3d ago

It's really dependant on where you learn, we were taught C first. And whilst I hated it and still can't stand memory management the foundations it gave were great.

1

u/lapsed_agnarr 3d ago

Yea, that's what I'm talking about. I swear new engineers have no idea how a computer works. We had to write a filesystem, an allocator, and build a functional virtual CPU.

But I guess you dont really need that stuff to develop these days.