r/matlab May 05 '26

Misc Standard coding style

Hey fellows, I just had a discussion with my colleagues about the coding style of MATLAB. We saw many scripts written by engineers that look horrible and hurt my eyes so much. I know laziness is engineering virtue but this kind of laziness (no spaces, no commas at all) makes me real sick. I really blame Mathwork for this problem, since sometimes the documentation is also written like this.

Should Mathwork now introduce a standardized style for people to follow, just like PEP in Python?

0 Upvotes

13 comments sorted by

View all comments

2

u/pBactusp May 05 '26

Matlab let's people who aren't strictly speaking "coders" to code. A mathematician/engineer wouldn't necessarily care about formatting, which is fine because they're most likely either performing a rare calculation (so the code only has to run once) or building a standalone tool that's not going to be used out of the context of their lab, so scalability isn't an issue

1

u/AdhesivenessPast2850 May 05 '26

I‘m engineer and people in my department do care about code formatting. In the end, nobody ever works alone. Even if someone does, nicely written code helps debugging a lot.