4 ms·
The fundamental issue here is discoverability. There is no benefit to having these symbols, since you could easily have some kind of button the UI to switch bet
by James_K 3y ago
The fundamental issue here is discoverability. There is no benefit to having these symbols, since you could easily have some kind of button the UI to switch between symbols and words. It would be far better if you tab completed the actual name of a function rather than typing some arbitrary sequence of characters to get a symbol of questionable function. You won't ever replace Excel if the first step to using your product is memorising a huge dictionary of strange runes.
I think a good language for replacing spreadsheets would be Scheme, or something similar. You can teach it to someone very quickly as the syntax is quite minimal. Provided functions are given human readable names, I think it could be very intuitive. You would also need to offer some kind of graphical editor for the code. Lisp has wins here as well since you could likely translate the code into a graph without much issue. However it would also be good to allow the inverse of such transformations.
- deleted 3y ago[deleted]
- xelxebar 3y ago> There is no benefit to having these symbols Hard disagree. Which do you find more readable? -b/(2a) + 1/(2a) √(b²-4ac) or (plus (minus (div b (times 2 a)) (times (div 1 (times 2 a)) (sqrt (minus (pow b 2) (times 4 a c)))))) or plus(minus(div(b, times(2,a)), times(div(1, times(2,a)), sqrt(minus(pow(b,2), times(4, a, c)))))) APL just has a small handful of symbols with really simple definitions and, heck, you already know what +, -, ×, and ÷ mean. Scheme actually has a ginormous dictionary by comparison, and in practice you do need to read the manual anyway, so discovery is a moot point. APL is actually simpler in that regard in practice, and the gains you get in readability from the symbols are just like above. Better yet, though, which of the above do you immediately think, "that 1/(2a) can be factored out"? Oh, and here's APL for the above: (-b÷2×a) + (1÷2×a)×((b*2)-4×a×c)*1÷2 Quickly empowering your brain to spot high-level patterns across your codebase like that is a huge strength of APL.
- duped 3y agoThis is more readable than both fn quadratic_roots (a: real, b: real, c: real) -> (cmpx, cmpx) { let root1 = (-b + sqrt(b^2 - 4 * a * c)) / (2 * a); let root2 = (-b - sqrt(b^2 - 4 * a * c)) / (2 * a); return (root1, root2) } Converting math into code is extremely easy. Converting code back into math is the thing to optimize for. The compiler can figure out how to optimize the machine code for you, but the reader needs to be able to work backwards. The thing that array languages get wrong is that code is read more often than it is written, and repeating yourself is worthwhile in order to make it easier to understand for the next person who looks at it. Compilers are extremely good at recognizing patterns and optimizing it for numerical code. Humans are really bad at recognizing patterns from unique sequences of characters.
- dcuthbertson 3y ago> Converting math into code is extremely easy. Converting code back into math is the thing to optimize for. Yes and that's what programming languages like APL do. Whole algorithms for manipulating equations represented as matrices can be groked with just a few symbols. At least to my mind, it's a very efficient way to write code, at least for domains that fit this model. I learned APL in the mid '70s in high school. The math department offered it as an option to those of us learning linear algebra. One course reinforced the lessons from the other. Those of us in the APL course found ways to solve other problems not directly related to linear algebra, and we marveled at how compact the code was (especially compared to Basic, which a friend and I had learned the year before).
- gitonthescene 3y agoIn my professional experience most code never gets read by anyone other than the original author and when it is read it's often reluctantly. If you have any links to studies which show that code is read more often than it is written, I'd be interested to read them.
- coryrc 3y agoI, just, can't believe you could think that. Have you never debugged code you didn't write? There are six billion people in the planet and you think it's more likely that a given piece of professional code will only ever be read by one person? A person leaves the company and you just delete everything they wrote so nobody can read it?
- James_K 3y agoFirst of all, no one is suggesting you get rid of good old +-/* and friends. So more accurate would be: (+ (- (/ b (* 2 a))) (* (/ 1 (* 2 a)) (sqrt (- (^ b 2) (* 4 a c))))) ;; or just (/ (+ (- b) (sqrt (- (^ b 2) (* 4 a c)))) (* 2 a)) Secondly, another advantage of lisp is that you can change the format of expressions as needed. ;; With Scheme's SRFI-105 – Curly Infix Expressions {{-(b) / {2 * a}} + {{1 / {2 * a}} * sqrt{{b ^ 2} - (* 4 a c)}}} ;; With a macro (math - b / (2 * a) + 1 / (2 * a) * (sqrt (b ^ 2 - 4 * a * c))) ;; Reader macros #math(-b/(2*a) + 1/(2*a) * (b^2 - 4*a*c)) What this represents is that lisp allows you to decouple the way code is input and displayed from the content of it. Wolfram Language uses a similar system to display mathematical expressions as though they had been typeset with LaTeX. A lisp system would likely support something similar. In the source code, you would have: (formula (+ (- (/ b (* 2 a))) (* (/ 1 (* 2 a)) (sqrt (- (^ b 2) (* 4 a c)))))) But the editor would display: (formula -b/(2a) + 1/(2a) √(b²-4ac)) Finally, I find this post to be very disingenuous in that it doesn't address the plethora of other strange symbols used in the blog post, to which my comment was referring. Only talking about standard arithmetic symbols that everyone already understands completely missing the issue I was addressing: that people won't use something if they can't understand it without memorising an entire manual of foreign symbols. Everyone knows what + means, many people can understand "reduce", but no one who hasn't already learned APL will understand the meaning of ⍒. What's worse, they won't even be able to ask someone what it means: "Hey bob, what does "triangle with a line through it" mean?" Well which way is the triangle pointing? And is the line vertical or horizontal? Is it a full triangle or is the bottom missing? So if you show your boss a spreadsheet with this stuff in it, he's going to have to put his finger right on your monitor to point to the triangle he's talking about, and that's gonna leave you with a nice finger smudge on your display. This simply isn't ergonomic.
- James_K 3y ago> APL just has a small handful of symbols with really simple definitions > Scheme actually has a ginormous dictionary by comparison Oh, and also, I should point out that Scheme has no symbols to learn. Quite small compared to the 50 odd that APL has. The reason for this is that users already know all of the symbols in Scheme. "log" exists as a concept in people's brains already because it is a word and also the name for the function it describes. You know the word "log". You can start typing "log" and it will show up in auto-complete. ⍟ (circle with small star in it) doesn't exist in people's head and you can barely make out what it is without a special font and you cannot type it without a special input method. People do not know the word "⍟". It is an entirely new concept for something people understand perfectly well and all it does is reduce the length of a line by 2 characters.