4 ms·
I'm not sure I understand the premise here. One letter variable and function names do not strike me as beautiful, but needlessly obtuse.
by chairmanwow1 5y ago
I'm not sure I understand the premise here. One letter variable and function names do not strike me as beautiful, but needlessly obtuse.
- spywaregorilla 5y agoThey seem appropriate if you want your code to read like the math they're representing.
- kps 5y ago“I used to be a mathematics professor. At that time I found there were a certain number of students who could not learn mathematics. I then was charged with ¨the job of making it easy for businessmen to use our computers. I found it was not a question of whether they could learn mathematics or not, but whether they would. […] They said, ‘Throw those symbols out — I do not know what they mean, I have not time to learn symbols.’ I suggest a reply to those who would like data processing people to use mathematical symbols that they make the first attempt to teach those symbols to vice-presidents or a colonel or admiral. I assure you that I tried it.” — Grace Hopper tl;dr: COBOL won.
- nerdponx 5y agoFor business and business people. Julia's target audience isn't "business" or "business people", although there's no reason you couldn't use it for that purpose.
- ska 5y agoHopper was making a bit of a different point - you need to tailor your communication to your audience. In this case, if the developers involved are assumed to know the math already, concise is probably for the good. If you are trying to teach the algorithms to a mathematically unsophisticated audience, it's a different story. If I'm describing the same concept to a) a group of undergrad students, b) a group of mathematicians and grad students c) a group of software developers or d) a room full of execs - I'm going to do it differently in each case, including notation and emphasis.
- kps 5y agoYes, that was my point, or at least part of it: COBOL style isn't suitable for mathematical programming. The other part is that it was never intended for programmers at all; it was for the ‘vice-president or a colonel or admiral’ who wanted the illusion of being able to understand their underlings' work. I think it's unfortunate that it took over general-purpose computing during the dot-com boom; prolixity engenders clarity about as much in code as in human language.
- spywaregorilla 5y agoJulia is not for businessmen incapable of learning mathematics.
- 0-_-0 5y agoThese variable names are hard to read for those who could actually learn from this, but known to those who are already familiar with the algorithms and have little more to learn about them. This is a common problem you run into when you start learning about a new area.
- Jolter 5y agoExactly. Each of these algorithms’ beauty comes from understanding them. And reading the original paper is probably the best way to understand and appreciate them. I guess this site is trying to sell Julia a bit, by showing how close it looks to mathematical pseudo-code.
- coliveira 5y agoAnyone who is interested in these algorithms know what these single letters mean. This is very readable.
- drran 5y agoNo, it's not. Readability assumes that code is easy to read and easy to understand. This code is easy to read for those, who understood the algorithm already, but is hard to read for those who has no understanding. It's the famous "write-only" problem of the Perl language, which uses symbols heavily too.
- patrick451 5y agoCode that mirrors a paper is the easiest to understand. Verbose, "descriptive" variable names just put more friction between you and the math. You are unlikely to reverse engineer the algorithm from the code unless you were already in a position to understand the terse mathy code to begin with. Just go read the danged paper.
- TheTrotters 5y agoI disagree. Virtually no one who worked even a little with these algorithms has used math symbols in their code. For better or for worse it messes up people's pattern recognition.
- drran 5y agoThey are no more obtuse than one letter options for command line tools. The author of function just forgot to write a man page.