5 ms·
LaTeX in code is a bad idea and it contradicts Julia's proposition of having clean syntax and being beginner friendly.
by st1x7 6y ago
LaTeX in code is a bad idea and it contradicts Julia's proposition of having clean syntax and being beginner friendly.
- tpoacher 6y agoThere is no latex in the code. You _may_ use known latex commands to produce certain symbols, which then _become_ the code. But that's just a convenience julia provides. If you prefer to copy-paste from your character map application, or memorize their meta-key shortcuts, that's entirely up to you.
- st1x7 6y agoSure but it's not about latex itself. What I meant by "latex" was "the mixing up of code and math notation". That's what's problematic for me.
- dunefox 6y agoYou mean the very thing that makes scientific code easy to read?
- st1x7 6y agoMy point is that it doesn't make it easy to read for everyone and it was a bad design decision.
- leephillips 6y agoIt just permits a larger set of glyphs (Unicode) for identifiers and operators than some other languages, which only permit ASCII. It makes it easier to read the code for everyone and it is a great design decision.
- st1x7 6y agoIt's not "just" permitting more characters, it overlays one set of syntax (Julia) with another (mathematical notation). And mathematical notation has no unified standard. > It makes it easier to read the code for everyone It doesn't make it easier for some people including myself so I can certainly say it doesn't make it easier for everyone.
- leephillips 6y agoI don’t understand what you mean. Allowing a larger set of glyphs does not change the syntax.
- dunefox 6y agoNo, on the contrary, it was a great design decision.
- tpoacher 6y agoI both agree and disagree at the same time. And as you can see from the other comments here, it's not a clear cut issue. For me _some_ math functionality would be welcome, and some would not. But equally, if a feature is present, I fully expect it to be abused and make things worse rather than better, as with any feature. So, e.g., I'd much rather have code like Γ(α, β) than Gamma(alpha, beta), and N(μ, σ²) over normpdf( mu, sigmasquared ), but I would not like it if people started choosing obscure single-letter names instead of self-documenting code that "reads like English". But arguably that is a question of promoting good style and programming standards, not one of "limiting the freedom of users by design because some may not follow good style".