It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
Braces defining scopes and braces defining objects have different effects, but I'd question whether the meanings of the braces themselves are that distinct. A scope encloses process in order to execute it conditionally, iteratively, later, or in particular contexts; an object literal encloses information so it can be referenced, destructured, and otherwise operated on. Object literals can also execute code intra-declaration, blurring the semiotic lines further:
const obj = {
one: whateverThisReturns(),
two: three ? four : five
};
The significance of braces isn't an either-or of scope vs declaration. It's that the contents -- whatever those may be -- represent an interruption in the top-to-bottom flow of execution. Enclosure is enclosure, no matter what you're doing inside it.
Personally, I like braces and you can take my semicolons from my cold dead hands.
It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
It'd depend. In C-family languages, I wouldn't, at least initially. But I could probably get used to it. I still don't like Groovy but there's a lot more going on there than the lack of semicolons.
Braces defining scopes and braces defining objects have different effects, but I'd question whether the meanings of the braces themselves are that distinct. A scope encloses process in order to execute it conditionally, iteratively, later, or in particular contexts; an object literal encloses information so it can be referenced, destructured, and otherwise operated on. Object literals can also execute code intra-declaration, blurring the semiotic lines further:
The significance of braces isn't an either-or of scope vs declaration. It's that the contents -- whatever those may be -- represent an interruption in the top-to-bottom flow of execution. Enclosure is enclosure, no matter what you're doing inside it.
Personally, I like braces and you can take my semicolons from my cold dead hands.
Genuinely curious, but why do you like semicolons? You seem to use a style of code which can be interpreted without them, yet you still want them.
I've been writing JavaScript more than anything else for the past five years but my background is all Java and C# and old habits die hard.
Also, JS being explicit about statement terminators would have saved me more time than I'd like to admit trying to figure out what was going on with
Without the fear of JS wackiness, would you be comfortable with semi-colon-less code?
I grew up on semi-colons as well. I don't use them in JS either now -- I'd rather play with fire than see them anymore. :)
It'd depend. In C-family languages, I wouldn't, at least initially. But I could probably get used to it. I still don't like Groovy but there's a lot more going on there than the lack of semicolons.
Other languages, anything goes.
Aah, that's an interesting way of thinking about it that I hadn't considered!