-
• #2
It's fine, and allows do distinguish between the empty string and undefined. I believe it's in the language, just live with it.
-
• #3
I think to someone who has not come from a JS background at first it did catch me off guard as I was thinking hmmm has something gone wrong here. However after reading up a bit on the site and realising why it was happening I'm quite comfortable with the output.
As you say it can "look messy" but I'm not overly worried about that. I assume this question has come up a few times when doing demos/needed explanation?
-
• #4
To be fair, with these changes, empty string would return
=""
but undefined would return nothing.Would you have a problem if it disappeared? Some people seem to get quite annoyed by it - I wonder if anyone would get annoyed if it wasn't there.
-
• #5
Is it a case of the message "undefined" is annoying and they would prefer something like "OK" which most of the AT command driven controllers use?
-
• #6
I think they'd prefer:
>print("Hello") Hello >1+2 =3
Rather than:
>print("Hello") Hello =undefined >1+2 =3
The issue has come up in a few e-mails I've got. I know, once you get used to it, it is fine. However maybe it's something that you shouldn't have to get used to!
-
• #7
Ahhh.. yes remove!
-
• #8
Yes, remove.
-
• #9
Remove.
-
• #10
Although this is standard in JS consoles (ex, in web browsers), I don't see much benefit to it being shown on the Espruino, since you know it did something, since it's showing the > - I think you can go ahead and remove it.
-
• #11
Personally I like the fact that it specifically says that the function returned undefined.
In the print("Hello") example above I would be a bit confused about the "Hello" on the console - was is printed? Returned as a string? Or some object? Especially that this behaviour would be different than Node.js or JS console in the browser.
-
• #12
Hmm - it's a very good point about it being like node.js... Any thoughts? Seems a shame to be different.
Interestingly, node outputs 'undefined' in grey text, so it fades into the background a bit more. I guess we could do that...
Does anyone actually like
=undefined
? Or should I just not display it if the result of the command you executed is undefined?Pros:
=
Cons:
Ok, I lied. It's not a poll because I can't do those - but please post up what you think.