4 ms·
Let statement, mostly for side-effects, sufficient for what you need: Sadly it's not. JS has some semantic foibles, but I find myself up against syntax more of
by smosher 15y ago
Let statement, mostly for side-effects, sufficient for what you need:
Sadly it's not. JS has some semantic foibles, but I find myself up against syntax more often than I'd like. Every time I write it I'm impressed at how ugly the syntax is vs for such a good language (modulo the standard library.)
The very thing I'm trying to avoid is the use of blocks within parentheses. (Aside: I changed my font to Monaco for JS because of the frequent appearance of `})`, and went to the trouble of fixing it up in Fontforge so gvim et al. would be willing to use it.)
I never want to see this:
anything(block {
// ...
}) <--- this
^^____this
but I still want the definition to be short-lived (more for self-documenting purposes than anything else, now that I think of it.) Your last example almost has it, but the parens are right there where I want them gone.
- masklinn 15y ago> The very thing I'm trying to avoid is the use of blocks within parentheses. That, er, makes no sense at all. Javascript's function uses braces, having an anonymous function within anything will yield either a brace-and-parens or a brace-and-comma. > Your last example almost has it, but the parens are right there where I want them gone. Then there's no point in using javascript, go do something else because trying to get rid of this will just yield to an idiosyncratic and mostly unusable coding style.
- smosher 15y agoThen there's no point in using javascript, go do something else No need to be rude. Look, I know JS likes to do things in ugly ways. It has great strength in the consistency of its syntax. That's cool. But by the time you say the word "just" you're being ignorant.
- masklinn 15y ago> No need to be rude. The statement was not intended to be rude and I'm sorry you took it this way, it was merely intended to be factual: you seem unhappy with javascript's core syntactic elements, you should use something else because they're not going to be changed. > Look, I know JS likes to do things in ugly ways. Uh... ok, whatever. > But by the time you say the word "just" you're being ignorant. Ignorant of what, of you trying to work around javascript's syntax in javascript for debatable reasons of personal aesthetics? No, I think I got that now, I was originally mistaken indeed in that I thought you were looking for an improvement to the language, not "fixing" an irrelevant syntactic pet peeve.
- smosher 15y agoThe statement was not intended to be rude It comes off as a euphemism for much shorter phrase. Perhaps you didn't intend to be rude, but you failed to be polite. Ignorant of what (Exactly.) You've made assumptions and pinned them to me. I'd set you straight but I don't actually want to continue this conversation. Sorry it didn't work out.
- masklinn 15y ago> Perhaps you didn't intend to be rude, but you failed to be polite. Considering your messages seem to be about misleading and avoiding spelling out your issues more than conversing, I had (and have) no reason to go out of my way to be polite. > I'd set you straight but I don't actually want to continue this conversation. And now you're plain and simply lying. You never intended to set anything straight (or you'd have done this in your previous comment instead of going for the pithy implication) and never intended this to be a discussion. > Sorry it didn't work out. It's not a relation, there's no "working out" to do.