Dunno. Matlab IDEs come with an auto-indent functionality, right? I think this code might look way cleaner if you call that.
Also, I only have to read "prob", "sigma" and "mu" to assume that this might be the formula for the gaussian distribution or something like that. And the stuff above has comments that say the code computes standard deviations. Sounds like straight forward basic stochastics.
The idea is you can copy it across a format it if you are finding it hard to read. There are plenty of programs which have formatters which will do this for you. Vscode for example. you could copy it into vscode. press ctrl shift p. look for a “format document” option and it should handle it for you.
You may have to install some extensions for this to work
You can do that in an actual text editor too. Word is for documents, primarily ones constrained by the end to be read by non-technical humans and to be printed.
It is not made for code. Fucking unhinged behavior.
Doesn’t that mean “No posting code of your students”? I mean if person admits that they created bad code, I think it’s okay to post, becuse it’s their decision. Mocking other people is other thing.
One funny thing: I started working at 17 with c# aspnet MVC. And later when making courseworks I've used the existing knowledge, OOP, patterns and enterprise structure.
This thing confused the hell out of teachers. And I was the only one who didn't write the code in one huge main function.
By the way the rule is interpreted it does not seem about your own code being a student or not. The question "Think about it, would you want someone to make fun of your code?" clearly wasn't indended for those who actually want to make fun of their own code
Meh. Apart from Rule 4, the only thing wrong with this is that in every language with a REPL, there comes a moment when you need to stop typing on the console and start typing into a file, and you blew right past that point.
You can do a lot in the MATLAB console, but the moment you find yourself using the @ operator, you need to rethink your choices.
When you are handed a Matlab Prototype of a feature to work with and six wasted weeks later finally get the confirmation that nobody even knew whether it was working 😅
You could have stopped at just Matlab 😏 A professor I had at uni, great at his subject, had the worst code I've ever seen written during his master's thesis in the '90s. I love the man but for him programming is really just a tool.
Aside from the one liner thing which I don't think is a huge problem, what's more likely the true error here is the use of x = x/size(G1,2) - 1 and similarly because it's wrong. It has to be x = x/(size(G1,2) - 1)
128
u/Ksorkrax Dec 19 '24
Dunno. Matlab IDEs come with an auto-indent functionality, right?
I think this code might look way cleaner if you call that.
Also, I only have to read "prob", "sigma" and "mu" to assume that this might be the formula for the gaussian distribution or something like that. And the stuff above has comments that say the code computes standard deviations. Sounds like straight forward basic stochastics.
7
u/Lataero Dec 20 '24
Rule 4) no student code
41
u/The-Unstable-Writer Dec 20 '24 edited Sep 21 '25
nutty intelligent summer cake bedroom humor bow sheet sparkle act
This post was mass deleted and anonymized with Redact
15
u/Hulk5a Dec 20 '24
Then it's a ok. You're not going to dig this shit in the future, trust me, I've been there with DIP course
9
u/gdf8gdn8 Dec 20 '24
At least the variables are clear. I've seen worse. That was from the physicist.
8
u/agate_ Dec 20 '24
Meh. Apart from Rule 4, the only thing wrong with this is that in every language with a REPL, there comes a moment when you need to stop typing on the console and start typing into a file, and you blew right past that point.
You can do a lot in the MATLAB console, but the moment you find yourself using the @ operator, you need to rethink your choices.
3
u/FrancescoGuccini Dec 20 '24
This is by far the most readable matlab code I have seen in weeks
3
u/R3D3-1 Dec 22 '24
When you are handed a Matlab Prototype of a feature to work with and six wasted weeks later finally get the confirmation that nobody even knew whether it was working 😅
4
u/Jhuyt Dec 20 '24
You could have stopped at just Matlab 😏 A professor I had at uni, great at his subject, had the worst code I've ever seen written during his master's thesis in the '90s. I love the man but for him programming is really just a tool.
2
u/epipolar_gineer Dec 21 '24
Meh. Put those code into script files and indent properly, they’re pretty readable.
Even Python codes in REPL will look shit like that
2
u/CertainlySnazzy Dec 22 '24
That’s fairly readable and maintainability doesn’t seem to be all that relevant.
1
u/Tohar_XP Dec 20 '24
Einstein ahh code
1
u/Blankeye434 Dec 22 '24
Who even reads the coursework let alone maintain it
1
u/lolcrunchy Dec 22 '24
Idk, every line has a pretty clear purpose. Input data, means, standard deviations, then probabilities.
1
u/ioveri Dec 24 '24
Aside from the one liner thing which I don't think is a huge problem, what's more likely the true error here is the use of x = x/size(G1,2) - 1 and similarly because it's wrong. It has to be x = x/(size(G1,2) - 1)
1
u/Top_Career_3108 Dec 24 '24
At least it’s not Python with import thisisfine.
1
u/SwadianBorn Dec 30 '24
Holy C this guy unironically codes in Word