4 ms·
Greek letters are good for transcribing equations that were written with Greek letters. The equations were written like that because you only get one letter per
by whatshisface 7y ago
Greek letters are good for transcribing equations that were written with Greek letters. The equations were written like that because you only get one letter per variable and you need more than 26 variables across multiple equations, which you want to be consistent. You only get one letter per variable because on paper you write down each equation about fifty times as you work with it, so it's kept short as much as possible.
Unless you speak Greek, I can't think of any other reasons for Greek letters to wander in to code.
- jimmy_dean 7y ago100% this. To understand code written with Greek letters you'd also need to understand the author's intentions for using said letters. Is mu an average or coeff of friction? Why should I lean on a crutch of context for a casual skim of code? It doesn't help readability and it surely isn't enjoyable to write.
- krapht 7y agoIt all depends on context. Short identifiers absolutely help readability. I feel like some people absolutely go too far with overly verbose variable names, especially in Java or C#. Notation matters. What if I told you that to add two numbers you had to write it out as plus(number, number)? Clearly you'd riot. The reason people complain about short IDs is because they're not used to it, but there are a lot of domains (math, science) where using traditional notation enhances understanding. Hell, even in programming if someone wrote sequenceIndex instead of i when iterating over the indices of an array I'd think they were trying to troll.
- celrod 7y agoAditionaly, in statistics Greek letters denote parameters, while the modern Latin alphabet we all use today is for variables. The data `x` has a normal(mu, Sigma) distribution, for example. These sorts of conventions enhance readability by providing extra information. You know instantly that `y` must be data, while `theta` is a parameter.
- nixpulvis 7y agoI thought Racket (starting with BSL) to incoming freshman at Northeastern University, and they would nearly riot every year when we tell them it's `(+ 1 1)` for the next 4 months (at least).
- deleted 7y ago[deleted]
- db48x 7y agoIf it's hard to write then you can just improve your editor; there are lots of ways to do that, and most of them involve improving the software rather than hardware. Having a lousy editor is no excuse!
- littlestymaar 7y agoBut because you learn physics and maths on paper, you learn the equations this way. And once you've spent 10 years practicing physics with Greek letters, it's really annoying to be forced out of it when you program.