|
sarehu posted:Most languages let you shadow variables or at least global variables. You'd get a warning for that, but there's also function overloading, method names. No the modern thing is to consider the identifiers foobar and f___O__o________BA_r________ identically in the eyes of the compiler.
|
# ? Aug 14, 2015 09:40 |
|
|
# ? May 23, 2024 16:28 |
|
Deus Rex posted:No the modern thing is to consider the identifiers foobar and f___O__o________BA_r________ identically in the eyes of the compiler. But apparently Foobar is completely different! code:
|
# ? Aug 14, 2015 09:45 |
Deus Rex posted:No the modern thing is to consider the identifiers foobar and f___O__o________BA_r________ identically in the eyes of the compiler. Good god, how many times has Nim changed the rules for identifier equality? I could swear I looked this up just the other month and the rules were "completely case insensitive, single underscores are the same as no underscore (but 2+ underscores aren't), leading underscores are not treated this way but instead are semantically meaningful". Did I imagine that?
|
|
# ? Aug 14, 2015 09:48 |
Deus Rex posted:No the modern thing is to consider the identifiers foobar and f___O__o________BA_r________ identically in the eyes of the compiler. Are vectorIsLong and vector_is_long always identical or does that depend on locale?
|
|
# ? Aug 14, 2015 10:40 |
|
nielsm posted:Are vectorIsLong and vector_is_long always identical or does that depend on locale? This whole thing is fascinating to me, I learned a bit about it when exploring the Go standard library. I guess Unicode has multiple files that dictate the case of letters, and Go (as a compiler and language) always use the default file*. However, in the standard library itself, it provides a function that has an override for Turkish and Azeri (which is the same alphabet) casing rules. My guess is that Nim also likely defaults to those casing rules rather than depending on locale. * This does cause a few problems, since CJK characters are always "uppercase" according to this file, and Go uses the case of the first letter to determine public/private, so 作る is always going to be public. Apparently the convention is to use "x作る" to de-export something.
|
# ? Aug 14, 2015 10:47 |
|
Jsor posted:* This does cause a few problems, since CJK characters are always "uppercase" according to this file, and Go uses the case of the first letter to determine public/private, so 作る is always going to be public. Apparently the convention is to use "x作る" to de-export something. Jesus Christ.
|
# ? Aug 14, 2015 11:37 |
|
Is there a manifesto out there explaining why taking identifiers literally is such a bad thing? Or why Go makes the first character of a variable meaningful like it's loving FORTRAN? Those are both things I might have gotten behind a decade ago, but I was 16 and thought Python was neat because it didn't have curly braces or semicolons. I'm too young to be this grumpy.
|
# ? Aug 14, 2015 11:53 |
|
Turns out I got it backwards, everything is considered lowercase, so it's X作る to explicitly make it public. Still dumb either way. Apparently they couldn't change it because by the time it was requested it'd break their backwards compatibility guarantee. The original ticket was closed with "status: unfortunate".
|
# ? Aug 14, 2015 11:55 |
|
Deus Rex posted:No the modern thing is to consider the identifiers foobar and f___O__o________BA_r________ identically in the eyes of the compiler. Ideas for the Nim designers to seriously consider:
|
# ? Aug 14, 2015 12:30 |
|
I really thought more people used editors with autocomplete.
|
# ? Aug 14, 2015 13:40 |
|
I use Eclipse because I'm too stubborn to switch to IntelliJ, and occasionally its autocomplete will get stuck: I'll be happily going along typing a dot followed by the first letter or two of what I want followed by a tab followed by a dot etc, and then Eclipse will suddenly say "aha this is precisely what you wanted" even though I had a couple of dot-baz's to go and it will terminate the chain with a space or semicolon or whatever, and then backspace + attempting to resume the chain results in Eclipse saying "oh okay since you've already got what you wanted then here's this entirely new thing." bar.f + tab -> bar.foo bar.foo.b + tab -> bar.foo.blargh bar.foo.blargh.w + tab -> bar.foo.blargh.widget [space] Oh no Eclipse, I actually wanted to keep going, surely a backspace + dot will resume where we left off bar.foo.blargh.widget.f + tab -> bar.foo.blargh.widget.FullClassNameThatYouDoNotWantWhereTheHellDidEclipseEvenFindThisItHasNothingToDoWithWidgets [where I wanted "fiesta"] Also it has problems finding static inner classes etc for right-click-add-import, so I've got to add them manually, and this is also an autocomplete crapfest import com.c + tab -> com.companyname.*; No gently caress you, backspace backspace, import com.companyname.a + tab -> import com.companyname.async.*; So it's faster to just type out the entire import and hope that I get it right rather than wrestle with an autocomplete that wants to prematurely terminate the import at every step Maybe there's a way to fix this poo poo, but I'm stubborn (or stupid, as you prefer)
|
# ? Aug 14, 2015 14:54 |
|
Do i18n fuckups belong in this thread
|
# ? Aug 14, 2015 17:08 |
|
Isn't Nim the language where the amount of whitespace modifies operator precedence, so a + b<<1 gives a different result from a+b << 1?
qntm fucked around with this message at 17:52 on Aug 14, 2015 |
# ? Aug 14, 2015 17:36 |
|
qntm posted:Isn't Nim the language where the amount of whitespace modifies operator precedence, so a + b<<1 gives a different result from a+b << 1? Yes, but that's an experimental feature, not enabled by default. Warnings, where precedence would have been overridden by whitespace, would make sense. sarehu fucked around with this message at 18:12 on Aug 14, 2015 |
# ? Aug 14, 2015 18:07 |
|
Jsor posted:Turns out I got it backwards, everything is considered lowercase, so it's X作る to explicitly make it public. Still dumb either way. Apparently they couldn't change it because by the time it was requested it'd break their backwards compatibility guarantee. The original ticket was closed with "status: unfortunate". solution: just don't write your public api in kanji. there's nothing difficult about calling it "Tsukuru" if you're too convinced of the superiority of glorious nippon to just use english.
|
# ? Aug 14, 2015 22:47 |
What if you are a Japanese company, writing an API aimed at Japanese programmers?
|
|
# ? Aug 14, 2015 23:47 |
|
It's honestly more of a thing that if you know it you win that night's round of "Go pub trivia". AFAIK, most CJK programmers write their code in English (or at least ASCII), and while a Chinese programmer raised the issue, most of the programmers that speak those languages natively commented that it doesn't come up often in practice. The only thing that I think might make it more of an issue is that last I checked Go advertises itself as allowing identifiers in arbitrary unicode, and given an explicit example of using 日本語 (I believe as a variable), but again, it's basically a trivia question. Only slightly more consequential than the "register" keyword in C.
Linear Zoetrope fucked around with this message at 23:54 on Aug 14, 2015 |
# ? Aug 14, 2015 23:50 |
|
VikingofRock posted:What if you are a Japanese company, writing an API aimed at Japanese programmers? Every Japanese API for Japanese programmers I have ever seen has used English, except when dealing with specifically Japanese concepts, in which case it used romaji because romaji is fine and easy to work with. Unicode identifiers aren't common, and while they may become more common with time, nobody is going to have noticeable problems today as a result of a language having imperfect support for them. If you feel strongly otherwise, why not try to get Arabic identifiers working? Enjoy wrestling with the Unicode bidi algorithm and a bunch of characters that look identical in some contexts but not others and don't have any sort of case folding or canonical equivalence!
|
# ? Aug 15, 2015 00:13 |
|
I program in ancient greek and only use text editors which support proper boustrophedon text.
|
# ? Aug 15, 2015 01:22 |
|
i program in emojis
|
# ? Aug 15, 2015 02:38 |
|
Biowarfare posted:i program in emojis Poop emoji is the new main function. Since our programs are going to be poo poo anyways. 💩 piratepilates fucked around with this message at 04:07 on Aug 15, 2015 |
# ? Aug 15, 2015 03:07 |
|
nowadays i only program in linear c
|
# ? Aug 15, 2015 04:07 |
|
oh wait, i guess they call it objective c, but either way it's indecipherable nonsense
|
# ? Aug 15, 2015 04:08 |
|
qntm posted:Isn't Nim the language where the amount of whitespace modifies operator precedence, so a + b<<1 gives a different result from a+b << 1? This strikes me as potentially a really good idea provided it's properly documented and the language syntax is otherwise sufficiently unique that it doesn't cause confusion. a+b / c+d^2 strikes me as perfectly clear provided you know the space rule and considerably more readable than (a + b) / (c + d ^ 2) or however my IDE likes to format it.
|
# ? Aug 15, 2015 04:23 |
|
DaTroof posted:nowadays i only program in linear c DaTroof posted:oh wait, i guess they call it objective c, but either way it's indecipherable nonsense
|
# ? Aug 15, 2015 07:07 |
|
Plorkyeran posted:I program in ancient greek and only use text editors which support proper boustrophedon text. You jest but the professor of a language design course I took had us create an interpreter written in Scala with greek symbols for method names, objects, and whatnot to match the notation.
|
# ? Aug 15, 2015 07:19 |
|
APL got brought up a few pages ago. Apparently it's a convention to use greek letters as variables. I'd like to think that somewhere right now, a programming intern is hearing "No no, that's not a 'w' that an omega."
|
# ? Aug 15, 2015 08:50 |
|
KernelSlanders posted:This strikes me as potentially a really good idea provided it's properly documented and the language syntax is otherwise sufficiently unique that it doesn't cause confusion. a+b / c+d^2 strikes me as perfectly clear provided you know the space rule and considerably more readable than (a + b) / (c + d ^ 2) or however my IDE likes to format it.
|
# ? Aug 15, 2015 10:56 |
|
It will also raise questions on what does it mean when there's just a single spacecode:
You'll also have to consider what does it mean when you break an expression across a newline. comedyblissoption fucked around with this message at 11:08 on Aug 15, 2015 |
# ? Aug 15, 2015 11:06 |
|
KernelSlanders posted:This strikes me as potentially a really good idea provided it's properly documented and the language syntax is otherwise sufficiently unique that it doesn't cause confusion. a+b / c+d^2 strikes me as perfectly clear provided you know the space rule and considerably more readable than (a + b) / (c + d ^ 2) or however my IDE likes to format it. This would be great if combined with full Unicode support, so I can use zero-width spaces to alter precedence without making lines wastefully long.
|
# ? Aug 15, 2015 11:23 |
|
comedyblissoption posted:It will also raise questions on what does it mean when there's just a single space I think both of those are indeed syntax errors in the case I mentioned.
|
# ? Aug 15, 2015 14:24 |
|
comedyblissoption posted:It will also raise questions on what does it mean when there's just a single space tbh I would be in favour of those being syntax errors in whatever language, even if not syntactically ambiguous, because they are offensive to my eyes.
|
# ? Aug 15, 2015 15:59 |
|
Pavlov posted:APL got brought up a few pages ago. Apparently it's a convention to use greek letters as variables. I'd like to think that somewhere right now, a programming intern is hearing "No no, that's not a 'w' that an omega." APL, not even once. (preempting pedants: yes, that's actually K, an APL derivative) (that's a text editor if you were wondering) NihilCredo fucked around with this message at 16:13 on Aug 15, 2015 |
# ? Aug 15, 2015 16:07 |
|
messages not to show to users, pt. 2
|
# ? Aug 15, 2015 20:19 |
|
NihilCredo posted:APL, not even once.
|
# ? Aug 15, 2015 22:06 |
|
It's supposed to look mathy! When have you seen a math book with exercises like "derivative(hamburgers, time) = 5 * hamburgers - 3" or whatever???
|
# ? Aug 15, 2015 22:27 |
|
There are more than 18,000 classses in the Facebook iOS app
|
# ? Aug 16, 2015 01:11 |
|
That's not even including the C++ poo poo Nuclide exists for a reason, mostly.
|
# ? Aug 16, 2015 01:20 |
|
But.... why? Why the gently caress?
|
# ? Aug 16, 2015 02:13 |
|
|
# ? May 23, 2024 16:28 |
|
Bruegels Fuckbooks posted:But.... why? Why the gently caress? You wouldn't believe me if I told you.
|
# ? Aug 16, 2015 02:18 |