Earlier quoted context omitted.
100% 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.
It 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…
Rust, Macros, λ-calculus/Church numerals, oh my
71–80 of 82 posts
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#72Earlier quoted context omitted.
100% 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.
It 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…
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#73Earlier quoted context omitted.
Because people in non-English-speaking countries are perfectly within their rights to name source code entities in their native language instead of either having to mangle words into ASCII representations (possibly even leading to ambiguities in case of near-homonyms that have identical ASCII bastardizations!) or being forced to awkwardly translate domain terminology into English which is a task that may be any of th…
I'm not disagreeing with you because sometimes it's just project requirements - but as a developer in a non-English-speaking country - the idea of writing code in a non-English language is ridiculous to me. Programming languages and standard libraries are written in English, programming terminology is invented in English, the international community adopted english as a defacto standard, almost all third party APIs e…
And outside the western hemisphere where off course if the code base is unlikely cross, say, outside the Chinese borders, where Mandarin would be more appropriate.
Then there are non-industrial standard codebases, say a hobby project. I’m sure that somewhere in Guinea-Bissau there is a 17 year old learning Python at this moment, really happy that they can write Portuguese special characters as variable names in python 3 (if only the documentation had been translated to Portuguese).
Just because English is the appropriate language in by far the majority of cases, does’t mean we should deny the possibility of not using it.
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#74While it's definitely cute and amusing, this is exactly why languages that specify their source code in non-ascii encodings are a bad idea. Fully 92.6% of working programmers have no idea how to produce a λ or γ on their input device of choice. Maybe a third of those could eventually find it with a character picker tool. Java started this (in the unicode era anyway -- yeah yeah, APL). The community quite sanely rejec…
> While it's definitely cute and amusing, this is exactly why languages that specify their source code in non-ascii encodings are a bad idea. Clearly full Unicode-enabled source code is the future, just look at how amazing it can be: http://baldi.me/blog/emoji-in-sql
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#75Earlier quoted context omitted.
I disagree. I looked through the source code to Principia a while back, and it makes really effective use of Greek script, black-letter script, math symbols, etc for implementing a physics engine. (It's a mod for Kerbal Space Program that implements n-body gravitation.) It's really well written and used just enough to make things more understandable. (They've got a great units system too; it's worth reading the code…
>Here's a random selection: https://github.com/mockingbirdnest/Principia/blob/master/phy... I don't think r² as a variable name is a good idea. It may look natural for some (including myself), but for others it implies a function while not being one.
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#76Earlier quoted context omitted.
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 po…
100% 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.
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#77Earlier quoted context omitted.
You don't think λ-calculus deserves the symbol `λ!` in Rust? Anyone who is learning or interested in λ-calculus should be aware of what it means (that's the whole point). I generally agree we should all be so fortunate as to be able to read the code put in front of us. And you clearly know how to type a λ, you did it 6 times in your post.
> And you clearly know how to type a λ I copy-pasted it. If there is no source to copy-paste from I'd have to use google. Don't want to be forced to do either in my code.
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#78Earlier quoted context omitted.
Hmm. What would you attack? That is, if you were writing a crate that I was thinking of using in my program, how would homographs allow you to compromise my code?
The best attack is of an alias of a popular crate. Duplicate the functionality/behavior/version number but include a subtle backdoor.
Re: Rust, Macros, λ-calculus/Church numerals, oh my
#79Earlier quoted context omitted.
that only opens the emoji picker, not a generic unicode picker.
It has Emoji, old school smileys and Symbols where you can actually find stuff like the lambda symbol (at least in Windows ver 1903)