3 ms·
> I think if the Scala creators had been a bit less obsessed with symbology This might not be something to pin on the language designers, if you're using cert
by sk5t 5y ago
> I think if the Scala creators had been a bit less obsessed with symbology
This might not be something to pin on the language designers, if you're using certain third-party libraries. Indeed it is possible to name a method pretty much whatever you want, with some constraints[0]. Wanna call it "!^"? Go ahead! But, this is afoul of the naming convention in many cases[1]--acknowledging that the convention may have previously been a bit more lax in this regard.
OTOH the distinction between "::" and ":::", and the implications of stuff like "<:" often do require a refresher if they're not part of one's day-to-day.
[0] https://stackoverflow.com/questions/7656937/valid-identifier-characters-in-scala https://stackoverflow.com/questions/7656937/valid-identifier...
[1] https://docs.scala-lang.org/style/naming-conventions.html https://docs.scala-lang.org/style/naming-conventions.html
- sorokod 5y agoA house is leaking from the roof. If the language designers allow methods named "!^", then someone will actually name a method "!^".
- Symbiote 5y agoMost languages allow a variable called "i", but it is for the programmer to choose when that is appropriate. !^ might be useful, if the code implements an algorithm which uses this notation in the literature.
- sk5t 5y ago> A house is leaking from the roof. Should one prefer the case where an adult cannot order a steak, because a baby can't chew it? Like, there is a grammar for acceptable identifiers, and it is a little broader than most. To me it seems like a good thing that unicode/multibyte identifiers are allowed, and that not more than the necessary portion of the top keyboard row symbols is reserved.
- dboreham 5y agoYes, I'd like to have a beer with the people who think it's smart to allow punctuation as identifiers. Hopefully by the third pint I could change their minds...