this post was submitted on 08 Oct 2023
1061 points (96.7% liked)

Programmer Humor

25649 readers
3080 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Successful_Try543@feddit.de 17 points 2 years ago* (last edited 2 years ago) (1 children)

Yes. He really thought it was efficient and would avoid errors if literally all variables were defined in a single Matlab function he called at the beginning of the script. We students all thought: "Man, are you serious?" As we didn't want to debug such a mess, in our code, we ignored what he was doing and kept using local variables.

[–] Chriszz@lemmy.world 23 points 2 years ago (1 children)

Ah I misread I thought it was specifically a programming course. I can expect this from a math prof.

[–] Successful_Try543@feddit.de 8 points 2 years ago* (last edited 2 years ago)

Yes, it was a course on finite deformation material models. And no, you do really, really not want to declare each and every variable in your material subroutine globally for the whole finite element program.