3 ms·
I've noticed that I understand what is going on much more when a function is written in code than in its mathematical form. A lot of that is familiarity but I
by noir_lord 9y ago
I've noticed that I understand what is going on much more when a function is written in code than in its mathematical form.
A lot of that is familiarity but I don't think all of it is.
- ashark 9y agoCode's easy for me (unless "mathy" in appearance like Haskell) but mathematical notation's always made me feel dyslexic. I'd love to see this beauty or clarity or whatever that people find in mathematics, but I've never caught even a hint of it. Seems like it needs a good IDE to make up for deficiencies in its language.
- noir_lord 9y agoHave you see SageMath[0]? That allows you to use Python inside a mathematical environment and it's amazing. Saved my bacon a few times when I need to translate maths to code and I need to poke it a bit to get an understanding of how it works. [0]http://www.sagemath.org/ http://www.sagemath.org/
- nnq 9y ago> Code's easy for me (unless "mathy" in appearance like Haskell) Haskell is not hard to read/understand because it's mathy. It's because of type inference combined with laziness - this leads people to do incredible fits of intellectual masturbation... Like "hey, the compiler can handle types for us, so lets type the shit out of things, let's even use them to mark side effects, types are fee" ...doesn't matter that types are mainly documentation and by not writing them or making astronaut types you're loosing the main benefit. And "hey, the language is lazy, that extra code containing an infinite loop but so mathy elegant, will never be fully executed so we can have it, it's free, doesn't impact performance"... doesn't matter you need to use 80% of your brainpower better spent otherwise to grok it. If it would be eager and without type inference it would've evolved into a much more readable and popular language and with a larger community.
- vidarh 9y agoSame for me. Part of it is the brevity, and part of it is the shortcuts. E.g. when I did my masters, one thing I quickly realised was that papers that expressed an algorithm using mathematical notation almost always lacked essential details. My impression is that it's too obvious when there are too large leaps in code, whereas in mathematical notation everyone accepts leaps that can obscure that essential details have been left out. E.g. you'd have papers on thresholding of images for OCR (deciding what is background and what is foreground) where it turned out the results were highly dependent on certain values represented by certain variables that were never defined, for example, putting in a situation of reconstructing parameters by trial and error if you wanted to reproduce the results. Today I'm immediately suspicious if results are presented as maths outside of fields where the maths is essential (and sometimes even then) as I see it as having a tendency to be used to gloss over sloppy work or save space by leaving out essential details. I'm sure this is not the case in all fields, and that people with a more extensive maths background will be able to fill in more of those leaps without much effort, and so it might very well be acceptable in some fields. But to me a notation that makes it that easy to hide missing details is a liability.
- sn9 9y agoThat's because code has documented and testable semantics whereas mathematical notation is more by convention than anything. It's in between natural language and code in terms of ambiguity, but is sufficiently flexible and clear to practitioners that it remains the best way to communicate to other practitioners.
- gpawl 9y agosyntax, not semantics. Mathematical semantics is quite precise.
- nnq 9y ago...that's the thing actually: in programming syntax defines semantics because "syntax" is executed and in practice "it means what it does (what is executed)". (Linguists would want to murder me for saying this, I know.) That's why some programming languages can even be defined by implementation. (Though as a programmer I try my best to avoid these languages...)