6 ms·
I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to
by texuf 3y ago
I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to even see the circle on the end of the lollipop symbol, no way I’m not mistaking that for a hyphen. I don’t know the names for these symbols, so my brain has to 1) learn new images, 2) pattern match them throughout the code. I would be totally lost. If the code used full names I could at least look them up and learn what they mean.
- jandrese 3y agoIMHO the mathematical language is an impediment for learning math for exactly this reason. It's chock full of cryptic symbols with no obvious meaning that make it incomprehensible to anyone who has not taken years to learn it and also surprisingly difficult to enter into a computer. Math is hard to read because quill pens were difficult to use and much of the syntax was made up on the spot by people who were better at thinking mathematically than communicating ideas. But so many people have spent the effort to learn it that nobody wants to create a "dumbed down" version that a layman might understand. It is kind of like everyone in the 60s decided that APL was the one true computer language and all interest in other languages died off entirely and when anybody complains about the syntax they are told that they just need to go to school for 4 years and they'll appreciate the beauty.
- xchkr1337 3y agoIf you open any reasonable math textbook (except for maybe logic related ones), chances are, you won't see the ∀ symbol anywhere at all. It's often considered bad taste to write a symbol like this when you can just write "for all". The main obstacle in learning math comes from not understanding the background material enough and basically never from not understanding the notation.
- skydhash 3y agoAnd the notation are introduced to you gradually. Even books that do not have a chapter on the notation used, will have a reference page. If not, you’re not reading introductory material and some background is assumed.
- marssaxman 3y agoHow would the notation be "introduced to you" at all, when reading source code? What book would there be? How would you know how to find it? This is a serious drawback to the traditional math notation: if you didn't come up along one specific educational pathway, it seems to be effectively impossible to work your way in and figure out what any of it means. You can't pronounce any of it, you can't look it up; even if you can work out the names of the symbols, they often mean different things in different contexts. It is a mess. For many years now, the way I have ingested CS papers is to read the introduction closely, getting my head around the concept, then bail out once the inscrutable symbols show up and go find an actual implementation in some real, documented, parseable programming language - any one will do - from which I can readily infer what the rest of the paper was supposed to mean.
- todd8 3y agoPerhaps this is true for some texts, but take a look at math journals where mathematicians are writing for other mathematicians within their own field. They reuse symbols, sometime an integral symbol is for Riemann integration and sometimes it's for Lebesgue integration. The subject of the paper will make it clear which is which. Even in our own field, Computer Science, there are too many confusing cases: Knuth uses |S| to mean the cardinality of set S, |f| to be the number of solutions when f is a boolean, |x| to be the absolute value of x, |z| to be the absolute value of a complex number, and |a| to be the length of a. All within the same book, TAOCP vol 4A Part 1.
- jlokier 3y agoThose notations are well-known standard notation for the same general concept, "the size of". What "the size of" means is different applied to each type of object, and may have to be defined to explain some of them (esp. |f|), but it's common in math that general concepts apply differently to different things, while having some properties in common. I think the notation is helpful rather than confusing because "the size of" carries with it some intuitive connotations which are common to each of those examples.
- deleted 3y ago[deleted]
- agentultra 3y agoYou can go back and read maths texts from before algebra was in common use. Before people had these symbols they had to write out their proofs and derivations using the plain language of their day. tldr; it’s tedious reading those proofs. And it’s laborious to write them. Such labour limits the thoughts one can have. Once algebra has solidified there was an explosion in the pace and depth of mathematics. The symbols are there for a good reason.
- jandrese 3y agoYeah, but reading novels from those days is also tedious. Doesn't mean they can't be improved.
- Skeime 3y agoSure: And the best way we have found (maybe just so far?) has been to introduce more symbolism. But even today, all guides on good mathematical writing urge you not to go overboard with them; a well-written mathematical text is a reasonable mixture of symbols and prose. In fact, it’s pretty common for math students to want to use only symbols at some point. What they write becomes unintelligible to everyone else (and maybe even themselves) and at some point they (usually) wise up.
- fragmede 3y agoIf you Google for ∀ you'll get a explanation of what it means. Same for ∫. Specialized fields require specialized knowledge. Same goes for programming, especially subfields of it. Every company has their own brand of programming language, C++ at Microsoft isn't the same as C++ at Google or Redhat or Apple. A new employee at a job will take months to be oboarded because they have to learn the company's dialect. During that onboarding, they'll learn about new words and they'll also introduce new symbols if they have to. What does that mean for code that is being developed out in the open? Does it raise the bar for entry? Arguably there's already a bar to entry, which is being able to read English and being able to program in the first place. That there are some parts of the code that say "here be dragons" to the uninitiated who haven't yet Googled the meaning of the unfamiliar words and symbols seems like an entirely reasonable state of the world. If it's sufficiently popular, an explanation article, like https://en.wikipedia.org/wiki/Fast_inverse_square_root https://en.wikipedia.org/wiki/Fast_inverse_square_root can be made, or an entire site, like http://explainxkcd.com http://explainxkcd.com. There will always be more things to know (just today I learned about thixomolding. The science behind that has its own set of symbols to pick up), some of it will just require additional learning in order to learn.
- aeonik 3y agoI love these symbols because once you learn them you can instantly spot where all your loops are, it really make things compact, and reveals the structure of your code far more efficiently. A solution to the problem if incomprehensibility is to use a plugin to replace the words. I use emacs prettify symbols: https://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-dot-4-prettify-symbols-mode/ https://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-do...
- accrual 3y agoI agree. I read this line: > ∀ instead of forall, which is faster to input than the whole word. It reminds me of the idiom that code is often written once but read often, so one would want to optimize for readability and not fewer keystrokes. At least for production code.
- OkayPhysicist 3y agoTo be fair to math symbols, code is read often by programmers, especially programmers of the language you're writing in. For things that get used a lot, short symbols are fine, because everybody reading the code will have seen a lot of the relevant syntax. Otherwise it would be like asserting that programming would be better if we eschewed all specific jargon. Why say "bit" when we can say "single digit for which there are only 2 possible values"?
- WJW 3y agoI have to respond to this with a resounding "meh" tbh. ∀ is a pretty unique symbol, it is very readable even if you don't know what it means. Programming forces you to learn new words constantly anyway. It's not like "object instance", "monad", "recursion" or even "while loop" are all that intuitive to beginners yet all programmers learned them anyway. (feel free to ignore any terms you're not familiar with, they're just examples) ∀ might be just as incomprehensible as OOP for a starting programmer, but for anyone taking even a small amount of time to learn it is not difficult at all.
- dfan 3y agoMy guess is that the majority of Haskell programmers who are comfortable enough with the forall keyword to use it in practice would find the symbol ∀ to be more readable than the keyword, rather than less. (This is not snark, it's my actual belief.)
- Skeime 3y agoI also don’t buy the argument that it’s faster: Ctrl-k, Shift-f, Shift-a is still six keypresses, and they’re more awkward than just typing forall.